/* Linksmartech Main Design System */

/* ===== THEME SYSTEM ===== */
:root {
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-card: #1e293b;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8fafc;
    --bg-nav: rgba(2, 6, 23, 0.80);
    --bg-nav-scroll: rgba(2, 6, 23, 0.95);
    --bg-mobile-menu: #020617;
    --bg-dropdown: rgba(2, 6, 23, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-heading: #ffffff;
    --text-body-dark: #0f172a;
    --text-body-light: #64748b;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-card: rgba(255, 255, 255, 0.10);
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --section-light-bg: #ffffff;
    --section-light-text: #0f172a;
    --section-light-subtitle: #64748b;
    --section-light-card-bg: #f8fafc;
    --section-light-card-border: #e2e8f0;
    --footer-bg: #020617;
    --scrollbar-track: #020617;
    --scrollbar-thumb: #2563eb;
    --modal-bg: #ffffff;
    --modal-header-bg: #f8fafc;
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
}

html.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-surface: #f8fafc;
    --bg-surface-alt: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --bg-nav-scroll: rgba(255, 255, 255, 0.95);
    --bg-mobile-menu: #ffffff;
    --bg-dropdown: rgba(255, 255, 255, 0.97);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;
    --text-body-dark: #0f172a;
    --text-body-light: #64748b;
    --border-color: rgba(0, 0, 0, 0.06);
    --border-card: #e2e8f0;
    --section-light-bg: #f8fafc;
    --section-light-text: #0f172a;
    --section-light-subtitle: #64748b;
    --section-light-card-bg: #ffffff;
    --section-light-card-border: #e2e8f0;
    --footer-bg: #0f172a;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #2563eb;
    --modal-bg: #ffffff;
    --modal-header-bg: #f8fafc;
    --input-bg: #f1f5f9;
    --input-border: #e2e8f0;
}

/* ===== THEME-AWARE OVERRIDES ===== */
html.light-mode body { background-color: #f8fafc; color: #0f172a; }

/* Navbar */
html.light-mode #navbar { 
    background: var(--bg-nav) !important; 
    border-bottom-color: var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
html.light-mode #navbar .text-white { color: #0f172a !important; }
html.light-mode #navbar .text-slate-300 { color: #475569 !important; }
html.light-mode #navbar .text-blue-400\/80 { color: #2563eb !important; }
html.light-mode #navbar .text-blue-500 { color: #2563eb !important; }

/* Mobile menu trigger */
html.light-mode #navbar button.lg\:hidden {
    color: #0f172a !important;
    border-color: rgba(0,0,0,0.1) !important;
    background: rgba(0,0,0,0.03) !important;
}

/* Mobile menu */
html.light-mode #mobile-menu { 
    background: var(--bg-mobile-menu) !important; 
    border-bottom-color: var(--border-color) !important;
}
html.light-mode #mobile-menu .text-slate-300 { color: #334155 !important; }
html.light-mode #mobile-menu .text-slate-400 { color: #64748b !important; }
html.light-mode #mobile-menu .border-white\/5 { border-color: rgba(0,0,0,0.06) !important; }

