/* Google Font Import: Vazirmatn (for Persian text support) */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* Global Color Variables and Dark Mode */
:root {
    --brand: #0f172a;
    --text: #111827;
    --muted: #6b7280;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e5e7eb;
    /* OpenAI inspired colors for dark mode */
    --brand-dark: #10a37f;
    --text-dark: #ffffff;
    --muted-dark: #9ca3af;
    --bg-dark: #0d1117;
    --white-dark: #161b22;
    --border-dark: #30363d;
    --accent: #10a37f;
    --accent-light: rgba(16, 163, 127, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --brand: var(--brand-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --bg: var(--bg-dark);
    --white: var(--white-dark);
    --border: var(--border-dark);
}

/* Dark Mode Overrides for default utility classes */
[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg-dark) !important;
}
[data-theme="dark"] .bg-white {
    background-color: var(--white-dark) !important;
}
[data-theme="dark"] .text-gray-900 {
    color: var(--text-dark) !important;
}
[data-theme="dark"] .text-gray-500 {
    color: var(--muted-dark) !important;
}
[data-theme="dark"] .border-b,
[data-theme="dark"] .border-t {
    border-color: var(--border-dark) !important;
}

/* Base Styles (Resets and Typography) */
* {
    box-sizing: border-box;
}
html {
    font-family: 'Vazirmatn', ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.5;
}

/* Persian/RTL Support */
[lang="fa"], .rtl {
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}
[lang="en"], .ltr {
    direction: ltr;
    font-family: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}
[data-theme="dark"] body {
    background: var(--bg-dark);
    color: var(--text-dark);
}
.container {
    max-width: 72rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

/* Remove Duplicate Headers/Navigation from host page */
header.w-full,
.w-full.border-b,
.w-full.border-b.bg-white,
header:not(.header),
.max-w-6xl.mx-auto.px-4.py-3 {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ✅ FIX: فقط navهای اضافیِ هدرِ میزبان را مخفی کن، نه navهای داخل صفحات (مثل سایدبار پروفایل) */
header nav:not(.nav):not(.footer-nav),
.w-full nav:not(.nav):not(.footer-nav),
.max-w-6xl nav:not(.nav):not(.footer-nav),
nav.top-nav,
nav.site-nav {
    display: none !important;
}

/* Hide duplicate mobile nav */
.mobile-nav:not(#mobileNav) {
    display: none !important;
}

/* Ensure our header is always visible and STICKY */
.header {
    display: block !important;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.header:hover {
    box-shadow: 0 1px 0 0 var(--accent), 0 1px 3px 0 var(--accent-light);
    border-bottom: 1px solid var(--accent);
}
[data-theme="dark"] .header {
    background: rgba(22, 27, 34, 0.95);
    border-bottom-color: var(--border-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}
.brand {
    color: var(--brand);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}
.brand:hover {
    transform: scale(1.05);
}
.brand-logo {
    height: 3.5rem;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(0.9);
}
[data-theme="dark"] .brand-logo {
    filter: brightness(1.2) contrast(1.1);
}
.brand:hover .brand-logo {
    transform: rotate(-5deg) scale(1.1);
    filter: brightness(1.1);
}
[data-theme="dark"] .brand:hover .brand-logo {
    filter: brightness(1.3) contrast(1.2);
}
.nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.nav a {
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}
.nav a:hover {
    text-decoration: none;
    background: var(--accent-light);
    color: var(--accent);
}
.nav a.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}
/* ===== Fix active nav item in LIGHT mode ===== */
html:not([data-theme="dark"]) .nav a.active {
    background: #e5edff;        /* آبی خیلی ملایم */
    color: #0f172a;             /* متن تیره و خوانا */
    border: 1px solid #c7d2fe;
}

html:not([data-theme="dark"]) .nav a.active:hover {
    background: #dbeafe;
    color: #0f172a;
}

.nav a.active:hover {
    background: var(--brand);
    color: white;
}
[data-theme="dark"] .nav a {
    color: var(--text-dark);
}

/* Language and Theme Toggle Container */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
}
.theme-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}
.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text);
    transition: color 0.3s ease;
}
[data-theme="dark"] .theme-toggle {
    border-color: var(--border-dark);
}
[data-theme="dark"] .theme-toggle svg {
    color: var(--text-dark);
}
.lang {
    display: flex;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem;
}
.lang a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 2rem;
    text-align: center;
}
.lang a.active {
    background: var(--accent);
    color: white;
}
.lang a:not(.active):hover {
    color: var(--text);
}
[data-theme="dark"] .lang {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}
[data-theme="dark"] .lang a:not(.active) {
    color: var(--muted-dark);
}
[data-theme="dark"] .lang a:not(.active):hover {
    color: var(--text-dark);
}
.main {
    padding-block: 1.25rem;
}

/* Mobile Navigation (Hamburger Menu & Mobile Menu) */
.btn-menu {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
}
.btn-menu:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}
.btn-menu:focus {
    outline: 2px solid var(--accent);
}
[data-theme="dark"] .btn-menu {
    border-color: var(--border-dark);
}
/* Hamburger Menu Icon */
.hamburger {
    display: flex;
    flex-direction: column;
    width: 1.25rem;
    height: 1rem;
    justify-content: space-between;
}
.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    transition: all 0.3s ease;
}
[data-theme="dark"] .hamburger span {
    background: var(--text-dark);
}
.header--open .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(0.25rem, 0.25rem);
}
.header--open .hamburger span:nth-child(2) {
    opacity: 0;
}
.header--open .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(0.25rem, -0.25rem);
}
/* Mobile Navigation - FIXED to hide on desktop */
.mobile-nav {
    display: none !important;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    background: var(--white);
    transition: all 0.3s ease;
    width: 100%;
}
.mobile-nav a {
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
}
.mobile-nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.mobile-nav a.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}
.mobile-nav a.active:hover {
    background: var(--brand);
    color: white;
}
@media (max-width: 768px) {
    .nav {
        display: none !important;
    }
    .btn-menu {
        display: inline-flex;
    }
    /* Only show mobile nav on mobile when header is open */
    .header--open .mobile-nav {
        display: flex !important;
    }
    .header-controls {
        gap: 0.5rem;
    }
    [data-theme="dark"] .mobile-nav {
        background: var(--white-dark);
        border-top-color: var(--border-dark);
    }
    [data-theme="dark"] .mobile-nav a {
        color: var(--text-dark);
    }
}

