:root{
    --header-height: 90px;
    --bg-main: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    --text-main: #ffffff;
    --muted: #cbd5e1;
    --card-bg: rgba(15, 23, 35, 0.82);
    --card-border: rgba(59, 130, 246, 0.14);
    --accent-500: #3b82f6;
    --accent-600: #1d4ed8;
    --accent-400: #60a5fa;
}

/* فونت‌ها */
@font-face {
    font-family: 'XB-Titre';
    src: url('../fonts/XB-Titre.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/Shabnam-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* تم روشن */
html.light-theme {
    --bg-main: linear-gradient(180deg, #f7f7fb 0%, #ffffff 100%);
    --text-main: #0f172a;
    --muted: #475569;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(15, 23, 42, 0.06);
    --accent-500: #2563eb;
    --accent-600: #1e40af;
    --accent-400: #1e90ff;
}

/* استایل‌های پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* هدر */
.header {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
html.light-theme .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.header.scrolled {
    background: rgba(10, 10, 15, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* نویگیشن */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    position: relative;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}
.logo:hover { transform: scale(1.05); }
.logo-img { width: 50px; height: 50px; border-radius: 12px; }
.logo-text { color: var(--text-main); }
html.light-theme .logo-text {
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* دکمه تغییر تم */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 8px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 60px;
    height: 30px;
    transition: all 0.3s ease;
}
.theme-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    left: 3px;
}
html.light-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0,0,0,0.1);
}
html.light-theme .theme-icon { transform: translateX(30px); }

/* منو */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}
.nav-item { position: relative; }
.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-link:hover {
    color: var(--accent-500);
    background: rgba(59, 130, 246, 0.06);
}

/* منوی دراپ‌داون */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    min-width: 280px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    list-style: none;
    z-index: 1001;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-link {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.dropdown-link:hover {
    color: var(--accent-500);
    background: rgba(59, 130, 246, 0.06);
}

/* منوی همبرگری */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}
.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* بخش هیرو */
.hero-section {
    text-align: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title, .section-title, .tool-name, .service-title {
    font-family: 'XB-Titre', 'Vazirmatn', sans-serif;
    letter-spacing: 0.6px;
}
.hero-title {
    font-size: 4rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.hero-subtitle {
    font-size: 1.4rem;
    color: var(--muted);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
    z-index: 1;
}
.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}

/* محتوای اصلی */
.main {
    padding-top: var(--header-height);
}

/* بخش‌ها */
.section {
    padding: 80px 0;
    position: relative;
}
.section-header {
    text-align: center;
    margin-bottom: 60px;
}
.section-title {
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 15px;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    border-radius: 2px;
}
.section-subtitle {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

/* گرید ابزارها */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.tool-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 35px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.tool-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}
.tool-icon .icon-placeholder {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 25px;
}
.tool-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
}
.tool-description {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 25px;
    line-height: 1.6;
}
.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}
.tag {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-400);
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
}
.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
    text-decoration: none;
    padding: 14px 25px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.tool-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}
.link-arrow { transition: transform 0.3s ease; }
.tool-link:hover .link-arrow { transform: translateX(-5px); }

/* بخش خدمات */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    transition: all 0.4s ease;
}
.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}
.service-icon .icon-placeholder {
    width: 80px;
    height: 80px;
    font-size: 32px;
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}
.service-title {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 20px;
}
.service-description {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 25px;
}
.service-features {
    list-style: none;
    margin-bottom: 30px;
    text-align: right;
    padding: 0;
}
.service-features li {
    padding: 8px 25px 8px 0;
    position: relative;
}
.service-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #10b981;
    font-weight: bold;
}

/* بخش شبکه‌های اجتماعی */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.social-link {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
}
.social-link:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}
.social-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    border-radius: 16px;
    color: white;
}
.social-info h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-main);
}
.social-info p {
    color: var(--muted);
    font-size: 1rem;
}

/* فوتر */
.footer {
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    padding: 60px 0 30px;
    margin-top: 80px;
}
html.light-theme .footer {
    background: transparent;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}
.footer-logo { display: flex; align-items: center; gap: 15px; }
.footer-logo-img { width: 40px; height: 40px; border-radius: 8px; }
.footer-logo-text { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
html.light-theme .footer-logo-text {
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-links { display: flex; gap: 30px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--accent-500); }
.footer-social { display: flex; gap: 15px; justify-content: center; }
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    color: var(--muted);
}
.footer-social a:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.18);
    transform: translateY(-2px);
    color: var(--accent-400);
}
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    color: #64748b;
    font-size: 0.95rem;
}
.footer-bottom p { margin: 0; }

/* مودال */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    backdrop-filter: blur(5px);
    padding: 20px;
    overflow-y: auto;
}
html.light-theme .modal { background: rgba(15, 23, 42, 0.75); }
.modal-content {
    background: var(--card-bg);
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: right;
}
html.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.1);
}
.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.modal-close:hover { background-color: rgba(255, 255, 255, 0.1); }
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}
.modal-tool-button {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
}
.modal-tool-button.secondary {
    background: transparent;
    border: 2px solid var(--accent-500);
    color: var(--accent-500);
}
.modal-tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}
.modal-tool-button.secondary:hover {
    background: var(--accent-500);
    color: white;
}
.modal-video-container {
    display: none; /* Hidden by default, shown by JS */
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
}
.modal-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
}
.modal h2 {
    color: var(--text-main);
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.modal p {
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.dubbing-sections { display: flex; flex-direction: column; gap: 30px; margin-top: 20px; }
.dubbing-section {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 20px;
}
.dubbing-section h3 { font-size: 1.3rem; margin-bottom: 10px; }
.dubbing-section p { font-size: 1rem; }
.dubbing-section .modal-actions { margin: 15px 0; }

/* طراحی واکنش‌گرا */
@media (max-width: 1024px) {
    .hero-title { font-size: 3.5rem; }
    .tools-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
    .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        padding-top: 50px;
        transition: right 0.3s ease;
        border-top: 1px solid rgba(59, 130, 246, 0.2);
    }
    .nav-menu.active { right: 0; }
    .nav-item { width: 100%; text-align: center; }
    .nav-link { display: block; padding: 15px 20px; font-size: 1.1rem; }
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(59, 130, 246, 0.06);
        border: none;
        box-shadow: none;
        margin-top: 10px;
    }
    .hero-title { font-size: 2.8rem; }
    .section-title { font-size: 2.5rem; }
    .tools-grid { grid-template-columns: 1fr; }
}

/* اسکرول‌بار */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-500), #8b5cf6);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-600), #7c3aed);
}
