/* ============================================
   OxcaSante Vitrine — Custom Styles
   ============================================ */

:root {
    --primary: #00b4ff;
    --primary-light: #4EBDF5;
    --primary-dark: #0090cc;
    --secondary: #004763;
    --dark: #0a0f1c;
    --dark-100: #121829;
    --dark-200: #1a1f35;
    --dark-300: #232940;
}

/* ---- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
main { padding-bottom: 4rem; }

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

::selection {
    background: rgba(0, 180, 255, 0.3);
    color: #fff;
}

body {
    cursor: default;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Cursor ---- */
#cursor-dot, #cursor-ring {
    transition: opacity 0.3s;
}

#cursor-ring {
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

#cursor-ring.hover {
    width: 60px;
    height: 60px;
    border-color: rgba(0, 180, 255, 0.8);
}

body.cursor-hidden * {
    cursor: none !important;
}

/* ---- Preloader ---- */
#preloader {
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---- Navigation ---- */
#navbar.scrolled {
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#navbar .nav-link {
    position: relative;
}

#navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

#navbar .nav-link:hover::after,
#navbar .nav-link.active::after {
    width: 100%;
}

/* Mobile menu toggle animation */
#menu-toggle.active .menu-bar:nth-child(1) {
    transform: translateY(0) rotate(45deg);
}
#menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menu-toggle.active .menu-bar:nth-child(3) {
    width: 1.5rem;
    transform: translateY(0) rotate(-45deg);
}

#mobile-menu.active {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Hero Particles ---- */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.particle-glow {
    box-shadow: 0 0 6px rgba(0, 180, 255, 0.4);
}

/* ---- Scroll Indicator ---- */
#scroll-indicator {
    animation: fadeInUp 1s ease 2.5s forwards;
}

@keyframes fadeInUp {
    to { opacity: 0.6; transform: translateX(-50%) translateY(0); }
}

/* ---- Section Tags ---- */
.section-tag {
    opacity: 0;
    transform: translateY(20px);
}

.section-title {
    opacity: 0;
    transform: translateY(30px);
}

.section-subtitle {
    opacity: 0;
    transform: translateY(20px);
}

/* ---- Card 3D Tilt ---- */
[data-tilt] {
    transform-style: preserve-3d;
    will-change: transform;
}

[data-tilt]:hover {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* ---- Glassmorphism ---- */
.glass {
    background: rgba(26, 31, 53, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---- Gradient Text ---- */
.text-gradient {
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---- Pricing Card Hover Glow ---- */
.pricing-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 1.5rem;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(0, 180, 255, 0.1) 50%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s;
}

.pricing-card:hover::before {
    opacity: 1;
}

/* ---- Feature Card Shine ---- */
.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 180, 255, 0.03), transparent);
    transition: left 0.7s ease;
    pointer-events: none;
}

.feature-card:hover::after {
    left: 100%;
}

/* ---- Counter Animation ---- */
#counter-99 {
    font-variant-numeric: tabular-nums;
}

/* ---- Proof Particles ---- */
.proof-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.proof-particle.burst {
    animation: particleBurst 1.5s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* ---- Steps Path Drawing ---- */
#steps-path-fill {
    transition: stroke-dashoffset 0.1s linear;
}

/* ---- reCAPTCHA ---- */
.g-recaptcha { transform-origin: left top; }
@media (max-width: 400px) { .g-recaptcha { transform: scale(0.85); } }
[data-theme="light"] .g-recaptcha { /* handled by data-theme attr in JS */ }

