/* ========================================
   BIT Website - Color Theme System
   Premium Multi-Theme Support
   ======================================== */

/* ========== Ocean Theme (Default) ========== */
[data-theme="ocean"],
:root {
    --theme-primary: #3b82f6;
    --theme-secondary: #06b6d4;
    --theme-accent: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --primary-blue: #3b82f6;
    --primary-cyan: #06b6d4;
    --accent-glow: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-purple: #8b5cf6;
}

/* ========== Sunset Theme ========== */
[data-theme="sunset"] {
    --theme-primary: #f97316;
    --theme-secondary: #ec4899;
    --theme-accent: #f43f5e;
    --gradient-primary: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    --gradient-purple: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
    --primary-blue: #f97316;
    --primary-cyan: #ec4899;
    --accent-glow: #f97316;
    --accent-blue-light: #fb923c;
    --accent-purple: #f472b6;
}

/* ========== Aurora Theme ========== */
[data-theme="aurora"] {
    --theme-primary: #10b981;
    --theme-secondary: #06b6d4;
    --theme-accent: #6366f1;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-purple: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
    --primary-blue: #10b981;
    --primary-cyan: #06b6d4;
    --accent-glow: #10b981;
    --accent-blue-light: #34d399;
    --accent-purple: #818cf8;
}

/* ========== Royal Theme ========== */
[data-theme="royal"] {
    --theme-primary: #8b5cf6;
    --theme-secondary: #a855f7;
    --theme-accent: #ec4899;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-purple: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --primary-blue: #8b5cf6;
    --primary-cyan: #a855f7;
    --accent-glow: #8b5cf6;
    --accent-blue-light: #a78bfa;
    --accent-purple: #c084fc;
}