/* Utility Helper Classes (spacing, text size, visibility) */
.hidden {
    display: none;
}
.mt-2 {
    margin-top: 0.5rem;
}
.mt-4 {
    margin-top: 1rem;
}
.py-6 {
    padding-block: 1.5rem;
}
.text-sm {
    font-size: 0.875rem;
}
.text-muted {
    color: var(--muted);
}
[data-theme="dark"] .text-muted {
    color: var(--muted-dark);
}

/* Dark Mode Text Colors: ensure headings and text are readable */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-dark) !important;
}
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] li {
    color: var(--text-dark) !important;
}

/* Form Elements: inputs, textareas, selects (with unified styling & dark mode) */
input,
textarea,
select {
    font-family: 'Vazirmatn', inherit !important;
    padding: 0.75rem !important;
    border: 2px solid var(--border) !important;
    border-radius: 0.5rem !important;
    background: var(--white) !important;
    color: var(--text) !important;
    transition: all 0.3s ease !important;
    font-size: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
textarea {
    min-height: 150px !important;
    resize: vertical !important;
    line-height: 1.6 !important;
}
input::placeholder,
textarea::placeholder {
    color: var(--muted) !important;
    opacity: 0.8 !important;
}
input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
}

/* Dark mode form fields */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #1a1f26 !important;
    border-color: #3d4450 !important;
    color: #ffffff !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #8b949e !important;
    opacity: 0.9 !important;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    background: #0d1117 !important;
    border-color: #10a37f !important;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.3) !important;
    color: #ffffff !important;
}
/* Override any conflicting styles */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"] {
    background: #1a1f26 !important;
    color: #ffffff !important;
    border-color: #3d4450 !important;
}
/* Labels */
label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    color: var(--text) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}
[data-theme="dark"] label {
    color: #ffffff !important;
}

/* Buttons: base style and variants */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    border-radius: 0.6rem;
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
}
.btn:hover {
    transform: scale(1.05);
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}
.btn.primary {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}
.btn.primary:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.3);
}
[data-theme="dark"] .btn {
    background: var(--white-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

/* Prose Content (Markdown output) */
.prose h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.5rem;
}
.prose h1:hover {
    background: var(--accent-light);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.15);
    border: 1px solid var(--accent);
}
.prose h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.4rem;
}
.prose h2:hover {
    background: var(--accent-light);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.15);
    border: 1px solid var(--accent);
}
.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.3rem;
}
.prose h3:hover {
    background: var(--accent-light);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.15);
    border: 1px solid var(--accent);
}
.prose h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.25rem;
}
.prose h4:hover {
    background: var(--accent-light);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.15);
    border: 1px solid var(--accent);
}
.prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.25rem;
}
.prose p:hover {
    background: var(--accent-light);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.1);
    border-left: 3px solid var(--accent);
}
[lang="fa"] .prose p:hover {
    transform: translateX(-5px);
    border-left: none;
    border-right: 3px solid var(--accent);
}
.prose ul,
.prose ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
[lang="fa"] .prose ul,
[lang="fa"] .prose ol {
    margin-right: 1.5rem;
    margin-left: 0;
}
.prose li {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
}
.prose li:hover {
    background: var(--accent-light);
    transform: translateX(3px);
    color: var(--accent);
}
[lang="fa"] .prose li:hover {
    transform: translateX(-3px);
}
/* Dark Mode Prose Adjustments */
[data-theme="dark"] .prose h1,
[data-theme="dark"] .prose h2,
[data-theme="dark"] .prose h3,
[data-theme="dark"] .prose h4 {
    color: var(--text-dark) !important;
}
[data-theme="dark"] .prose p,
[data-theme="dark"] .prose li {
    color: var(--text-dark) !important;
}
[data-theme="dark"] .prose h1:hover,
[data-theme="dark"] .prose h2:hover,
[data-theme="dark"] .prose h3:hover,
[data-theme="dark"] .prose h4:hover {
    background: rgba(16, 163, 127, 0.2);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.25);
}
[data-theme="dark"] .prose p:hover {
    background: rgba(16, 163, 127, 0.15);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.2);
}
[data-theme="dark"] .prose li:hover {
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent);
}

/* Footer Section */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    transition: all 0.3s ease;
}
.footer:hover {
    box-shadow: 0 -1px 0 0 var(--accent), 0 -1px 3px 0 var(--accent-light);
    border-top: 1px solid var(--accent);
}
[data-theme="dark"] .footer {
    background: var(--white-dark);
    border-top-color: var(--border-dark);
}
.footer__row {
    padding: 2rem 0;
    color: var(--muted);
    font-size: 0.875rem;
}
.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}
/* Footer Brand Section */
.footer-brand .brand {
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}
.footer-brand .brand:hover {
    color: var(--brand);
    transform: scale(1.05);
}
.footer-brand .brand .brand-logo {
    height: 2rem;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(0.9);
}
.footer-brand .brand .brand-text {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}
[data-theme="dark"] .footer-brand .brand .brand-logo {
    filter: brightness(1.2) contrast(1.1);
}
.footer-brand .brand:hover .brand-logo {
    transform: rotate(-3deg) scale(1.1);
    filter: brightness(1.1);
}
[data-theme="dark"] .footer-brand .brand:hover .brand-logo {
    filter: brightness(1.3) contrast(1.2);
}
.footer-description {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    font-size: 0.875rem;
}
[data-theme="dark"] .footer-description {
    color: var(--muted-dark);
}
/* Footer Navigation Links */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}
.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}
.footer-nav a:hover {
    color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}
