/* =====================
   CSS Variables
   ===================== */
:root {
    --primary: #00d4ff;
    --primary-dark: #0099cc;
    --primary-glow: rgba(0, 212, 255, 0.3);
    --bg-dark: #0a0a0a;
    --bg-mid: #0f0f0f;
    --bg-deep: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #cccccc;
    --text-faint: #888888;
    --radius: 15px;
    --transition: 0.3s ease;
}

/* =====================
   Font Face
   ===================== */
@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iranyekan/iranyekanwebregular.woff2') format('woff2'),
         url('../fonts/iranyekan/iranyekanwebregular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iranyekan/iranyekanwebbold.woff2') format('woff2'),
         url('../fonts/iranyekan/iranyekanwebbold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* =====================
   Reset & Base
   ===================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'IRANYekan', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =====================
   Container
   ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* =====================
   Header (Sticky & Transparent)
   ===================== */
.header {
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    background: transparent; 
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.4s ease; 
}

/* استایل هدر هنگام اسکرول (سفید بسیار شفاف شیشه‌ای) */
.header.scrolled {
    background: rgba(255, 255, 255, 0.07); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem 0; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.logo img {
    height: 70px;
    width: auto;
    transition: height var(--transition);
}

.header.scrolled .logo img {
    height: 55px; 
}

.header-action {
    flex: 1;
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    gap: 15px;
}

/* =====================
   Menu Toggle
   ===================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* =====================
   Nav
   ===================== */
.nav {
    display: flex;
    gap: 2rem;
    flex: 2;
    justify-content: center;
}

.nav a {
    color: var(--text-main);
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--text-main);
    transition: width var(--transition);
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--text-muted);
    outline: none;
}

.nav a:hover::after,
.nav a:focus-visible::after {
    width: 100%;
}

/* =====================
   Outline Button (Base Style)
   ===================== */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50px; /* شکل بیضی کشیده */
    font-weight: bold;
    transition: all var(--transition);
    position: relative;
    animation: pulse-white 2s infinite;
}

.btn-outline.phone-btn {
    direction: ltr;
    padding: 8px 18px; 
}

@keyframes pulse-white {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: #ffffff;
    color: var(--bg-dark);
    animation: none;
    transform: translateY(-3px);
    outline: none;
}

/* =====================
   Mobile Menu & Layout Tweaks
   ===================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .header-content {
        position: relative; /* برای قرارگیری مطلق دکمه نسبت به هدر */
    }

    .logo img {
        height: 50px;
    }

    .header-action {
        gap: 8px; 
    }
    
    /* لغو مخفی شدن شماره تلفن در موبایل */
    .phone-number {
        display: inline;
    }
    
    /* تنظیمات دکمه موبایل: حذف حالت گرد و حفظ ظاهر دسکتاپ با موقعیت مرکزی */
    .btn-outline.phone-btn {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* قرارگیری دقیق در مرکز هدر */
        
        /* بازگرداندن پدینگ و شعاع اصلی دکمه دسکتاپ */
        padding: 8px 16px; /* پدینگ کمی کمتر برای موبایل اما حفظ ظاهر */
        border-radius: 50px; /* لغو گرد بودن کامل موبایل قبلی */
        font-size: 0.9rem; /* کمی کوچکتر شدن فونت برای جا شدن بهتر */
        margin: 0;
        z-index: 5;
    }

    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform var(--transition);
        z-index: 999;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav a {
        font-size: 1.2rem;
    }
}

/* =====================
   Hero
   ===================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/hero-bg.jpg') center center / cover no-repeat;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease both;
}

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

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-main);
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

/* =====================
   Sections
   ===================== */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 3px;
    background: var(--text-main);
}

/* =====================
   About (با افکت متحرک نئونی - بهینه شده برای موبایل)
   ===================== */
.about {
    background-color: var(--bg-mid);
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
}

