/* =========================================
   1. VARIABLES & RESET & SELECTION FIXES
   ========================================= */
:root {
    --primary: #BB274B;
    --primary-glow: rgba(187, 39, 75, 0.5);
    --dark: #1a1a2e;
    --light: #fdfdfd;
    --bg-top: #0f0c29;
    --bg-bottom: #302b63;
}

/* تنظیمات کلی برای همه المان‌ها */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    
    /* حذف رنگ آبی لحظه‌ای هنگام لمس در موبایل */
    -webkit-tap-highlight-color: transparent;
}

/* تنظیمات بادی و جلوگیری از انتخاب متن */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--bg-top), var(--bg-bottom));
    font-family: 'Vazirmatn', sans-serif;
    color: var(--light);
    
    /* جلوگیری از زوم و کشش */
    overscroll-behavior: none;
    touch-action: none; 
    position: fixed;
    
    /* --- کد جدید: جلوگیری از انتخاب متن --- */
    -webkit-user-select: none; /* Safari & Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* استاندارد */
    cursor: default;           /* نشانگر موس به حالت متنی تغییر نکند */
}

/* --- کد جدید: اگر به زور انتخاب شد، نامرئی باشد --- */
::selection {
    background: transparent;
    color: inherit;
}
::-moz-selection {
    background: transparent;
    color: inherit;
}


/* ستاره‌ها */
#star-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; opacity: 0.6; pointer-events: none;
}

/* =========================================
   2. GLOBE (اصلاح برش خوردگی)
   ========================================= */
#globe-viz {
    /* این لایه باید همیشه تمام صفحه باشد تا برش نخورد */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5; 
    
    /* محتویات داخلش (کانواس) هم پر شود */
    display: block;
    
    /* در حالت پیش‌فرض (دسکتاپ) */
    transform: translateY(0); 
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* کلاس برای وقتی روی دکمه کلیک شد (خروج کره) */
#globe-viz.earth-hide {
    transform: translateY(150%) !important;
}

/* =========================================
   3. CONTENT CONTAINER (متن و دکمه)
   ========================================= */
.container {
    position: absolute; /* روی کره قرار بگیرد */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    
    /* چیدمان */
    display: flex;
    flex-direction: column;
    align-items: center; /* وسط چین افقی */
    
    pointer-events: none; /* کلیک‌ها از فضای خالی رد شوند و به کره برسند */
}

/* تمام محتوای متنی و دکمه‌ها */
.container > * {
    pointer-events: auto; /* دکمه و متن قابل کلیک باشند */
    text-align: center;
    position: relative;
    z-index: 12;
}

/* انیمیشن محو شدن هنگام شروع */
.fade-out-down {
    opacity: 0;
    transform: translateY(100vh) scale(0.8);
    transition: all 1s ease-in;
    pointer-events: none !important;
}

/* =========================================
   4. ELEMENTS STYLES
   ========================================= */
.logo-wrapper {
    animation: float 6s ease-in-out infinite;
    margin-bottom: 10px;
    display: flex; justify-content: center;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.bird-wifi-svg {
    fill: none; stroke: var(--primary); stroke-width: 3;
    stroke-linecap: round; stroke-linejoin: round;
    filter: drop-shadow(0 0 15px var(--primary-glow));
    overflow: visible;
}

/* انیمیشن وای‌فای */
.wifi-wave { opacity: 0; animation: wifiPulse 2s infinite; }
.wifi-wave:nth-child(1) { animation-delay: 0s; }
.wifi-wave:nth-child(2) { animation-delay: 0.3s; }
.wifi-wave:nth-child(3) { animation-delay: 0.6s; }
@keyframes wifiPulse {
    0% { opacity: 0; transform: scale(0.8); stroke-width: 2; }
    50% { opacity: 1; stroke-width: 4; }
    100% { opacity: 0; transform: scale(1.2); stroke-width: 2; }
}

h1 {
    font-weight: 900; margin: 0 auto 10px auto;
    text-shadow: 0 5px 20px rgba(0,0,0,0.9), 0 0 30px var(--primary-glow);
    letter-spacing: -1px; line-height: 1.2;
    opacity: 0; transform: translateY(30px);
    animation: fadeInUp 0.8s forwards 0.3s;
}
h1 span { color: var(--primary); }

p.slogan {
    font-weight: 300; color: #ffffff;
    display: inline-block;
    margin: 0 auto 25px auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0; transform: translateY(30px);
    animation: fadeInUp 0.8s forwards 0.6s;
}

.btn-start {
    display: inline-block;
    font-family: 'Vazirmatn', sans-serif;
    color: white; background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    border-radius: 50px;
    position: relative; overflow: hidden;
    transition: all 0.3s ease; text-decoration: none;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(187, 39, 75, 0.2);
    cursor: pointer;
    opacity: 0; animation: fadeInUp 0.8s forwards 0.9s;
}
.btn-start::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--primary); transition: all 0.4s ease; z-index: -1;
}
.btn-start:hover::before { left: 0; }
.btn-start:hover { box-shadow: 0 0 30px var(--primary); transform: translateY(-3px); }

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