.footer-nav a.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}
.footer-nav a.active:hover {
    background: var(--brand);
    color: white;
}
[data-theme="dark"] .footer-nav a {
    color: var(--muted-dark);
}
/* Footer Social Links */
.footer-social h4 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}
[data-theme="dark"] .footer-social h4 {
    color: var(--text-dark);
}
.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    transition: all 0.3s ease;
    text-decoration: none;
}
.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}
.social-link svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}
[data-theme="dark"] .social-link {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--muted-dark);
}
/* Footer Bottom */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}
[data-theme="dark"] .footer-bottom {
    border-top-color: var(--border-dark);
}
.copyright {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}
[data-theme="dark"] .copyright {
    color: var(--muted-dark);
}
/* Back to Top Button */
.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}
.back-to-top:hover {
    background: var(--brand);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.3);
}
.back-to-top svg {
    width: 1.25rem;
    height: 1.25rem;
}
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    .footer-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .footer-nav a {
        padding: 0.75rem 1.5rem;
        width: 100%;
        text-align: center;
        border-radius: 0.75rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .social-links {
        gap: 0.75rem;
    }
    .social-link {
        width: 3rem;
        height: 3rem;
    }
    .social-link svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}
@media (max-width: 480px) {
    .footer__row {
        padding: 1.5rem 0;
    }
    .footer-content {
        gap: 1rem;
    }
    .footer-brand .brand {
        font-size: 1.25rem;
    }
}

/* Smooth Transitions (theme switch and hover effects) */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Team Page Styles: team section layout and member cards */
.team-page {
    min-height: 60vh;
}
.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.page-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}
@media (min-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.team-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
}
.team-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark), var(--primary-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.team-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}
.team-card:hover::before {
    opacity: 1;
}
.team-card__photo {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.team-card:hover .team-card__photo {
    transform: scale(1.05);
}
.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.team-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}
.team-card__placeholder img {
    width: 50%;
    height: 50%;
    object-fit: contain;
    opacity: 0.3;
    filter: brightness(0) invert(1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.team-card:hover .team-card__placeholder img {
    transform: rotate(5deg) scale(1.1);
}
.team-card__info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.team-card__name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.team-card:hover .team-card__name {
    color: var(--primary-color);
}
.team-card__role {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.team-card__bio {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}
.team-card__links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
}
.team-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.team-card__link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.team-card__link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}
.team-card__link:hover svg {
    transform: scale(1.1);
}
[data-theme="dark"] .team-card {
    background: var(--card-bg-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .team-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .team-card__link {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .team-card__link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Alert Messages (errors, warnings) */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

/* Home Page Styles: Hero, Stats, Expertise, Projects, CTA sections */

/* Root container max width variable (match header width if needed) */
:root {
    --container-max: 1366px;
}
*,
*::before,
*::after {
    box-sizing: border-box;
}
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}
/* Scroll & smoothing */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Bi-directional (RTL / LTR) text alignment support */
html[dir="rtl"],
body[dir="rtl"] {
    direction: rtl;
    unicode-bidi: plaintext;
}
html[dir="ltr"],
body[dir="ltr"] {
    direction: ltr;
    unicode-bidi: plaintext;
}
[dir="rtl"] body,
[dir="rtl"] .auto-dir {
    text-align: right;
}
[dir="ltr"] body,
[dir="ltr"] .auto-dir {
    text-align: left;
}
/* Progress bar from top of page */
body::before {
    content: '';
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 4px;
    background: linear-gradient(90deg, #10a37f, #0d8a6a, #10a37f);
    background-size: 200% 100%;
    z-index: 10000;
    animation: progressShine 3s linear infinite;
    width: var(--scroll-progress, 0%);
    transition: width 0.1s ease-out;
}
[dir="ltr"] body::before {
    left: 0;
    right: auto;
}
[dir="rtl"] body::before {
    right: 0;
    left: auto;
}
@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Hero Section — full-bleed, centered in both RTL & LTR without overflow */
.hero-section {
  position: relative;
  min-height: 81vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Logical centering that respects RTL/LTR */
  /* This is now the key for LTR */
  left: 50%;
  transform: translateX(-50%);

  /* Full browser width, no side shift in RTL */
  width: 100vw;
  max-width: 100vw;

  /* Round + highlight (kept from your theme) */
  border-radius: 24px;
  background: rgba(10, 14, 39, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(16, 163, 127, 0.3);
  box-shadow:
    inset 0 0 100px rgba(16, 163, 127, 0.1),
    0 0 50px rgba(16, 163, 127, 0.2);
}

/* FIX FOR RTL: 
  When the HTML tag has the attribute dir="rtl", apply these overrides.
*/
[dir="rtl"] .hero-section {
  left: auto; /* Reset the left property */
  right: 50%; /* Position from the right instead */
  transform: translateX(50%); /* Move it to the right to center it */
}


/* Use dynamic viewport on browsers that support it (prevents rare 100vw overflow) */
@supports (width: 100dvw) {
  .hero-section {
    width: 100dvw;
    max-width: 100dvw;
  }
}
/* Adjust --container-max if header is wider on large screens */
@media (min-width: 1536px) {
    :root {
        --container-max: 1280px;
    }
}
/* Inner container within hero */
.hero-section .container {
    max-width: var(--container-max);
    margin-inline: auto;
    width: 100%;
    padding-inline: 1.25rem;
    padding-block: 0;
}
/* Optional full-width hero variant */
.hero-section.full-width {
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
/* Particle background effect (floating particles) */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 1px, transparent 1px), radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.03) 1px, transparent 1px), radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 100px 100px;
    animation: particlesFloat 20s linear infinite;
    opacity: 0.4;
}
@keyframes particlesFloat {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(-50px) translateX(50px);
    }
}
/* Hero overlay (animated radial glows) */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 30%, rgba(16, 163, 127, 0.4) 0%, transparent 50%), radial-gradient(ellipse at 80% 70%, rgba(16, 163, 127, 0.3) 0%, transparent 50%), radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: heroGlowAdvanced 12s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes heroGlowAdvanced {
    0% {
        opacity: 0.3;
        transform: scale(1) rotate(0);
    }
    33% {
        opacity: 0.6;
        transform: scale(1.1) rotate(2deg);
    }
    66% {
        opacity: 0.5;
        transform: scale(1.05) rotate(-2deg);
    }
    100% {
        opacity: 0.4;
        transform: scale(1) rotate(0);
    }
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 4rem 1rem;
    animation: fadeInUpBounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* Text alignment helper classes */
[dir="rtl"] .text-start,
.rtl .text-start {
    text-align: right;
}
[dir="ltr"] .text-start,
.ltr .text-start {
    text-align: left;
}
@keyframes fadeInUpBounce {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    letter-spacing: -1px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}
@keyframes titleGlow {
    0% {
        text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    }
    100% {
        text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 255, 255, 0.3);
    }
}
.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    animation: fadeIn 1.5s ease-out 0.3s both;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeIn 1.5s ease-out 0.6s both;
}
.btn-primary {
    background: #ffffff;
    color: #10a37f;
    border: 2px solid #ffffff;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(16, 163, 127, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}
.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}
.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}
.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}
.btn-outline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}
.btn-outline:hover::after {
    left: 100%;
}
.btn-outline:hover {
    background: #ffffff;
    color: #10a37f;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.4);
}
.btn-lg {
    padding: 1.125rem 2.75rem;
    font-size: 1.125rem;
    border-radius: 14px;
}
.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    animation: bounceAdvanced 3s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-scroll:hover {
    transform: translateX(-50%) scale(1.15);
    color: #ffffff;
}
@keyframes bounceAdvanced {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    25% {
        transform: translateX(-50%) translateY(-8px);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-50%) translateY(-18px);
        opacity: 0.6;
    }
    75% {
        transform: translateX(-50%) translateY(-8px);
        opacity: 0.8;
    }
}