/* لکه نوری متحرک اول (سمت چپ) */
.about::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--primary); 
    border-radius: 50%;
    filter: blur(90px);
    -webkit-filter: blur(90px);
    opacity: 0.3; 
    animation: floatBlob1 8s infinite ease-in-out alternate;
    pointer-events: none;
    z-index: 0;
    /* اجبار مرورگر به استفاده از GPU برای جلوگیری از چشمک زدن */
    will-change: transform; 
}

/* لکه نوری متحرک دوم (سمت راست) */
.about::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary-dark); 
    border-radius: 50%;
    filter: blur(100px);
    -webkit-filter: blur(100px);
    opacity: 0.25;
    animation: floatBlob2 10s infinite ease-in-out alternate;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

/* انیمیشن‌ها با استفاده از translate3d برای رندر نرم‌تر */
@keyframes floatBlob1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(40vw, 10vh, 0) scale(1.2); } 
}

@keyframes floatBlob2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-30vw, -15vh, 0) scale(1.1); } 
}

/* =====================
   بهینه‌سازی افکت برای موبایل
   ===================== */
@media (max-width: 768px) {
    /* کوچکتر کردن لکه‌ها و کاهش تاری برای جلوگیری از فشار به گرافیک موبایل */
    .about::before {
        width: 250px;
        height: 250px;
        filter: blur(60px);
        -webkit-filter: blur(60px);
        opacity: 0.25;
    }
    .about::after {
        width: 300px;
        height: 300px;
        filter: blur(70px);
        -webkit-filter: blur(70px);
        opacity: 0.2;
    }
    
    /* حرکت کوتاه‌تر در موبایل برای جلوگیری از پرش تصویر */
    @keyframes floatBlob1 {
        0% { transform: translate3d(0, 0, 0) scale(1); }
        100% { transform: translate3d(15vw, 5vh, 0) scale(1.1); }
    }
    @keyframes floatBlob2 {
        0% { transform: translate3d(0, 0, 0) scale(1); }
        100% { transform: translate3d(-15vw, -5vh, 0) scale(1.1); }
    }
}

/* بالا آوردن محتوا */
.about .container {
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* =====================
   Products
   ===================== */
.products {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-deep) 100%);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
}

.product-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--primary-glow);
    border-color: var(--text-main);
    outline: none;
}

.product-image {
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
}

.product-bg-1 { background-color: #1a1a2e; }
.product-bg-2 { background-color: #16213e; }
.product-bg-3 { background-color: #0f3460; }

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 1.5rem;
    text-align: center;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.product-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =====================
   Videos
   ===================== */
.videos {
    background: var(--bg-mid);
}

.videos-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0 1.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.videos-scroll::-webkit-scrollbar {
    height: 6px;
}

.videos-scroll::-webkit-scrollbar-track {
    background: var(--border-subtle);
    border-radius: 10px;
}

.videos-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

.video-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

.video-card video {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border-subtle);
    transition: all var(--transition);
    display: block;
}

.video-card video:hover {
    border-color: var(--text-main);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .video-card {
        flex: 0 0 340px;
    }

    .video-card video {
        height: 580px;
    }
}

/* رفع مشکل متمایل بودن به راست در دسکتاپ */
@media (min-width: 1100px) {
    .videos-scroll {
        justify-content: center; /* ویدئوها را دقیقاً در مرکز قرار می‌دهد */
    }
}

/* =====================
   Contact
   ===================== */
.contact {
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-dark) 100%);
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contact-item {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
    font-style: normal;
}

.contact-item:hover {
    border-color: var(--text-main);
    transform: translateY(-5px);
}

.contact-item h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-item p {
    color: var(--text-muted);
    font-size: 1rem;
}

.contact-item a {
    color: var(--text-muted);
    transition: color var(--transition);
}

.contact-item a:hover {
    color: var(--text-main);
}

/* =====================
   Footer
   ===================== */
.footer {
    background: var(--bg-dark);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.footer p {
    color: var(--text-faint);
    font-size: 0.9rem;
}

/* =====================
   Mobile Tweaks
   ===================== */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
}

/* =====================
   Reduced Motion
   ===================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}