@import url('https://fonts.googleapis.com/css2?family=Syncopate:wght@400;700&family=Space+Grotesk:wght@300;400;600&display=swap');

:root {
    /* MAMMAD: CHANGE THIS COLOR TO CHANGE THE WHOLE SITE THEME */
    --color-accent: #00f0ff;

    --font-main: 'Space Grotesk', sans-serif;
    --font-display: 'Syncopate', sans-serif;
    --bg-dark: #050505;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: #ffffff;
    font-family: var(--font-main);
    cursor: none;
    overflow-x: hidden;
    transition: --color-accent 0.5s ease;
}

body.modal-open {
    overflow: hidden;
}

#app-content {
    will-change: transform, text-shadow;
    width: 100%;
    overflow-x: hidden;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

/* Cursor */
/* --- SCI-FI CURSOR --- */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10002;
    box-shadow: 0 0 10px var(--color-accent);
}

.cursor-hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10001;
    transition: width 0.3s ease-out, height 0.3s ease-out;
}

/* Inner Ring (Fast Spin) */
.hud-ring-inner {
    position: absolute;
    inset: 0;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    border-top-color: transparent;
    border-bottom-color: transparent;
    opacity: 0.8;
    animation: hud-spin 2s linear infinite;
    box-shadow: 0 0 5px var(--color-accent);
}

/* Outer Ring (Slow Reverse Spin) */
.hud-ring-outer {
    position: absolute;
    inset: -8px;
    /* Bigger than inner */
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: hud-spin-reverse 10s linear infinite;
}

/* Hover State (Locked On) */
.cursor-hud.hovered {
    width: 40px;
    height: 40px;
}

.cursor-hud.hovered .hud-ring-inner {
    border-color: #fff;
    border-width: 4px;
    animation-duration: 0.5s;
    /* Spinds faster on targets */
}

.cursor-hud.hovered .hud-ring-outer {
    border-color: var(--color-accent);
    border-style: solid;
    opacity: 0.5;
}

@keyframes hud-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes hud-spin-reverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Loader */
.media-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    z-index: 10;
    display: none;
}

.media-loader.active {
    display: block;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Audio Toggle */
.audio-toggle {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 500;
    width: 50px;
    height: 50px;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: none;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.audio-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.audio-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 15px;
}

.bar {
    width: 3px;
    background: white;
    animation: sound-wave 0.5s infinite alternate;
}

.audio-toggle.muted .bar {
    animation: none;
    height: 3px !important;
}

.audio-toggle:hover .bar {
    background: var(--color-accent);
}

@keyframes sound-wave {
    0% {
        height: 3px;
    }

    100% {
        height: 15px;
    }
}

.bar:nth-child(2) {
    animation-delay: 0.1s;
}

.bar:nth-child(3) {
    animation-delay: 0.2s;
}

/* Glitch Text */
.glitch-text {
    font-family: var(--font-display);
    position: relative;
    color: white;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--color-accent);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(38px, 9999px, 81px, 0);
    }

    20% {
        clip: rect(6px, 9999px, 14px, 0);
    }

    100% {
        clip: rect(81px, 9999px, 2px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(25px, 9999px, 97px, 0);
    }

    20% {
        clip: rect(89px, 9999px, 16px, 0);
    }

    100% {
        clip: rect(96px, 9999px, 63px, 0);
    }
}

/* Nav */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease, background-color 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
    transition: color 0.3s;
}

/* Full Projects Page */
#all-projects-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #050505;
    z-index: 2000;
    display: none;
    opacity: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    border: 1px solid #333;
    color: #888;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.05);
}

#all-projects-view button {
    pointer-events: auto !important;
    z-index: 1000 !important;
}

/* Modal */
#project-modal {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 5000;
}

.modal-content {
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        flex-direction: row;
    }
}

/* Thumbnails */
#modal-thumbs-container {
    justify-content: center;
    background: #050505;
    padding: 10px;
}

.thumbs-scroll::-webkit-scrollbar {
    height: 4px;
}

.thumbs-scroll::-webkit-scrollbar-track {
    background: #111;
}

.thumbs-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.thumbs-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

.thumb-btn {
    opacity: 0.5;
    transition: all 0.3s;
    border: 2px solid transparent;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.thumb-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.thumb-btn.active {
    opacity: 1;
    border-color: var(--color-accent);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.carousel-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: var(--color-accent);
    color: black;
    border-color: var(--color-accent);
}


/* Tabs */
.tab-btn {
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Award Badge */
.award-badge {
    border: 1px solid #ffcc00;
    color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
    animation: pulse-gold 3s infinite;
}

@keyframes pulse-gold {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    }
}

.section-padding {
    padding-top: 120px;
    padding-bottom: 120px;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--color-accent);
    transition: width 0.2s;
}