/* Stats Section: key statistics with reveal animation */
.stats-section {
    padding: 7rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fffe 100%);
    position: relative;
}
.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #10a37f 50%, transparent 100%);
    opacity: 0.4;
    animation: lineShine 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes lineShine {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.6;
    }
}
[data-theme="dark"] .stats-section {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0a0f0d 100%);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}
.stat-card {
    text-align: center;
    padding: 3rem 2rem;
    background: #ffffff;
    border-radius: 24px;
    border: 2px solid rgba(16, 163, 127, 0.1);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(16, 163, 127, 0.08);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
}
.stat-card.reveal {
    opacity: 1;
    transform: translateY(0);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10a37f, #0d8a6a, #10a37f);
    background-size: 200% 100%;
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    animation: gradientSlide 3s linear infinite;
}
@keyframes gradientSlide {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}
.stat-card:hover::before {
    transform: translateX(0);
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(16, 163, 127, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.stat-card:hover::after {
    opacity: 1;
}
.stat-card:hover {
    transform: translateY(-20px) scale(1.03) rotate(1deg);
    box-shadow: 0 30px 60px rgba(16, 163, 127, 0.25);
    border-color: rgba(16, 163, 127, 0.4);
}
[data-theme="dark"] .stat-card {
    background: rgba(16, 163, 127, 0.05);
    border-color: rgba(16, 163, 127, 0.2);
}
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    border-radius: 50%;
    margin-bottom: 2rem;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(16, 163, 127, 0.3);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(16, 163, 127, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(16, 163, 127, 0.4);
    }
}
.stat-card:hover .stat-icon {
    transform: scale(1.2) rotate(360deg);
    box-shadow: 0 20px 50px rgba(16, 163, 127, 0.5);
}
.stat-number {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    font-family: 'Arial', sans-serif;
    transition: all 0.3s ease;
    .stat-number::after {
        content: '';
    }
}
.stat-card:hover .stat-number {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(16, 163, 127, 0.5));
}
.stat-label {
    font-size: 1.25rem;
    color: #1a202c;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}
.stat-card:hover .stat-label {
    color: #10a37f;
}
[data-theme="dark"] .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Expertise Section: features with staggered animation */
.expertise-section {
    padding: 7rem 0;
    background: linear-gradient(180deg, #f8fffe 0%, #ffffff 100%);
    position: relative;
}
[data-theme="dark"] .expertise-section {
    background: linear-gradient(180deg, #0a0f0d 0%, var(--bg-secondary) 100%);
}
.section-header {
    text-align: center;
    margin-bottom: 5rem;
    animation: fadeInScale 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #1a202c;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 5px;
    background: linear-gradient(90deg, #10a37f, #0d8a6a);
    border-radius: 3px;
    animation: lineGrow 1.5s ease-out 0.5s forwards;
}
@keyframes lineGrow {
    0% {
        width: 0;
    }
    100% {
        width: 100px;
    }
}
[data-theme="dark"] .section-title {
    color: #ffffff;
}
.section-subtitle {
    font-size: 1.375rem;
    color: #4a5568;
    font-weight: 600;
    max-width: 650px;
    margin: 1.5rem auto 0;
    line-height: 1.7;
    animation: fadeIn 1.5s ease-out 0.8s both;
}
[data-theme="dark"] .section-subtitle {
    color: rgba(255, 255, 255, 0.8);
}
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}
.expertise-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    border: 2px solid rgba(16, 163, 127, 0.1);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    box-shadow: 0 4px 20px rgba(16, 163, 127, 0.08);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
}
.expertise-card.reveal {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.expertise-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(16, 163, 127, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.expertise-card:hover::before {
    opacity: 1;
}
.expertise-card::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: #ffffff;
    border-radius: 22px;
    z-index: 1;
}
[data-theme="dark"] .expertise-card::after {
    background: rgba(16, 163, 127, 0.05);
}
.expertise-card > * {
    position: relative;
    z-index: 2;
}
.expertise-card:hover {
    transform: translateY(-20px) scale(1.03) rotate(-1deg);
    border-color: rgba(16, 163, 127, 0.3);
    box-shadow: 0 30px 60px rgba(16, 163, 127, 0.25);
}
[data-theme="dark"] .expertise-card {
    background: rgba(16, 163, 127, 0.05);
    border-color: rgba(16, 163, 127, 0.2);
}
.expertise-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    border-radius: 28px;
    margin-bottom: 2rem;
    color: #ffffff;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(16, 163, 127, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
.expertise-card:hover .expertise-icon {
    transform: scale(1.2) rotate(15deg) translateY(-5px);
    box-shadow: 0 20px 50px rgba(16, 163, 127, 0.5);
}
.expertise-card h3 {
    font-size: 1.625rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}
.expertise-card:hover h3 {
    color: #10a37f;
    transform: scale(1.05);
}
[data-theme="dark"] .expertise-card h3 {
    color: #ffffff;
}
.expertise-card p {
    font-size: 1.0625rem;
    color: #4a5568;
    font-weight: 600;
    line-height: 1.8;
    transition: all 0.3s ease;
}
.expertise-card:hover p {
    color: #2d3748;
}
[data-theme="dark"] .expertise-card p {
    color: rgba(255, 255, 255, 0.75);
}

/* Featured Projects Section: 3D hover tilt effects */
.featured-projects {
    padding: 7rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fffe 100%);
    position: relative;
}
[data-theme="dark"] .featured-projects {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0a0f0d 100%);
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
    perspective: 1000px;
}
.project-card-home {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid rgba(16, 163, 127, 0.1);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(16, 163, 127, 0.08);
    position: relative;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
}
.project-card-home.reveal {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}
.project-card-home::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, #10a37f, transparent, #0d8a6a);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.project-card-home:hover::after {
    opacity: 1;
}
.project-card-home:hover {
    transform: translateY(-20px) rotateX(5deg) rotateY(5deg) scale(1.02);
    box-shadow: 0 35px 70px rgba(16, 163, 127, 0.3);
}
[data-theme="dark"] .project-card-home {
    background: rgba(16, 163, 127, 0.05);
    border-color: rgba(16, 163, 127, 0.2);
}
.project-image {
    position: relative;
    overflow: hidden;
}
.project-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: #ffffff;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}
.project-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
.project-card-home:hover .project-placeholder {
    transform: scale(1.15);
}
.project-placeholder svg {
    opacity: 0.3;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}