/* ========== Crimson Theme ========== */
[data-theme="crimson"] {
    --theme-primary: #ef4444;
    --theme-secondary: #f97316;
    --theme-accent: #fbbf24;
    --gradient-primary: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --gradient-purple: linear-gradient(135deg, #fbbf24 0%, #ef4444 100%);
    --primary-blue: #ef4444;
    --primary-cyan: #f97316;
    --accent-glow: #ef4444;
    --accent-blue-light: #f87171;
    --accent-purple: #fb923c;
}

/* ========== Emerald Theme ========== */
[data-theme="emerald"] {
    --theme-primary: #059669;
    --theme-secondary: #22c55e;
    --theme-accent: #84cc16;
    --gradient-primary: linear-gradient(135deg, #059669 0%, #22c55e 100%);
    --gradient-purple: linear-gradient(135deg, #84cc16 0%, #059669 100%);
    --primary-blue: #059669;
    --primary-cyan: #22c55e;
    --accent-glow: #059669;
    --accent-blue-light: #34d399;
    --accent-purple: #4ade80;
}

/* ========== Light Mode Theme ========== */
[data-theme="light"] {
    /* Primary Colors - Light Theme */
    --theme-primary: #2563eb;
    --theme-secondary: #0891b2;
    --theme-accent: #7c3aed;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    --gradient-purple: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --primary-blue: #2563eb;
    --primary-cyan: #0891b2;
    --accent-glow: #2563eb;
    --accent-blue-light: #3b82f6;
    --accent-purple: #8b5cf6;

    /* Background Colors - Light Theme */
    --primary-dark: #ffffff;
    --primary-darker: #f8fafc;
    --primary-light: #f1f5f9;
    --bg-dark: #ffffff;
    --bg-darker: #f8fafc;
    --bg-section: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);

    /* Text Colors - Light Theme */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --white: #0f172a;

    /* Neutral Colors */
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #e2e8f0;

    /* Glass Effect - Light Theme */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-header: rgba(255, 255, 255, 0.9);

    /* Gradients - Light Theme */
    --gradient-dark: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --gradient-glow: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(8, 145, 178, 0.1) 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
}

/* Light Mode Specific Overrides */
[data-theme="light"] body {
    background: #ffffff;
}

[data-theme="light"] .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-link {
    color: #0f172a;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    color: #2563eb;
}

[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dropdown-menu li a {
    color: #475569;
}

[data-theme="light"] .dropdown-menu li a:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .code-editor {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="light"] .service-card,
[data-theme="light"] .news-card,
[data-theme="light"] .stat-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .service-card:hover,
[data-theme="light"] .news-card:hover {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .section-title,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
    color: #0f172a;
}

[data-theme="light"] p,
[data-theme="light"] .section-subtitle {
    color: #475569;
}

[data-theme="light"] .hero-subtitle {
    color: #64748b;
}

[data-theme="light"] .mobile-menu-btn span {
    background: #0f172a;
}

[data-theme="light"] .lang-btn {
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

[data-theme="light"] .lang-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .lang-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .lang-option {
    color: #475569;
}

[data-theme="light"] .lang-option:hover,
[data-theme="light"] .lang-option.active {
    background: rgba(0, 0, 0, 0.03);
    color: #0f172a;
}

[data-theme="light"] .footer {
    background: #0f172a;
}

[data-theme="light"] .footer h4,
[data-theme="light"] .footer-title,
[data-theme="light"] .footer a,
[data-theme="light"] .footer p {
    color: #e2e8f0;
}

[data-theme="light"] .step-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .step-title {
    color: #0f172a;
}

[data-theme="light"] .step-description {
    color: #64748b;
}

[data-theme="light"] .partners-section,
[data-theme="light"] .clients-section {
    background: #f8fafc;
}

[data-theme="light"] .client-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="light"] ::selection {
    background: #2563eb;
    color: #ffffff;
}

/* Light mode theme switcher adjustments */
[data-theme="light"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-btn svg {
    stroke: #0f172a;
}

[data-theme="light"] .theme-palette {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .theme-palette-header span {
    color: #0f172a;
}

[data-theme="light"] .theme-option:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .theme-option.active {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-option span {
    color: #475569;
}

[data-theme="light"] .theme-option:hover span,
[data-theme="light"] .theme-option.active span {
    color: #0f172a;
}

/* ========== Theme Switcher UI ========== */
.theme-switcher {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 1001;
}

.theme-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.theme-toggle-btn:hover::before {
    opacity: 0.2;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    border-color: var(--theme-primary);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 2;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover svg {
    transform: rotate(30deg);
}

/* Theme Palette Dropdown */
.theme-palette {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.theme-switcher.active .theme-palette {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.theme-palette-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.theme-palette-header svg {
    width: 18px;
    height: 18px;
    stroke: var(--theme-primary);
}

.theme-palette-header span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-option.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border);
}

.theme-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-swatch::before,
.theme-swatch::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
}

.theme-swatch::before {
    left: 0;
}

.theme-swatch::after {
    right: 0;
}

/* Theme Swatch Colors */
.theme-option[data-theme="light"] .theme-swatch::before {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.theme-option[data-theme="light"] .theme-swatch::after {
    background: #f1f5f9;
}

.theme-option[data-theme="ocean"] .theme-swatch::before {
    background: #3b82f6;
}

.theme-option[data-theme="ocean"] .theme-swatch::after {
    background: #06b6d4;
}

.theme-option[data-theme="sunset"] .theme-swatch::before {
    background: #f97316;
}

.theme-option[data-theme="sunset"] .theme-swatch::after {
    background: #ec4899;
}

.theme-option[data-theme="aurora"] .theme-swatch::before {
    background: #10b981;
}

.theme-option[data-theme="aurora"] .theme-swatch::after {
    background: #06b6d4;
}

.theme-option[data-theme="royal"] .theme-swatch::before {
    background: #8b5cf6;
}

.theme-option[data-theme="royal"] .theme-swatch::after {
    background: #a855f7;
}

.theme-option[data-theme="crimson"] .theme-swatch::before {
    background: #ef4444;
}

.theme-option[data-theme="crimson"] .theme-swatch::after {
    background: #f97316;
}

.theme-option[data-theme="emerald"] .theme-swatch::before {
    background: #059669;
}

.theme-option[data-theme="emerald"] .theme-swatch::after {
    background: #22c55e;
}

.theme-option span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.theme-option:hover span,
.theme-option.active span {
    color: var(--text-primary);
}

.theme-option .check-icon {
    margin-left: auto;
    width: 16px;
    height: 16px;
    stroke: var(--theme-primary);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.theme-option.active .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Tooltip */
.theme-toggle-btn::after {
    content: 'Theme';
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-toggle-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

.theme-switcher.active .theme-toggle-btn::after {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .theme-switcher {
        right: 16px;
        bottom: 80px;
        /* Moved up to avoid collision with back-to-top button */
    }

    .theme-toggle-btn {
        width: 44px;
        height: 44px;
        /* Disable all animations on mobile */
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .theme-toggle-btn:hover,
    .theme-toggle-btn:focus,
    .theme-toggle-btn:active {
        transform: none !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    }

    .theme-toggle-btn::before {
        transition: none !important;
        animation: none !important;
    }

    .theme-toggle-btn svg {
        width: 18px;
        height: 18px;
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .theme-toggle-btn:hover svg {
        transform: none !important;
    }

    .theme-palette {
        right: 0;
        min-width: 180px;
        padding: 12px;
    }

    .theme-toggle-btn::after {
        display: none;
    }
}

/* ========== Navigation Theme Switcher ========== */
.theme-switcher-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.theme-switcher-nav:hover {
    border-color: var(--theme-primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.theme-switcher-nav .theme-icon {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
    position: absolute;
    transition: opacity 0.3s ease;
}

.theme-switcher-nav .sun-icon {
    opacity: 1;
}

.theme-switcher-nav .moon-icon {
    opacity: 0;
}

[data-theme="light"] .theme-switcher-nav .sun-icon {
    opacity: 0;
}

[data-theme="light"] .theme-switcher-nav .moon-icon {
    opacity: 1;
}

@media (max-width: 768px) {
    .theme-switcher-nav {
        width: 36px;
        height: 36px;
        /* Disable all animations on mobile */
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .theme-switcher-nav:hover,
    .theme-switcher-nav:focus,
    .theme-switcher-nav:active {
        transform: none !important;
        box-shadow: none !important;
    }

    .theme-switcher-nav .theme-icon {
        width: 18px;
        height: 18px;
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Transition smoothness for theme changes */
body,
.btn-primary,
.gradient-text,
.nav-link::after,
.loader-logo,
.loader-progress,
.service-icon,
.step-number,
.hero-3d-glow,
.editor-tabs .tab.active {
    transition: background 0.4s ease, background-image 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}