/* ============================================
   MyTrustPartner - Dark Mode
   ============================================ */

/* Dark Mode Variables */
[data-theme="dark"] {
    /* Background */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-dark: #000000;

    /* Text */
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-tertiary: #707080;
    --text-inverse: #0a0a0f;

    /* Neutrals adjusted for dark */
    --color-white: #0a0a0f;
    --color-black: #f0f0f5;
    --color-gray-50: #12121a;
    --color-gray-100: #1a1a25;
    --color-gray-200: #252530;
    --color-gray-300: #35354a;
    --color-gray-400: #505070;
    --color-gray-500: #707090;
    --color-gray-600: #9090a5;
    --color-gray-700: #b0b0c0;
    --color-gray-800: #d0d0da;
    --color-gray-900: #f0f0f5;

    /* Shadows for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(0, 102, 255, 0.3);

    /* Primary colors with better contrast for dark */
    --color-primary: #3385FF;
    --color-primary-dark: #0066FF;
    --color-primary-light: #66A3FF;
    --color-primary-50: rgba(51, 133, 255, 0.1);
    --color-primary-100: rgba(51, 133, 255, 0.15);
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle {
    position: fixed;
    bottom: var(--spacing-8);
    left: var(--spacing-8);
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: transform var(--transition-base);
}

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

/* Sun icon (shown in dark mode) */
.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* ============================================
   Dark Mode Specific Overrides
   ============================================ */

/* Header in dark mode */
[data-theme="dark"] .header::before {
    background: rgba(10, 10, 15, 0.9);
}

[data-theme="dark"] .header.scrolled {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Hero section adjustments */
[data-theme="dark"] .hero__gradient {
    background: radial-gradient(ellipse at center, rgba(51, 133, 255, 0.15) 0%, transparent 70%);
}

[data-theme="dark"] .hero__grid {
    background-image:
        linear-gradient(rgba(51, 133, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 133, 255, 0.05) 1px, transparent 1px);
}

/* Cards and surfaces */
[data-theme="dark"] .service-card,
[data-theme="dark"] .expertise-card,
[data-theme="dark"] .number-card,
[data-theme="dark"] .contact__form-wrapper,
[data-theme="dark"] .team-card,
[data-theme="dark"] .value-card,
[data-theme="dark"] .office-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .other-service-card,
[data-theme="dark"] .training-card,
[data-theme="dark"] .compliance-card,
[data-theme="dark"] .service-visual-card,
[data-theme="dark"] .contact-method,
[data-theme="dark"] .certification-showcase-item {
    background: var(--bg-secondary);
    border-color: var(--color-gray-200);
}

[data-theme="dark"] .service-card:hover,
[data-theme="dark"] .expertise-card:hover,
[data-theme="dark"] .number-card:hover,
[data-theme="dark"] .other-service-card:hover {
    box-shadow: var(--shadow-glow);
}

/* Featured service card in dark mode */
[data-theme="dark"] .service-card--featured {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #003399 100%);
}

/* Testimonial */
[data-theme="dark"] .testimonial {
    background: var(--bg-secondary);
}

/* Form inputs */
[data-theme="dark"] .form__input,
[data-theme="dark"] .form__select,
[data-theme="dark"] .form__textarea {
    background: var(--bg-primary);
    border-color: var(--color-gray-300);
    color: var(--text-primary);
}

[data-theme="dark"] .form__input:focus,
[data-theme="dark"] .form__select:focus,
[data-theme="dark"] .form__textarea:focus {
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--color-primary-100);
}

/* Certifications */
[data-theme="dark"] .certification {
    background: var(--bg-secondary);
}

[data-theme="dark"] .certification:hover {
    background: var(--color-primary-50);
}

/* Footer in dark mode */
[data-theme="dark"] .footer {
    background: #000000;
}

[data-theme="dark"] .footer__certif {
    background: var(--color-gray-100);
}

/* Logo track */
[data-theme="dark"] .logo-item {
    background: var(--bg-secondary);
}

/* Sectors */
[data-theme="dark"] .sector {
    background: var(--bg-secondary);
}

[data-theme="dark"] .sector:hover {
    background: var(--color-primary-100);
}

/* Timeline */
[data-theme="dark"] .timeline::before {
    background: var(--color-gray-300);
}

/* CTA section */
[data-theme="dark"] .cta {
    background: linear-gradient(135deg, #001a4d 0%, #003399 100%);
}

/* Floating cards in hero */
[data-theme="dark"] .floating-card {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(51, 133, 255, 0.1);
}

/* SOC Dashboard */
[data-theme="dark"] .soc-dashboard {
    background: #000000;
    border: 1px solid var(--color-gray-200);
}

/* Page hero for inner pages */
[data-theme="dark"] .page-hero {
    background: #000000;
}

/* Buttons */
[data-theme="dark"] .btn--outline {
    border-color: var(--color-gray-400);
    color: var(--text-primary);
}

[data-theme="dark"] .btn--outline:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-50);
}

[data-theme="dark"] .btn--white {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* Back to top button */
[data-theme="dark"] .back-to-top {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(51, 133, 255, 0.2);
}

/* Service detail sections */
[data-theme="dark"] .service-detail {
    background: var(--bg-primary);
}

[data-theme="dark"] .service-detail--alt {
    background: var(--bg-secondary);
}

/* Values section */
[data-theme="dark"] .values-section,
[data-theme="dark"] .about,
[data-theme="dark"] .contact,
[data-theme="dark"] .other-services {
    background: var(--bg-secondary);
}

/* Preloader */
[data-theme="dark"] .preloader {
    background: var(--bg-primary);
}

/* Scroll progress */
[data-theme="dark"] .scroll-progress {
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

/* Feature items */
[data-theme="dark"] .feature-item {
    border-color: var(--color-gray-200);
}

/* Office cards */
[data-theme="dark"] .office-card__header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #003399 100%);
}

/* ============================================
   Smooth Theme Transition
   ============================================ */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.header,
.header::before,
.service-card,
.expertise-card,
.number-card,
.contact__form-wrapper,
.floating-card,
.btn,
.form__input,
.form__select,
.form__textarea,
.footer,
.testimonial,
.certification,
.sector,
.logo-item,
.news-card {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* ============================================
   News Section Dark Mode
   ============================================ */
[data-theme="dark"] .news {
    background: var(--bg-primary);
}

[data-theme="dark"] .news-card {
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-200);
}

[data-theme="dark"] .news-card__image {
    background: linear-gradient(135deg, rgba(51, 133, 255, 0.1) 0%, var(--color-gray-100) 100%);
}

[data-theme="dark"] .news-card__image-placeholder {
    background: var(--bg-primary);
}

/* ============================================
   System Preference Detection
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Auto dark mode when no preference is set */
    }
}