.project-card-home:hover .project-placeholder svg {
    opacity: 0.6;
    transform: rotate(15deg) scale(1.2);
}
.project-content {
    padding: 2.5rem;
}
.project-content h3 {
    font-size: 1.625rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}
.project-card-home:hover .project-content h3 {
    color: #10a37f;
    transform: translateX(5px);
}
[data-theme="dark"] .project-content h3 {
    color: #ffffff;
}
.project-content p {
    font-size: 1.0625rem;
    color: #4a5568;
    font-weight: 600;
    line-height: 1.8;
    margin-bottom: 2rem;
}
[data-theme="dark"] .project-content p {
    color: rgba(255, 255, 255, 0.75);
}
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #10a37f;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    background: rgba(16, 163, 127, 0.05);
    border: 2px solid transparent;
}
.project-link:hover {
    gap: 1.5rem;
    background: rgba(16, 163, 127, 0.15);
    transform: translateX(10px) scale(1.05);
    border-color: rgba(16, 163, 127, 0.3);
}
.project-link svg {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.project-link:hover svg {
    transform: translateX(10px) rotate(45deg);
}
.btn-outline-dark {
    background: transparent;
    color: #1a202c;
    border: 2px solid #1a202c;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}
.btn-outline-dark::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: #1a202c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.btn-outline-dark:hover::before {
    width: 400px;
    height: 400px;
}
.btn-outline-dark span {
    position: relative;
    z-index: 1;
}
.btn-outline-dark:hover {
    color: #ffffff;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(26, 32, 44, 0.3);
}
[data-theme="dark"] .btn-outline-dark {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .btn-outline-dark::before {
    background: #ffffff;
}
[data-theme="dark"] .btn-outline-dark:hover {
    color: #1a202c;
}

/* Call-to-Action (CTA) Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #0b88699d 0%, #0d8a6b94 50%, #15796083 100%);
    position: relative;
    overflow: hidden;
    border-radius: 35px;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.2) 0%, transparent 50%), radial-gradient(ellipse at 70% 60%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    animation: ctaGlowPulse 1s ease-in-out infinite alternate;
}
@keyframes ctaGlowPulse {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
}
.cta-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: ctaSweep 4s ease-in-out infinite;
}
@keyframes ctaSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
}
.cta-content h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 2rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    animation: fadeInScale 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.cta-content p {
    font-size: 1.375rem;
    margin-bottom: 3rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    animation: fadeIn 1.5s ease-out 0.3s both;
}
.btn-light {
    background: #ffffff;
    color: #10a37f;
    border: 2px solid #ffffff;
    font-weight: 800;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
}
.btn-light::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(16, 163, 127, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.btn-light:hover::before {
    width: 400px;
    height: 400px;
}
.btn-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 20px 50px rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}

/* Responsive Adjustments (Home Page Sections) */
@media (max-width: 768px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .expertise-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1.0625rem;
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional Utility Classes (alignment, large spacing) */
.text-center {
    text-align: center;
}
.mt-60 {
    margin-top: 5rem;
}

/* Alternative Hero Theme: "Galaxy" style */
.hero-section {
    position: relative;
    min-height: 81vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    background: #0a0e27;
    border: 2px solid rgba(16, 163, 127, 0.3);
    box-shadow: inset 0 0 100px rgba(16, 163, 127, 0.1), 0 0 50px rgba(16, 163, 127, 0.2);
}
/* Animated Stars Background */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(2px 2px at 20% 30%, white, transparent), radial-gradient(2px 2px at 60% 70%, white, transparent), radial-gradient(1px 1px at 50% 50%, white, transparent), radial-gradient(1px 1px at 80% 10%, white, transparent), radial-gradient(2px 2px at 90% 60%, white, transparent), radial-gradient(1px 1px at 33% 80%, white, transparent), radial-gradient(1px 1px at 15% 55%, white, transparent);
    background-size: 200% 200%, 80% 80%, 150% 150%, 300% 300%, 100% 100%, 250% 250%, 180% 180%;
    background-position: 0% 0%;
    animation: stars 60s linear infinite;
    opacity: 0.6;
}
@keyframes stars {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
    100% {
        background-position: 100% 100%, -100% -100%, 50% 50%, 200% 200%, -50% -50%, 150% 150%, -80% -80%;
    }
}
/* Nebula Effect */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 30%, rgba(16, 163, 127, 0.3) 0%, transparent 40%), radial-gradient(ellipse at 80% 70%, rgba(106, 17, 203, 0.2) 0%, transparent 40%), radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 10% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 35%);
    animation: nebula 20s ease-in-out infinite alternate;
    opacity: 0.4;
}
@keyframes nebula {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.05) rotate(-5deg);
        opacity: 0.4;
    }
}
/* Shooting Stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    animation: shoot 3s linear infinite;
    opacity: 0;
}
@keyframes shoot {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(-300px, 300px);
        opacity: 0;
    }
}
.shooting-star:nth-child(1) {
    top: 10%;
    left: 80%;
    animation-delay: 0s;
}
.shooting-star:nth-child(2) {
    top: 30%;
    left: 90%;
    animation-delay: 2s;
}
.shooting-star:nth-child(3) {
    top: 50%;
    left: 75%;
    animation-delay: 4s;
}
/* Twinkling Stars */
.twinkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}
/* Moon */
.moon {
    position: absolute;
    top: 10%;
    right: 10%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #f0f0f0, #c0c0c0);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), inset -10px -10px 20px rgba(0, 0, 0, 0.2);
    animation: moonFloat 8s ease-in-out infinite;
    z-index: 1;
}
@keyframes moonFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}
/* Galaxy Dust */
.galaxy-dust {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 85% 15%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 45% 85%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, 0.3), transparent), radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 100% 100%;
    animation: dust 30s linear infinite;
    opacity: 0.4;
}
@keyframes dust {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(50px) translateY(-50px);
    }
}
/* Ensure content is above effects */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 4rem 1rem;
    animation: fadeInUpBounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