/* ---- Select styling ---- */
select option { background: #1a1f35; color: #fff; }
[data-theme="light"] select { background: rgba(0,0,0,0.03) !important; border-color: rgba(0,0,0,0.08) !important; color: #0f172a !important; }
[data-theme="light"] select option { background: #fff; color: #0f172a; }

/* ---- Form Floating Labels ---- */
.form-group input:focus ~ label,
.form-group textarea:focus ~ label {
    color: var(--primary);
}

/* ---- Blog Sidebar ---- */
.blog-sidebar .sidebar-card {
    opacity: 0;
    transform: translateY(20px);
    animation: sidebarFadeIn 0.6s ease forwards;
}
.blog-sidebar .sidebar-card:nth-child(1) { animation-delay: 0.1s; }
.blog-sidebar .sidebar-card:nth-child(2) { animation-delay: 0.25s; }
.blog-sidebar .sidebar-card:nth-child(3) { animation-delay: 0.4s; }
.blog-sidebar .sidebar-card:nth-child(4) { animation-delay: 0.55s; }

@keyframes sidebarFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.blog-sidebar .sidebar-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.blog-sidebar .sidebar-card:hover {
    border-color: rgba(0, 180, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 180, 255, 0.05);
}

/* Light mode sidebar */
[data-theme="light"] .blog-sidebar .sidebar-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="light"] .blog-sidebar .sidebar-card:hover {
    border-color: rgba(0, 180, 255, 0.2) !important;
    box-shadow: 0 4px 16px rgba(0, 180, 255, 0.06);
}

/* Sidebar hidden on mobile, shown on lg */
@media (max-width: 1023px) {
    .blog-sidebar { display: none; }
}

/* ---- Back to Top ---- */
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Cookie Banner ---- */
#cookie-banner.show {
    display: block;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---- Noise Overlay (subtle texture) ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9997;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============================================
   THEME TOGGLE
   ============================================ */

/* Logo visibility based on theme */
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
[data-theme="light"] .logo-light { display: block; }
[data-theme="light"] .logo-dark { display: none; }

/* Icon visibility based on theme */
[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .theme-icon-sun { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-icon-moon { opacity: 1; transform: rotate(0deg); }

/* ============================================
   LIGHT MODE
   ============================================ */
[data-theme="light"] body {
    background: #f5f7fb;
    color: #334155;
}

/* Scrollbar */
[data-theme="light"] { scrollbar-color: var(--primary) #e2e8f0; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #e2e8f0; }

/* Selection */
[data-theme="light"] ::selection { color: #0a0f1c; }

/* Noise overlay — lighter */
[data-theme="light"] body::before { opacity: 0.03; }

/* ---- Preloader ---- */
[data-theme="light"] #preloader { background: #f5f7fb; }

/* ---- Scroll Progress ---- */
[data-theme="light"] #scroll-progress {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
}

/* ---- Navigation ---- */
[data-theme="light"] #navbar.scrolled {
    background: rgba(245, 247, 251, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Dropdown menu */
[data-theme="light"] .group > div > .bg-dark-200\/95 {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
[data-theme="light"] .nav-link { color: #64748b !important; }
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active { color: var(--primary) !important; }
[data-theme="light"] .menu-bar { background: #1e293b !important; }
[data-theme="light"] #theme-toggle,
[data-theme="light"] #theme-toggle-mobile {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ---- Mobile Menu ---- */
[data-theme="light"] #mobile-menu { background: rgba(245, 247, 251, 0.98); }
[data-theme="light"] .mobile-link { color: #0f172a !important; }
[data-theme="light"] .mobile-link:hover { color: var(--primary) !important; }

/* ---- Logo text ---- */
[data-theme="light"] .font-heading.font-bold.text-xl > span:not(.text-primary),
[data-theme="light"] span.font-heading.font-bold.text-lg {
    color: #0f172a;
}

/* ---- Hero ---- */
[data-theme="light"] #hero { background: linear-gradient(180deg, #eef5ff 0%, #f5f7fb 100%); }
[data-theme="light"] #hero .animate-morph { opacity: 0.1; }
[data-theme="light"] #hero h1 { color: #0f172a; }
[data-theme="light"] #hero-subtitle { color: #64748b; }
[data-theme="light"] .hero-badge {
    background: rgba(0, 180, 255, 0.08);
    border-color: rgba(0, 180, 255, 0.2);
}
[data-theme="light"] #hero-ctas a:last-child {
    border-color: rgba(0, 0, 0, 0.1);
    color: #334155;
}
[data-theme="light"] #hero-ctas a:last-child:hover {
    border-color: var(--primary);
    color: var(--primary);
}
[data-theme="light"] #scroll-indicator span { color: #94a3b8; }
[data-theme="light"] #scroll-indicator .border-gray-600 { border-color: #cbd5e1; }

/* ---- Wave Divider ---- */
[data-theme="light"] svg path[fill="#121829"] { fill: #edf1f7; }

/* ---- Section backgrounds ---- */
[data-theme="light"] .bg-dark { background-color: #f5f7fb !important; }
[data-theme="light"] .bg-dark-100 { background-color: #edf1f7 !important; }
[data-theme="light"] .bg-dark\/98 { background-color: rgba(245,247,251,0.98) !important; }

/* ---- Section text ---- */
[data-theme="light"] .section-tag {
    background: rgba(0, 180, 255, 0.06);
    border-color: rgba(0, 180, 255, 0.15);
}
[data-theme="light"] .section-title,
[data-theme="light"] h2.font-heading,
[data-theme="light"] h3.font-heading { color: #0f172a !important; }
[data-theme="light"] .section-subtitle { color: #64748b !important; }

/* ---- Tables in light mode ---- */
[data-theme="light"] table th { color: #ffffff !important; }
[data-theme="light"] table { border-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] table tr { border-color: rgba(0, 0, 0, 0.06) !important; }

/* ---- Primary buttons use white text (works in both themes) ---- */

/* ---- General text overrides ---- */
[data-theme="light"] .text-white:not(.bg-primary *):not(.bg-primary) { color: #0f172a !important; }
[data-theme="light"] .bg-primary .text-white,
[data-theme="light"] a.bg-primary,
[data-theme="light"] button.bg-primary { color: #ffffff !important; }
[data-theme="light"] .text-gray-300 { color: #475569 !important; }
[data-theme="light"] .text-gray-400 { color: #64748b !important; }
[data-theme="light"] .text-gray-500 { color: #94a3b8 !important; }
[data-theme="light"] .text-gray-600 { color: #94a3b8 !important; }
[data-theme="light"] p > strong.text-white { color: #0f172a !important; }

/* ---- Cards ---- */
[data-theme="light"] .audience-card,
[data-theme="light"] .feature-card,
[data-theme="light"] .pricing-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}
[data-theme="light"] .audience-card:hover,
[data-theme="light"] .feature-card:hover {
    border-color: rgba(0, 180, 255, 0.2) !important;
    box-shadow: 0 4px 24px rgba(0, 180, 255, 0.08), 0 1px 3px rgba(0,0,0,0.04);
}

/* Feature card gradient overlay */
[data-theme="light"] .feature-card { background: #ffffff !important; }
[data-theme="light"] .feature-card .absolute.bg-primary\/5 { background: rgba(0, 180, 255, 0.03); }

/* Icon containers in light */
[data-theme="light"] .bg-primary\/10 { background: rgba(0, 180, 255, 0.08) !important; }

/* ---- Secondary feature blocks ---- */
[data-theme="light"] .bg-dark-200\/30,
[data-theme="light"] .bg-dark-200\/50,
[data-theme="light"] .bg-dark-200\/80 { background: #ffffff !important; }
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10 { border-color: rgba(0, 0, 0, 0.06) !important; }
[data-theme="light"] .hover\:bg-dark-300\/50:hover { background: rgba(0, 180, 255, 0.04) !important; }

/* ---- Pourquoi section ---- */
[data-theme="light"] .bg-red-500\/5 { background: rgba(239, 68, 68, 0.05) !important; }
[data-theme="light"] .border-red-500\/10 { border-color: rgba(239, 68, 68, 0.1) !important; }
[data-theme="light"] .bg-primary\/5 { background: rgba(0, 180, 255, 0.05) !important; }
[data-theme="light"] .border-primary\/10 { border-color: rgba(0, 180, 255, 0.1) !important; }

/* Concentric rings */
[data-theme="light"] .border-primary\/10 { border-color: rgba(0, 180, 255, 0.15) !important; }
[data-theme="light"] .border-primary\/15 { border-color: rgba(0, 180, 255, 0.2) !important; }
[data-theme="light"] .border-primary\/20 { border-color: rgba(0, 180, 255, 0.25) !important; }

/* Floating labels */
[data-theme="light"] .bg-dark-200\/80 { background: rgba(255,255,255,0.9) !important; }

/* ---- Proof section ---- */
[data-theme="light"] #preuve { background: linear-gradient(180deg, #f5f7fb, #eaf4ff, #f5f7fb) !important; }
[data-theme="light"] #preuve .absolute.bg-gradient-to-b { background: none; }
[data-theme="light"] .text-gray-500.text-xs { color: #64748b !important; }

/* ---- Pricing ---- */
[data-theme="light"] .pricing-card:nth-child(2) {
    background: linear-gradient(180deg, rgba(0,180,255,0.06), #ffffff) !important;
    border-color: rgba(0, 180, 255, 0.25) !important;
    box-shadow: 0 8px 40px rgba(0, 180, 255, 0.1);
}
[data-theme="light"] .bg-primary.text-dark.text-xs { /* Populaire badge stays */ }

/* Add-ons */
[data-theme="light"] .bg-dark-200\/30 { background: #ffffff !important; }

/* ---- Steps ---- */
[data-theme="light"] .step-item .bg-gradient-to-br {
    box-shadow: 0 4px 20px rgba(0, 180, 255, 0.2);
}

/* ---- Accompagnement ---- */
[data-theme="light"] #accompagnement .absolute { background: none; }
[data-theme="light"] .bg-gradient-to-r.from-dark-200\/50 {
    background: linear-gradient(to right, rgba(0,180,255,0.04), rgba(0,180,255,0.02)) !important;
}

/* ---- Contact ---- */
[data-theme="light"] .bg-dark-300\/50 {
    background: rgba(0, 0, 0, 0.03) !important;
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
}
[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
    border-color: rgba(0, 180, 255, 0.4) !important;
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.08) !important;
}
[data-theme="light"] .form-group label { color: #94a3b8 !important; }
[data-theme="light"] .form-group input:focus ~ label,
[data-theme="light"] .form-group textarea:focus ~ label {
    background: #ffffff !important;
    color: var(--primary) !important;
}
[data-theme="light"] .form-group input:not(:placeholder-shown) ~ label,
[data-theme="light"] .form-group textarea:not(:placeholder-shown) ~ label {
    background: #ffffff !important;
}

/* Demo CTA box */
[data-theme="light"] .bg-gradient-to-br.from-primary\/10 {
    background: linear-gradient(135deg, rgba(0,180,255,0.06), rgba(0,71,99,0.04)) !important;
}

/* Social icons */
[data-theme="light"] a .bg-dark-300\/50 { background: rgba(0,0,0,0.04) !important; }

/* ---- Footer ---- */
[data-theme="light"] footer { background: #edf1f7 !important; border-color: rgba(0,0,0,0.06) !important; }
[data-theme="light"] footer .text-gray-500 { color: #64748b !important; }
[data-theme="light"] footer .text-gray-600 { color: #94a3b8 !important; }
[data-theme="light"] footer .text-gray-400 { color: #475569 !important; }

/* Back to top */
[data-theme="light"] #back-to-top {
    background: rgba(0, 180, 255, 0.08);
    border-color: rgba(0, 180, 255, 0.15);
}
[data-theme="light"] #back-to-top:hover { background: var(--primary); color: #fff; }

/* Cookie banner */
[data-theme="light"] #cookie-banner > div {
    background: rgba(255,255,255,0.95) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
}
[data-theme="light"] #cookie-decline {
    border-color: rgba(0,0,0,0.1) !important;
    color: #64748b !important;
}

/* ---- Decorative blurs in light mode ---- */
[data-theme="light"] .blur-3xl,
[data-theme="light"] .blur-\[150px\],
[data-theme="light"] .blur-\[120px\],
[data-theme="light"] .blur-\[200px\] {
    opacity: 0.5;
}

/* Cursor in light mode */
[data-theme="light"] #cursor-dot { background: var(--primary-dark); }
[data-theme="light"] #cursor-ring { border-color: rgba(0, 144, 204, 0.4); }

/* Medical crosses in hero */
[data-theme="light"] #hero svg[viewBox="0 0 40 40"] rect { fill: var(--primary-dark); }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .particle, .proof-particle { display: none !important; }
    #cursor-dot, #cursor-ring { display: none !important; }
    [data-tilt]:hover { transform: none !important; }
}

/* ---- Mobile Responsive Overrides ---- */
@media (max-width: 768px) {
    /* Simplify heavy effects on mobile */
    .animate-morph {
        width: 300px !important;
        height: 300px !important;
    }

    .particle { display: none; }

    [data-tilt]:hover {
        transform: none !important;
    }

    body::before {
        display: none;
    }

    #counter-99 {
        font-size: 6rem !important;
    }
}

@media (max-width: 480px) {
    #counter-99 {
        font-size: 4.5rem !important;
    }
}

/* ---- Print ---- */
@media print {
    #preloader, #cursor-dot, #cursor-ring, #scroll-progress, #cookie-banner, #back-to-top,
    .particle, .proof-particle { display: none !important; }
    body { background: #fff; color: #000; }
    body::before { display: none; }
}