/* 3D Tilt */
.tilt-card {
    transition: transform 0.1s;
    transform-style: preserve-3d;
}

.tilt-card-content {
    transform: translateZ(20px);
}

.project-card:hover {
    border-color: var(--color-accent);
    transition: border-color 0.3s;
}

.project-card:hover .accent-text {
    color: var(--color-accent);
    transition: color 0.3s;
}

.project-card:hover .accent-bg {
    background-color: var(--color-accent);
    transition: background-color 0.3s;
}

/* --- NEW GLOW ANIMATION FOR ARCHIVE BUTTON --- */
#view-archive-btn {
    animation: super-glow 2s infinite ease-in-out;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border-width: 2px;
}

@keyframes super-glow {
    0% {
        box-shadow: 0 0 5px var(--color-accent), inset 0 0 2px var(--color-accent);
        border-color: var(--color-accent);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 25px var(--color-accent), inset 0 0 10px var(--color-accent);
        border-color: white;
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 5px var(--color-accent), inset 0 0 2px var(--color-accent);
        border-color: var(--color-accent);
        transform: scale(1);
    }
}

/* FORM STATUS */
#form-status {
    margin-top: 1rem;
    font-size: 0.8rem;
    font-family: monospace;
    text-align: center;
    min-height: 20px;
}

#form-status.success {
    color: #00ff88;
}

#form-status.error {
    color: #ff0055;
}

/* Gamification Styles */
#neural-hud {
    transition: all 0.3s ease;
}

.level-up-anim {
    animation: levelUpPulse 0.8s ease-in-out;
}

@keyframes levelUpPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 240, 255, 0);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.8);
        border-color: #fff;
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 240, 255, 0);
    }
}

/* --- MULTIPLAYER CURSORS --- */
.net-cursor {
    position: absolute;
    width: 12px;
    /* کوچکتر و ظریف‌تر */
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    /* مهم برای سیستم جدید */
    transition: transform 0.1s linear;
    /* نرمی حرکت */
    box-shadow: 0 0 10px currentColor;
    /* درخشش نئونی */
}

.net-cursor::after {
    content: attr(data-id);
    position: absolute;
    top: -20px;
    left: 15px;
    font-size: 10px;
    color: inherit;
    /* همرنگ خود نشانگر */
    font-family: 'Space Grotesk', monospace;
    opacity: 0.8;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 4px;
    border-radius: 4px;
}

/* --- CHROMATIC ABERRATION GLITCH --- */
.chromatic-hover {
    position: relative;
    display: inline-block;
}

.chromatic-hover:hover {
    animation: chromatic-shake 0.3s cubic-bezier(.36, .07, .19, .97) both infinite;
    text-shadow:
        2px 0 rgba(255, 0, 0, 0.7),
        -2px 0 rgba(0, 0, 255, 0.7);
}

/* --- HOLOGRAPHIC & UNITY THEME --- */
.perspective-container {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 10s linear infinite;
}

/* Dota 2 Text Glow */
.shadow-glow {
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

/* Unity Input Field Focus */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 1px #39ff14;
}

/* UNITY EDITOR STYLES */
#inspector-window {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Custom Cursor for Labels to mimic variable dragging */
.cursor-ew-resize {
    cursor: ew-resize;
}

/* Unity Input Focus State */
#unity-form input:focus,
#unity-form textarea:focus {
    border-color: #3A79BB !important;
    background-color: #2a2a2a;
}

/* Unity Scrollbar */
#unity-form textarea::-webkit-scrollbar {
    width: 8px;
    background: #282828;
}

#unity-form textarea::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

#unity-form textarea::-webkit-scrollbar-thumb:hover {
    background: #777;
}


#vfx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    /* بالاترین لایه برای دیده شدن روی همه چی */
    mix-blend-mode: screen;
    opacity: 0.8;
}

/* --- STEAM ACHIEVEMENT --- */
#steam-achievement {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.achievement-visible {
    right: 40px !important;
}

/* Optional: Scanline effect over achievement */
#steam-achievement::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 2px,
            transparent 2px,
            transparent 4px);
    pointer-events: none;
}

/* UNITY CUSTOM SCROLLBAR */
.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
    background: #282828;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #595959;
    border-radius: 2px;
    border: 2px solid #282828;
    /* Padding effect */
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* COMMISSION MODAL ANIMATIONS */
#commission-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#commission-modal.active #commission-content {
    transform: scale(1);
}

/* Custom Select Arrow */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* TECH BUTTONS STYLE */
.tech-btn {
    position: relative;
    cursor: none;
    /* چون سیستم موس داریم */
    transition: all 0.3s ease;
}