/* Enhance text visibility */
.hero-title {
    text-shadow: 0 0 20px rgba(16, 163, 127, 0.5), 0 4px 30px rgba(0, 0, 0, 0.8);
}
.hero-subtitle {
    text-shadow: 0 0 15px rgba(16, 163, 127, 0.3), 0 2px 15px rgba(0, 0, 0, 0.6);
}

/* Downloads Page Styles: Hero, Filters, Categories, Cards, Pagination */

/* Downloads Hero (Compact intro section) */
.downloads-hero {
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.1) 0%, rgba(16, 163, 127, 0.05) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(16, 163, 127, 0.2);
}
.downloads-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.downloads-hero p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Filters Panel (search and filter) */
.downloads-filters {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.search-wrapper {
    position: relative;
}
.search-input {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
}
.search-input:focus {
    border-color: #10a37f;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
    outline: none;
}
/* Live Search Results */
.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
}
.live-search-results.active {
    display: block;
}
.live-search-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}
.live-search-item:hover {
    background: rgba(16, 163, 127, 0.05);
}
.live-search-item:last-child {
    border-bottom: none;
}
.live-search-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.live-search-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.live-search-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Categories Toggle Button (mobile) */
.categories-toggle {
    display: none;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}
.categories-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 163, 127, 0.3);
}
.categories-toggle svg {
    transition: transform 0.3s ease;
}
.categories-toggle.active svg {
    transform: rotate(90deg);
}