/* Dropdown menus */
html.light-mode .nav-dropdown-menu {
    background: var(--bg-dropdown) !important;
    border-color: var(--border-card) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04) !important;
}
html.light-mode .nav-dropdown-menu::before {
    border-bottom-color: var(--border-card) !important;
}
html.light-mode .nav-dropdown-item { color: #475569 !important; }
html.light-mode .nav-dropdown-item:hover { 
    background: rgba(37, 99, 235, 0.06) !important; 
    color: #2563eb !important; 
}
html.light-mode .nav-dropdown-divider { background: rgba(0,0,0,0.04) !important; }
html.light-mode .nav-dropdown-item .dd-icon {
    background: rgba(37, 99, 235, 0.06) !important;
    border-color: rgba(37, 99, 235, 0.12) !important;
}

/* Sections: white bg sections become light gray in light mode */
html.light-mode section.bg-white, 
html.light-mode div.bg-white { 
    background: var(--section-light-bg) !important; 
}

/* Dark sections remain dark but slightly lighter in light mode */
html.light-mode section.bg-slate-950,
html.light-mode div.bg-slate-950 {
    background: #0f172a !important;
}
html.light-mode .bg-slate-50 { background: #ffffff !important; }

/* Cards in light mode */
html.light-mode section.bg-white .bg-slate-50,
html.light-mode section.bg-slate-50 .bg-white {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Footer in light mode */
html.light-mode footer#contact {
    background: var(--footer-bg) !important;
}

/* Scrollbar */
html.light-mode ::-webkit-scrollbar-track { background: var(--scrollbar-track) !important; }

/* Theme toggle button */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}
html.light-mode .theme-toggle {
    border-color: rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.04);
}
html.light-mode .theme-toggle:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
}
.theme-toggle .icon-wrap {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle .icon-wrap svg,
.theme-toggle .icon-wrap i {
    width: 18px;
    height: 18px;
}
.theme-toggle .icon-sun-wrap { 
    color: #fbbf24;
    opacity: 0;
    transform: rotate(90deg) scale(0);
}
.theme-toggle .icon-moon-wrap {
    color: #94a3b8;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
html.light-mode .theme-toggle .icon-sun-wrap {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #f59e0b;
}
html.light-mode .theme-toggle .icon-moon-wrap {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* Smooth transition for all theme changes */
body, #navbar, #mobile-menu, section, footer, .nav-dropdown-menu {
    transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body { font-family: 'Inter', sans-serif; }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fade-in 0.4s ease-out forwards; }
@keyframes slow-zoom { from { transform: scale(1); } to { transform: scale(1.1); } }
.animate-slow-zoom { animation: slow-zoom 25s linear infinite alternate; }
@keyframes scan { 0% { transform: translateY(-100%); opacity: 0; } 50% { opacity: 0.5; } 100% { transform: translateY(100vh); opacity: 0; } }
.animate-scan { animation: scan 4s linear infinite; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track, #020617); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb, #2563eb); }
.nav-scrolled { background-color: rgba(2, 6, 23, 0.9); backdrop-filter: blur(12px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); border-bottom: 1px solid rgba(59, 130, 246, 0.2); padding-top: 0.5rem; padding-bottom: 0.5rem; }
@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-15px) rotate(1deg); } }
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.05); } }
.animate-pulse-soft { animation: pulse-soft 8s ease-in-out infinite; }
.backdrop-blur-extra { backdrop-filter: blur(40px); }

.digitized-grid { background-image: linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px); background-size: 50px 50px; }

/* Nouvelles Animations */
@keyframes slide-up-skew {
    from { opacity: 0; transform: translateY(40px) skewY(2deg); }
    to { opacity: 1; transform: translateY(0) skewY(0); }
}
.animate-slide-up-skew { animation: slide-up-skew 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes reveal-width {
    from { width: 0; }
    to { width: 100%; }
}
.animate-reveal-width { animation: reveal-width 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards; }

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.animate-marquee { animation: marquee 30s linear infinite; }

@keyframes drift {
    0% { transform: translateX(0px); }
    50% { transform: translateX(15px); }
    100% { transform: translateX(0px); }
}
.animate-drift { animation: drift 8s ease-in-out infinite; }

.glitch-hover:hover {
    text-shadow: 2px 0 #2563eb, -2px 0 #ef4444;
    animation: glitch-anim 0.2s infinite;
}
@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.nav-dropdown-trigger .dropdown-chevron {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 10px;
    height: 10px;
}
.nav-dropdown:hover .dropdown-chevron {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 240px;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(59, 130, 246, 0.08);
    z-index: 200;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(59, 130, 246, 0.15);
}
.nav-dropdown-menu::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.2s ease;
}
.nav-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}
.nav-dropdown-item .dd-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.1);
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.nav-dropdown-item:hover .dd-icon {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}
.nav-dropdown-item .dd-icon i {
    width: 14px;
    height: 14px;
    color: #3b82f6;
}
.nav-dropdown-item .dd-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-dropdown-item .dd-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
}
.nav-dropdown-item .dd-desc {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    opacity: 0.5;
    text-transform: none;
}
.nav-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 4px 8px;
}

/* Mobile accordion */
.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-accordion-content.open {
    max-height: 300px;
}
.mobile-accordion-trigger .accordion-chevron {
    transition: transform 0.3s ease;
}
.mobile-accordion-trigger.active .accordion-chevron {
    transform: rotate(180deg);
}
