/* =========================================
   1. تنظیمات پایه و متغیرها
   ========================================= */
:root {
    --bg-deep: #030305;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-green: #0aff0a;
    --text-main: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* پیش‌فرض برای دسکتاپ */
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* جلوگیری حیاتی از اسکرول افقی */
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.6;
}

/* جلوگیری از بیرون زدن عکس‌ها */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 4px;
}

/* =========================================
   2. المان‌های پس‌زمینه
   ========================================= */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.cursor, .cursor2 {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}
.cursor {
    width: 10px;
    height: 10px;
    background: var(--neon-blue);
}
.cursor2 {
    width: 40px;
    height: 40px;
    border: 1px solid var(--neon-purple);
    transition: all 0.1s ease-out;
}

#progress-bar {
    position: fixed;
    top: 0;
    right: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to left, var(--neon-blue), var(--neon-purple));
    z-index: 1000;
    box-shadow: 0 0 10px var(--neon-blue);
}

/* =========================================
   3. ساختار اصلی لایه‌بندی
   ========================================= */
section {
    width: 100%;
    min-height: 80vh;
    padding: 60px 20px;
    
    /* سیستم وسط‌چین مرکزی */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    position: relative;
    overflow: hidden; /* جلوگیری از بیرون زدن محتوای داخلی */
}

/* =========================================
   4. استایل هدر و متن‌ها
   ========================================= */
.hero-section {
    min-height: 100vh;
}

.logo-container img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(188, 19, 254, 0.4);
    margin: 0 auto 30px auto;
}

.floating {
    animation: float 6s ease-in-out infinite;
}

h1.glitch {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 5px;
    text-shadow: 2px 2px 0px var(--neon-purple), -2px -2px 0px var(--neon-blue);
    line-height: 1.2;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.5rem;
    color: #aaa;
    margin-top: 20px;
    letter-spacing: 2px;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.spacer-text h2 {
    font-size: 3rem;
    line-height: 1.5;
}
.highlight {
    color: var(--neon-blue);
    font-size: 4rem;
    text-shadow: 0 0 20px var(--neon-blue);
}

/* =========================================
   5. کارت‌ها و کامپوننت‌ها
   ========================================= */

/* پنل شیشه‌ای */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 50px;
    max-width: 800px;
    width: 90%;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin: 0 auto;
}

/* ویدیو */
.video-wrapper {
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.2);
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    margin: 0 auto;
}
.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* عکس نئونی (نقل قول) */
.parallax-quote {
    padding: 50px 0;
    width: 100%;
}
.quote-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.neon-image {
    max-width: 800px;
    width: 90%; /* عرض امن */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.4));
    transition: transform 0.5s ease;
}

/* کارت پروژه ویژه (مشکل دار در عکس شما) - اصلاح شده */
.feature-project {
    perspective: 1000px;
}
.project-card {
    background: linear-gradient(135deg, rgba(20,20,20,0.9), rgba(50,50,50,0.9));
    padding: 60px; /* پدینگ زیاد فقط برای دسکتاپ */
    width: 90%;
    max-width: 700px;
    border-radius: 30px;
    border: 1px solid var(--neon-blue);
    transform-style: preserve-3d;
    transition: transform 0.5s;
    position: relative;
    margin: 0 auto; /* وسط‌چین اجباری */
    text-align: center;
}
.project-card:hover {
    transform: rotateX(5deg) rotateY(-5deg);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.3);
}
.badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--neon-green);
    color: black;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
}
.btn-neon {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 40px;
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 5px;
    transition: 0.3s;
}
.btn-neon:hover {
    background: var(--neon-blue);
    color: black;
    box-shadow: 0 0 30px var(--neon-blue);
}

/* =========================================
   6. پروژه‌های آرشیو (چپ و راست)
   ========================================= */
.project-showcase-left, .project-showcase-right {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 50px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.project-showcase-right {
    flex-direction: row-reverse;
}
.details {
    flex: 1;
    max-width: 450px;
    text-align: right;
    padding: 20px;
}
.visual {
    flex: 1;
    display: flex;
    justify-content: center;
}
.details h3 {
    font-size: 2rem;
    color: var(--neon-purple);
    margin-bottom: 20px;
}
.big-icon {
    font-size: 8rem;
    color: rgba(255,255,255,0.1);
    transition: 0.5s;
}
.visual:hover .big-icon {
    color: var(--text-main);
    transform: scale(1.1);
    text-shadow: 0 0 30px var(--neon-purple);
}
.link-text {
    color: var(--neon-blue);
    text-decoration: none;
    margin-top: 15px;
    display: block;
}

/* مهارت‌ها */
.tech-stack .icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    font-size: 4rem;
    margin-top: 40px;
    color: #888;
}

/* تماس */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 90%;
    max-width: 1000px;
}
.contact-card {
    background: rgba(255,255,255,0.03);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid transparent;
    transition: 0.3s;
}
.contact-card:hover {
    border-color: var(--neon-purple);
    background: rgba(188, 19, 254, 0.1);
}
.contact-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--neon-blue);
}
.contact-card a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    margin-top: 10px;
}

/* فوتر */
footer {
    padding: 50px 20px;
    background: black;
    border-top: 1px solid #333;
}
.footer-logo {
    width: 80px;
    opacity: 0.5;
    margin-bottom: 20px;
}

/* انیمیشن‌ها */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* =========================================
   بخش حیاتی اصلاح شده برای موبایل
   ========================================= */
@media screen and (max-width: 768px) {
    
    /* 1. حذف موس سفارشی */
    * { cursor: auto !important; }
    .cursor, .cursor2 { display: none !important; }

    /* 2. تنظیم فونت‌های بزرگ */
    h1.glitch { font-size: 2.5rem; letter-spacing: 1px; }
    .spacer-text h2 { font-size: 1.8rem; }
    .highlight { font-size: 2.5rem; }
    
    /* 3. اصلاح کارت پروژه (رفع مشکل بیرون زدگی عکس دوم) */
    .project-card {
        width: 95% !important; /* عرض رو کم می‌کنیم تا جا بشه */
        margin: 0 auto !important;
        padding: 30px 15px !important; /* پدینگ رو نصف کردیم */
        transform: none !important; /* حذف افکت سه بعدی در موبایل */
    }
    
    /* تنظیم بج روی کارت */
    .badge {
        position: relative; /* در موبایل بج بیاد بالای متن */
        top: 0; left: 0;
        display: inline-block;
        margin-bottom: 15px;
    }

    /* 4. ستونی کردن محتوای چپ و راست */
    .project-showcase-left, 
    .project-showcase-right {
        flex-direction: column !important;
        gap: 30px;
    }
    
    .details {
        text-align: center !important;
        padding: 0;
    }

    /* 5. ویدیو */
    .video-wrapper {
        width: 100% !important;
    }

    /* 6. تماس */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* 7. فاصله سکشن‌ها */
    section {
        padding: 40px 15px;
        min-height: auto;
    }
    
    /* 8. عکس نئونی */
    .neon-image {
        width: 100% !important;
    }
}