/* Categories Sidebar: collapsible category filters */
.categories-sidebar {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}
.categories-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.categories-close {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.categories-close button {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.categories-close button:hover {
    background: rgba(239, 68, 68, 0.2);
}
.category-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(16, 163, 127, 0.2);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}
.category-button::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 25px;
    right: 25px;
    height: 0;
    border-bottom: 1px dashed var(--border-color);
}
.category-button:last-child {
    margin-bottom: 0;
}
.category-button:last-child::after {
    display: none;
}
.category-button:hover {
    background: rgba(16, 163, 127, 0.08);
    transform: translateX(5px);
    border-color: rgba(16, 163, 127, 0.4);
}
.category-button.active {
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
    border-color: #10a37f;
}
.category-button.active::after {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}
.category-button.active:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 6px 16px rgba(16, 163, 127, 0.4);
}
[data-theme="dark"] .category-button {
    border-color: rgba(16, 163, 127, 0.3);
}
[data-theme="dark"] .category-button::after {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Downloads Layout (sidebar + content) */
.downloads-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* Download Cards */
.download-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.download-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.4);
}
.download-card-body {
    padding: 1.5rem;
    flex: 1;
}
.download-card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}
[data-theme="dark"] .download-card-footer {
    background: rgba(255, 255, 255, 0.02);
}
.download-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
.download-card:hover .download-icon {
    transform: scale(1.1) rotate(5deg);
}
.download-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}
.download-card:hover .download-title {
    color: #10a37f;
}
.download-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.download-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 163, 127, 0.05);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 163, 127, 0.3);
}
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}
.categories-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}
.categories-overlay.active {
    display: block;
}

/* Responsive Adjustments (Downloads Page) */
@media (max-width: 1024px) {
    .categories-toggle {
        display: flex;
    }
    .downloads-layout {
        grid-template-columns: 1fr;
    }
    .categories-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        border-radius: 0;
    }
    .categories-sidebar.open {
        right: 0;
    }
    .categories-sidebar .categories-close {
        display: flex;
    }
    .categories-sidebar.open .categories-title:not(.categories-close .categories-title) {
        display: none;
    }
    .downloads-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .categories-sidebar {
        width: 85%;
        max-width: 280px;
    }
}

/* Pagination Controls (page navigation) */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}
.pagination-btn {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pagination-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(16, 163, 127, 0.4);
}
.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}
.pagination-current {
    color: #10a37f;
    font-size: 1.5rem;
}
.pagination-separator {
    color: var(--text-muted);
}
.pagination-total {
    color: var(--text-muted);
}
/* =========================
   DASHBOARD (Tailwind) - DARK FIX
   Active sidebar item + hover rows
   ========================= */

/* 1) آیتم فعال در دارک مود (بدون وابستگی به کلاس wrapper) */
[data-theme="dark"] a[aria-current="page"],
[data-theme="dark"] .active[aria-current="page"],
[data-theme="dark"] .is-active,
[data-theme="dark"] .active {
  background: rgba(99,102,241,0.18) !important;
  border: 1px solid rgba(99,102,241,0.35) !important;
  color: #ffffff !important;
}

[data-theme="dark"] a[aria-current="page"] *,
[data-theme="dark"] .is-active *,
[data-theme="dark"] .active * {
  color: #ffffff !important;
}

/* 2) جلوگیری از روشن ماندن بک‌گراندهای روشن Tailwind داخل داشبورد */
[data-theme="dark"] [class~="bg-white"],
[data-theme="dark"] [class~="bg-gray-50"],
[data-theme="dark"] [class~="bg-slate-50"],
[data-theme="dark"] [class~="bg-gray-100"],
[data-theme="dark"] [class~="bg-slate-100"],
[data-theme="dark"] [class~="bg-indigo-50"],
[data-theme="dark"] [class~="bg-indigo-100"],
[data-theme="dark"] [class~="bg-purple-50"],
[data-theme="dark"] [class~="bg-purple-100"],
[data-theme="dark"] [class~="bg-violet-50"],
[data-theme="dark"] [class~="bg-violet-100"],
[data-theme="dark"] [class~="bg-fuchsia-50"],
[data-theme="dark"] [class~="bg-fuchsia-100"],
[data-theme="dark"] [class~="bg-rose-50"],
[data-theme="dark"] [class~="bg-rose-100"],
[data-theme="dark"] [class~="bg-pink-50"],
[data-theme="dark"] [class~="bg-pink-100"] {
  background-color: rgba(255,255,255,0.03) !important;
}

/* 3) هاور ردیف‌ها/کارت‌ها در دارک مود (Tailwind hover utilities) */
[data-theme="dark"] [class*="hover:bg-white"]:hover,
[data-theme="dark"] [class*="hover:bg-gray-50"]:hover,
[data-theme="dark"] [class*="hover:bg-slate-50"]:hover,
[data-theme="dark"] [class*="hover:bg-gray-100"]:hover,
[data-theme="dark"] [class*="hover:bg-slate-100"]:hover,
[data-theme="dark"] [class*="hover:bg-indigo-50"]:hover,
[data-theme="dark"] [class*="hover:bg-indigo-100"]:hover,
[data-theme="dark"] [class*="hover:bg-purple-50"]:hover,
[data-theme="dark"] [class*="hover:bg-purple-100"]:hover,
[data-theme="dark"] [class*="hover:bg-violet-50"]:hover,
[data-theme="dark"] [class*="hover:bg-violet-100"]:hover {
  background-color: rgba(99,102,241,0.12) !important;
  border-color: rgba(99,102,241,0.35) !important;
}

/* 4) متن داخل آیتم‌های هاور شده خوانا بماند */
[data-theme="dark"] [class*="hover:bg-"]:hover,
[data-theme="dark"] [class*="hover:bg-"]:hover * {
  color: #ffffff !important;
}

/* 5) رنگ متن‌های تیره Tailwind در دارک مود */
[data-theme="dark"] [class~="text-gray-900"],
[data-theme="dark"] [class~="text-slate-900"],
[data-theme="dark"] [class~="text-black"] {
  color: #f9fafb !important;
}

