/* Reset & Base Styles */
:root {
    --primary-dark: #1a0b2e;
    --primary-purple: #4a148c;
    --primary-red: #d50000;
    --gradient-main: linear-gradient(135deg, #4a148c 0%, #d50000 100%);
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    direction: rtl;
    overflow-x: hidden;
    font-display: swap;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Helper Classes */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-dark {
    background-color: var(--primary-dark);
    color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-subtitle {
    color: var(--primary-red);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.section-title.white {
    color: var(--white);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-main);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(213, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(213, 0, 0, 0.4);
}

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
    margin-right: 15px;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-purple);
}

/* Header */
header {
    background: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Force-hide any leftover theme toggle / moon icon in the header (in case injected or cached) */
header .theme-toggle,
header .fa-moon,
header .moon,
header .moon-icon,
header .toggle-theme,
header #theme-toggle {
    display: none !important;
}

.logo img {
    height: 50px;
}

nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    font-weight: 500;
    color: var(--primary-dark);
    position: relative;
}

nav a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    right: 0;
    background: var(--gradient-main);
    transition: var(--transition);
}

nav a:not(.btn-nav):hover::after {
    width: 100%;
}

.btn-nav {
    background: var(--gradient-main);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 90vh;
    /* use explicit background properties so different file extensions work reliably */
    background-image: url('assets/images/hero-bg.jpeg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: -80px;
    /* Pull behind header if transparent, but header is white now */
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* slightly lighter overlay to improve visibility of new banners while keeping contrast */
    background: linear-gradient(135deg, rgba(26, 11, 46, 0.65), rgba(213, 0, 0, 0.45));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 900;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* About Section */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.section-title-left {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.text-box p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-purple);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item .label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.image-box {
    position: relative;
}

.image-box img {
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 150px;
}

.experience-badge .years {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-red);
    line-height: 1;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #eee;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: rgba(74, 20, 140, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.service-card:hover .icon-box {
    background: var(--gradient-main);
}

.service-card i {
    font-size: 2rem;
    color: var(--primary-purple);
    transition: var(--transition);
}

.service-card:hover i {
    color: var(--white);
}

.service-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}


/* Partners / Logos */
.partners-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
    align-items: center;
    justify-items: center;
    align-content: center;
}

.partner-logo {
    background: var(--white);
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    height: 88px; /* slightly smaller uniform card height for better balance */
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Floating subtle animation for partner logos */
@keyframes logoFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}
.partners-list .partner-logo { animation: logoFloat 7s ease-in-out infinite; }
.partners-list .partner-logo:nth-child(odd) { animation-duration: 6.2s; }
.partners-list .partner-logo:nth-child(3n) { animation-duration: 8s; }
.partners-list .partner-logo:hover { box-shadow: var(--shadow-md); transform: translateY(-4px) scale(1.03); }

/* CountUp numbers subtle pulse when done */
@keyframes pulseOnce { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
.countup { display: inline-block; }
.countup.done { animation: pulseOnce .6s ease; }

@media (prefers-reduced-motion: reduce) {
    .partners-list .partner-logo,
    .partners-list .partner-logo:nth-child(odd),
    .partners-list .partner-logo:nth-child(3n) {
        animation: none !important;
    }
    .countup.done { animation: none !important; }
}

.partner-logo img {
    max-height: 70%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Ensure partner logos keep original colors and aren't affected by global filters */
.partner-logo img {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    background: transparent;
}

.partners.section-padding {
    padding-top: 60px;
    padding-bottom: 80px;
}

/* Center partners section title */
.partners .section-title {
    text-align: center;
    margin-bottom: 28px;
}

/* Footer improvements */
footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.footer-logo img {
    height: 48px;
    object-fit: contain;
    /* display footer logo in white for contrast on dark background */
    /* Use stronger rule and !important to ensure it overrides inline styles or caching */
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
}

/* Footer brand text styling (replaces footer image) */
.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.footer-brand {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
    /* gradient text matching brand */
    background: linear-gradient(90deg, #4a148c 0%, #d50000 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.footer-tagline {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
}

/* Tidy up footer column spacing */
.footer-col p {
    margin-top: 10px;
    margin-bottom: 0;
    color: rgba(255,255,255,0.85);
}

@media (max-width: 768px) {
    .footer-logo {
        align-items: center;
    }
    .footer-col {
        text-align: center;
    }
}

/* Ensure header/logo image keeps original colors */
.logo img {
    filter: none !important;
    -webkit-filter: none !important;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 12px;
}

.footer-col p,
.footer-col ul,
.footer-col li {
    color: rgba(255,255,255,0.85);
}

.footer-col ul {
    padding: 0;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.9);
}

.copy {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 20px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

/* Footer spacing and responsive tweaks */
.footer-col {
    line-height: 1.8;
}

.footer-col p {
    margin-bottom: 12px;
}

.footer-col ul li {
    margin-bottom: 8px;
}

/* Make footer more readable on small screens */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col ul,
    .footer-col p {
        margin-left: 0;
        margin-right: 0;
        display: inline-block;
    }

    .footer-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 12px;
    }

    .footer-col .contact-list li {
        justify-content: center;
    }
}

/* Partners responsive tweaks */
@media (max-width: 600px) {
    .partners-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 16px;
    }

    .partner-logo {
        max-width: 200px;
        height: 72px;
        padding: 10px;
    }

    .partner-logo img {
        max-height: 60%;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* Smaller devices further adjustments */
@media (max-width: 400px) {
    .partner-logo {
        height: 64px;
        max-width: 160px;
    }

    .partners .section-title {
        font-size: 1.25rem;
    }
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-right: 5px;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-list i {
    color: var(--primary-red);
    margin-top: 5px;
}

.copy {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 30px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 2.8rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .image-box {
        order: -1;
        margin-bottom: 30px;
    }

    .experience-badge {
        right: 20px;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    nav ul.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero {
        height: auto;
        padding: 150px 0 100px;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* ===================== Animations & Motion ===================== */
/* Utilities for reveal-on-scroll and subtle entrance effects */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(32px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(.92); }
    100% { opacity: 1; transform: scale(1); }
}

/* Base reveal state */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .9s ease, transform .9s ease;
    will-change: opacity, transform;
}

/* Activated state */
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* Optional variants */
.fade-up { animation: fadeUp 1s ease forwards; }
.scale-in { animation: scaleIn .8s ease forwards; }

/* Stagger helpers */
.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }

/* Hero specific subtle entrance */
.hero .hero-content h1,
.hero .hero-content p,
.hero .hero-btns { opacity: 0; }
.hero.ready .hero-content h1 { animation: fadeUp .9s ease forwards; }
.hero.ready .hero-content p { animation: fadeUp 1s ease forwards .15s; }
.hero.ready .hero-btns { animation: fadeUp 1s ease forwards .3s; }

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal.in, .fade-up, .scale-in,
    .hero .hero-content h1, .hero .hero-content p, .hero .hero-btns {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===================== Accessibility & UX Enhancements ===================== */
/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-purple);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 10px;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-main);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(213, 0, 0, 0.4);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: opacity 0.2s ease;
    }
    .scroll-to-top:hover {
        transform: none;
    }
}