/* =========================================
   5. SERVICES SECTION (کانتینر اصلی خدمات)
   ========================================= */
/* =========================================
   ANIMATIONS FOR CARDS
   ========================================= */

/* حالت اولیه کارت‌ها: مخفی و پایین‌تر */
.service-card {
    opacity: 0;
    transform: translateY(50px); /* ۵۰ پیکسل پایین‌تر */
    /* ترنزیشن نرم و فنری برای حرکت */
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* (استایل‌های قبلی مثل بوردر و غیره سرجایشان باشند) */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* کلاسی که JS اضافه می‌کند تا کارت‌ها دیده شوند */
.service-card.visible {
    opacity: 1;
    transform: translateY(0); /* سر جای اصلی */
}

/* حالت هاور (جداگانه تعریف شده تا با انیمیشن ورود تداخل نکند) */
.service-card.visible:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

/* =========================================
   6. RESPONSIVE / MOBILE FIXES
   ========================================= */

/* --- Desktop Styles --- */
@media (min-width: 769px) {
    .cursor-dot, .cursor-outline { position: fixed; border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; z-index: 9999; }
    .cursor-dot { width: 8px; height: 8px; background: var(--primary); }
    .cursor-outline { width: 40px; height: 40px; border: 1px solid var(--primary-glow); transition: 0.2s; }
    
    .container { justify-content: center; } /* در دسکتاپ وسط باشد */
    .bird-wifi-svg { width: 140px; height: 140px; }
    h1 { font-size: 3.5rem; max-width: 800px; }
    p.slogan { font-size: 1.2rem; padding: 10px 35px; }
    .btn-start { padding: 15px 50px; font-size: 1.2rem; }
    
    #globe-viz { transform: translateY(15%); } /* کمی پایین در دسکتاپ */
}

/* --- Mobile Styles (Fixes Applied) --- */
@media (max-width: 768px) {
    .cursor-dot, .cursor-outline { display: none; }

    .container {
        /* 1. حل مشکل وسط رفتن: چسباندن به بالا */
        justify-content: flex-start; 
        /* 2. فاصله از بالا برای اینکه خیلی نچسبد */
        padding-top: 120px; 
        padding-left: 20px;
        padding-right: 20px;
    }

    .bird-wifi-svg { width: 90px; height: 90px; margin-bottom: 0; }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    p.slogan {
        font-size: 0.9rem;
        padding: 8px 20px;
        margin-bottom: 25px;
        max-width: 90%;
    }

    .btn-start {
        padding: 12px 40px;
        font-size: 1rem;
    }

    /* 3. حل مشکل برش کره */
    #globe-viz {
        /* ترفند: کانتینر تمام صفحه باقی می‌ماند تا رندر کامل باشد */
        /* اما با ترنسفورم، تصویر را پایین می‌آوریم */
        transform: translateY(35%); 
    }
}

/* گوشی‌های خیلی کوچک (SE, Fold) */
@media (max-width: 360px) {
    .container { padding-top: 80px; }
    #globe-viz { transform: translateY(30%); }
}
