/* ========================================
   MENTOR AI NOTAIRE - Design System
   Based on Oloodi Technologies Design
   THEME: LIGHT (Professional / Legal)
   ======================================== */

/* === CSS Variables === */
:root {
    /* Brand Colors */
    --color-coral: #FF7F50;
    --color-coral-dark: #E66A40;
    --color-coral-light: rgba(255, 127, 80, 0.1);
    --color-coral-glow: rgba(255, 127, 80, 0.3);

    /* Light Theme Palette */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-card: #ffffff;

    /* Text */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* === Base Styles === */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.font-handwritten {
    font-family: 'Kalam', cursive;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 9999px;
    background-color: var(--color-coral);
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(255, 127, 80, 0.4);
    text-decoration: none;
}

.btn-primary:hover {
    background-color: var(--color-coral-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 127, 80, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 9999px;
    background-color: white;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--color-coral);
    color: var(--color-coral);
    background-color: rgba(255, 127, 80, 0.03);
}

/* === Mobile Menu === */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.mobile-menu.active {
    max-height: 400px;
}

/* === Grid Pattern Background === */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* === Scroll Animations === */
.scroll-animate,
.scroll-slide-left,
.scroll-slide-right,
.scroll-scale {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate {
    transform: translateY(30px);
}

.scroll-slide-left {
    transform: translateX(-50px);
}

.scroll-slide-right {
    transform: translateX(50px);
}

.scroll-scale {
    transform: scale(0.95);
}

/* Stagger animations for grids */
.scroll-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-stagger.active > *:nth-child(1) { transition-delay: 0.1s; }
.scroll-stagger.active > *:nth-child(2) { transition-delay: 0.2s; }
.scroll-stagger.active > *:nth-child(3) { transition-delay: 0.3s; }
.scroll-stagger.active > *:nth-child(4) { transition-delay: 0.4s; }
.scroll-stagger.active > *:nth-child(5) { transition-delay: 0.5s; }
.scroll-stagger.active > *:nth-child(6) { transition-delay: 0.6s; }

/* Active state */
.active,
.scroll-stagger.active > * {
    opacity: 1;
    transform: none;
}

/* === Pulse Animation === */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* === Module Card Featured (Glow Effect) === */
.module-card-featured {
    position: relative;
}

.module-card-featured::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--color-coral-glow), transparent, var(--color-coral-glow));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.module-card-featured:hover::after {
    opacity: 1;
}

/* === Card Hover Effects === */
.card-hover {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .scroll-slide-left,
    .scroll-slide-right {
        transform: translateY(30px);
    }
}

/* === Focus States for Accessibility === */
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 2px solid var(--color-coral);
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid var(--color-coral);
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Selection Color === */
::selection {
    background-color: var(--color-coral-light);
    color: var(--color-coral-dark);
}

/* === Scrollbar Styling (Optional) === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* === Float Animation (for decorative blurs) === */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(-10px) translateX(-10px);
    }
    75% {
        transform: translateY(-25px) translateX(5px);
    }
}

.animate-float {
    animation: float 8s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float 10s ease-in-out infinite;
    animation-delay: -4s;
}

/* === Glow Pulse Animation (for featured module) === */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 127, 80, 0.2),
                    0 0 40px rgba(255, 127, 80, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 127, 80, 0.35),
                    0 0 60px rgba(255, 127, 80, 0.2);
    }
}

.animate-glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* === Gradient Animation (for CTA bar) === */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background: linear-gradient(90deg,
        var(--color-coral),
        #f97316,
        var(--color-coral),
        #fb923c,
        var(--color-coral));
    background-size: 300% 100%;
    animation: gradient-flow 4s ease infinite;
}

/* === Icon Hover Animation === */
.icon-hover {
    transition: transform var(--transition-base);
}

.icon-hover:hover {
    transform: scale(1.1) rotate(5deg);
}

/* === Subtle Scale on Card Hover === */
.card-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-lift:hover {
    transform: translateY(-6px);
}

/* === Print Styles === */
@media print {
    .btn-primary,
    .btn-secondary,
    header,
    footer {
        display: none !important;
    }

    body {
        color: black;
        background: white;
    }
}

/* === Reduced Motion (Accessibility) === */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .animate-float-delayed,
    .animate-glow-pulse,
    .animate-gradient,
    .animate-pulse {
        animation: none;
    }

    .scroll-animate,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-scale,
    .scroll-stagger > * {
        transition: none;
        opacity: 1;
        transform: none;
    }
}