[data-theme="dark"] [class~="text-gray-700"],
[data-theme="dark"] [class~="text-slate-700"],
[data-theme="dark"] [class~="text-gray-600"],
[data-theme="dark"] [class~="text-slate-600"],
[data-theme="dark"] [class~="text-gray-500"],
[data-theme="dark"] [class~="text-slate-500"] {
  color: #cbd5e1 !important;
}
/* ===== FIX: prevent dashboard .active styles from affecting language toggle ===== */
[data-theme="dark"] #langToggle,
[data-theme="dark"] #langToggle.active,
[data-theme="dark"] #langToggle .active,
[data-theme="dark"] #langToggle [aria-current="page"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* اگر کادر آبی از فوکوس مرورگر باشد */
[data-theme="dark"] #langToggle:focus,
[data-theme="dark"] #langToggle:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
/* =================================================
   DARK MODE – ORDER ITEMS (My Orders + Order Details)
   ================================================= */

/* کارت هر محصول داخل سفارش */
[data-theme="dark"] .shop-card .bg-gradient-to-r.from-gray-50.to-white,
[data-theme="dark"] .shop-card .bg-white {
  background: #111827 !important;        /* dark slate */
  border-color: #374151 !important;
}

/* تصاویر محصول که bg-white دارند */
[data-theme="dark"] .shop-card .bg-white.shadow-sm {
  background: #1f2937 !important;
}

/* متن‌های اصلی داخل آیتم محصول */
[data-theme="dark"] .shop-card .text-gray-800,
[data-theme="dark"] .shop-card .text-gray-900,
[data-theme="dark"] .shop-card .text-black {
  color: #f9fafb !important;
}

/* متن‌های توضیحی */
[data-theme="dark"] .shop-card .text-gray-600,
[data-theme="dark"] .shop-card .text-gray-700 {
  color: #d1d5db !important;
}

/* متن‌های کم‌رنگ */
[data-theme="dark"] .shop-card .text-gray-500,
[data-theme="dark"] .shop-card .text-gray-400 {
  color: #9ca3af !important;
}

/* badge تعداد (Qty) */
[data-theme="dark"] .shop-card .bg-purple-100 {
  background: rgba(139, 92, 246, 0.25) !important;
}
[data-theme="dark"] .shop-card .bg-purple-100,
[data-theme="dark"] .shop-card .text-purple-700 {
  color: #e9d5ff !important;
}

/* hover روی آیتم محصول */
[data-theme="dark"] .shop-card .hover\:border-purple-300:hover {
  border-color: rgba(139, 92, 246, 0.6) !important;
}

[data-theme="dark"] .max-w-md .bg-blue-50 { background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.12) !important; }
[data-theme="dark"] .max-w-md .bg-blue-50, 
[data-theme="dark"] .max-w-md .bg-blue-50 * { color: #e5e7eb !important; }
[data-theme="dark"] .max-w-md .text-blue-800 { color: #e5e7eb !important; }
[data-theme="dark"] .max-w-md .border-blue-200 { border-color: rgba(255,255,255,0.12) !important; }
/* =========================
   DARK: Login messageBox (success/error) fix
   ========================= */

/* Success message */
[data-theme="dark"] #messageBox.bg-green-50 {
  background: rgba(34, 197, 94, 0.12) !important;  /* green tint */
  border-color: rgba(34, 197, 94, 0.35) !important;
}
[data-theme="dark"] #messageBox.bg-green-50,
[data-theme="dark"] #messageBox.bg-green-50 * {
  color: #dcfce7 !important;
}

/* Error message */
[data-theme="dark"] #messageBox.bg-red-50 {
  background: rgba(239, 68, 68, 0.12) !important;  /* red tint */
  border-color: rgba(239, 68, 68, 0.35) !important;
}
[data-theme="dark"] #messageBox.bg-red-50,
[data-theme="dark"] #messageBox.bg-red-50 * {
  color: #fee2e2 !important;
}

/* اگر به جای bg-50 کلاس‌های text/border اعمال شد */
[data-theme="dark"] #messageBox.border-green-200 { border-color: rgba(34, 197, 94, 0.35) !important; }
[data-theme="dark"] #messageBox.border-red-200 { border-color: rgba(239, 68, 68, 0.35) !important; }

[data-theme="dark"] #messageBox.text-green-700 { color: #dcfce7 !important; }
[data-theme="dark"] #messageBox.text-red-700 { color: #fee2e2 !important; }
/* =========================
   DARK: Shop Toast / Wishlist (Final theme-aligned fix)
   ========================= */

/* Toast اصلی (افزودن به علاقه‌مندی و پیام‌های موفقیت) */
[data-theme="dark"] [role="alert"],
[data-theme="dark"] .toast,
[data-theme="dark"] .notification {
  background: linear-gradient(
    135deg,
    rgba(99,102,241,0.18),
    rgba(17,24,39,0.96)
  ) !important;              /* هماهنگ با indigo سایت */
  border: 1px solid rgba(99,102,241,0.45) !important;
  color: #f9fafb !important;
  backdrop-filter: blur(6px);
}

/* متن داخل Toast */
[data-theme="dark"] [role="alert"],
[data-theme="dark"] [role="alert"] *,
[data-theme="dark"] .toast *,
[data-theme="dark"] .notification * {
  color: #f9fafb !important;
}

/* اگر toast با بک‌گراند سفید inline ساخته شده */
[data-theme="dark"] [role="alert"][style*="background"],
[data-theme="dark"] .toast[style*="background"],
[data-theme="dark"] .notification[style*="background"] {
  background: linear-gradient(
    135deg,
    rgba(99,102,241,0.18),
    rgba(17,24,39,0.96)
  ) !important;
}

/* آیکن یا علامت موفقیت (قلب، تیک، …) */
[data-theme="dark"] [role="alert"] svg,
[data-theme="dark"] [role="alert"] i {
  color: #a5b4fc !important;   /* indigo روشن */
}

/* نوار یا خط سبز کنار toast (اگر وجود دارد) */
[data-theme="dark"] [role="alert"][style*="border-left"],
[data-theme="dark"] [role="alert"][style*="border-right"] {
  border-color: #6366f1 !important;
}