.tech-btn.primary {
    color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.tech-btn.primary:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

.tech-btn.secondary {
    color: white;
}

.tech-btn.secondary:hover {
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
/* --- MOBILE FINAL LAYOUT (MAX TEXT SPACE) --- */
@media (max-width: 768px) {
    
    /* 1. ساختار کلی مدال (تمام صفحه) */
    .modal-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: #000 !important;
    }

    /* 2. محدود کردن ارتفاع مدیا (فقط ۳۰ درصد صفحه رو بگیره) */
    .modal-content > div:first-child {
        width: 100% !important;
        height: 30vh !important; /* 👈 نکته کلیدی: ارتفاع ثابت ۳۰ درصد */
        min-height: 200px !important; /* حداقل ارتفاع که خیلی ریز نشه */
        flex-shrink: 0 !important;
        position: relative !important;
        background: #000 !important;
        aspect-ratio: auto !important; /* حذف نسبت تصویر ۱۶:۹ */
    }

    /* 3. زوم کردن عکس/ویدیو برای پر کردن کادر (بدون سیاهی) */
    .modal-content > div:first-child img,
    .modal-content > div:first-child video,
    .modal-content > div:first-child iframe {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* 👈 این خط سیاهی‌ها رو کامل حذف میکنه */
        display: block !important;
    }

    /* 4. دکمه‌های روی عکس */
    .modal-content > button.absolute {
        top: 12px !important;
        right: 12px !important;
        z-index: 50 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        width: 32px;
        height: 32px;
        border-radius: 50%;
    }
    
    .modal-content .absolute.top-4.left-4 {
        top: 12px !important;
        left: 12px !important;
        z-index: 50 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        padding: 4px 8px;
        border-radius: 4px;
    }

    /* 5. باز کردن حداکثر فضا برای متن */
    .modal-content > div:last-child {
        flex: 1 !important; /* تمام فضای باقی‌مانده (۷۰ درصد) مال متنه */
        width: 100% !important;
        overflow-y: auto !important;
        padding: 20px !important;
        padding-bottom: 100px !important; /* فضای خالی ته برای دکمه‌ها */
        background: #050505 !important;
        border-top: 1px solid #222;
    }

    /* استایل فونت‌ها برای موبایل */
    .modal-content h2 {
        font-size: 1.5rem !important;
        margin-top: 0 !important;
        line-height: 1.2;
    }

    /* 6. دکمه‌های پایین (فیکس شده) */
    #modal-action-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
        background: #0a0a0a !important;
        border-top: 1px solid #333 !important;
        z-index: 1000 !important;
    }

    #modal-action-bar button {
        width: 100% !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.75rem !important;
        white-space: normal !important;
    }
    
    #modal-action-bar button svg {
        display: none !important;
    }
}
/* افکت نویز روی عکس هاور */
.hover-img {
    mix-blend-mode: luminosity;
    /* یا 'screen' برای افکت هولوگرافیک */
    filter: contrast(1.2) brightness(1.1);
}

/* --- SCIFI SCANNER SLIDESHOW --- */

.card-media-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* عکس ثابت (زیرین) */
.img-display {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* عکس بعدی (رویی - که قراره بیاد) */
.img-next {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;

    /* حالت پیش‌فرض: مخفی شده در سمت چپ */
    clip-path: polygon(0 0, 0 0, -20% 100%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.65, 0, 0.35, 1);
    /* انیمیشن نرم */
}

/* وقتی کلاس active میگیره، کل صفحه رو میپوشونه */
.img-next.active {
    clip-path: polygon(0 0, 150% 0, 130% 100%, 0 100%);
}

/* خط لیزری اسکنر */
.scan-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20%;
    /* شروع از بیرون کادر */
    width: 50px;
    /* پهنای هاله نور */
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.8;
    z-index: 3;
    transform: skewX(-20deg);
    /* کج کردن خط */
    pointer-events: none;
    transition: left 1.2s cubic-bezier(0.65, 0, 0.35, 1);
    display: none;
    /* پیش‌فرض مخفی */
}

.scan-line.active {
    display: block;
    left: 120%;
    /* حرکت تا بیرون کادر سمت راست */
}

/* --- MOBILE CURSOR FIX --- */
@media (max-width: 768px) {

    /* 1. مخفی کردن دایره و حلقه کرسر */
    .cursor-dot,
    .cursor-hud,
    .net-cursor {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* 2. برگرداندن سیستم لمس استاندارد گوشی */
    body,
    a,
    button,
    .project-card {
        cursor: auto !important;
        /* موس مخفی نشه */
    }
}

#mobile-menu-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.mobile-menu-btn.active {
    color: var(--color-accent);
}