/* css/style.css - V45 "LUXE & PERFORMANCE" - Inspiré par Tailwind v4 */

/* POLICES AUTO-HÉBERGÉES (RGPD — pas d'appel à Google Fonts) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('fonts/outfit-latin.woff2') format('woff2');
}

:root {
    /* Design Tokens (Tailwind v4 inspired) */
    --color-primary: #4f46e5;
    --color-primary-dark: #3730a3;
    --color-secondary: #0ea5e9;
    --color-accent: #f59e0b;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-text-muted: #525f7a; /* Darkened for accessibility WCAG AA compliance */
    --color-border: #e2e8f0;

    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: blur(12px) saturate(180%);
    --transition-slow: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* DARK MODE OVERRIDES */
@media (prefers-color-scheme: dark) {
    :root:not(.light) {
        --color-bg: #0f172a;
        --color-surface: #1e293b;
        --color-text: #f8fafc;
        --color-text-muted: #94a3b8;
        --color-border: #334155;
    }
}

html.dark {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.logo {
    font-family: 'Outfit', sans-serif;
}

/* HEADER FIXE PREMIUM */
.top-disclaimer {
    background: #fefce8;
    color: #854d0e;
    text-align: center;
    padding: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid #fef08a;
}

header {
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: var(--glass);
    width: 100%;
    z-index: 1000;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: 'M';
    background: var(--color-primary);
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.1rem;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 10px;
    transition: all 0.2s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* RECHERCHE MODERNE */
.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 450px;
}

#searchInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 12px;
    color: #fff;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

#searchInput:focus {
    background: #fff;
    color: #000;
    border-color: var(--color-primary);
}

#searchResults {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px;
    display: none;
    border: 1px solid var(--color-border);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.2s;
}

.search-item:hover {
    background: #f1f5f9;
}

.search-item img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
    border: 1px solid #eee;
}

/* HERO SECTION CINÉMATIQUE */
.hero-modern {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), url('../images/hero-luxury.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    padding: 100px 24px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hero-content {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-search form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px;
    font-size: 0.9rem;
    outline: none;
}

.hero-search button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.hero-search button:hover {
    transform: scale(1.02);
    background: var(--color-primary-dark);
}

.hero-stats { display: none; }

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-stat-number {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.8;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* LAYOUT & SECTIONS */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--color-text);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--color-border), transparent);
}

/* GRID SYSTEMS */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.grid-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    align-items: stretch;
}

/* TRUST BAR */
.trust-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 2px 0;
    box-shadow: var(--shadow-sm);
}

.trust-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 0 24px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.trust-item span {
    font-size: 1.2rem;
}

/* CARDS PREMIUM */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.card-img {
    height: 140px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 10;
}

.badge-default {
    background: var(--color-primary);
    color: #fff;
}

.coup-coeur {
    background: #ef4444;
    color: #fff;
}

.populaire {
    background: #f59e0b;
    color: #fff;
}

.nouveaute {
    background: #10b981;
    color: #fff;
}

.analyse {
    background: #6366f1;
    color: #fff;
}

.card-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* SMALL CARDS (categories / grid-6) */
.card-small {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    height: 100%;
}

.card-small:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}

.card-small img {
    width: 100%;
    height: 140px;
    max-height: 140px;
    object-fit: contain;
    background: #fff;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}

.card-small h3 {
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-card {
    background: var(--color-primary);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: auto;
    transition: background 0.2s;
}

.btn-card:hover {
    background: var(--color-primary-dark);
}

/* FOOTER MODERNE */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 80px 0 40px;
    margin-top: 80px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
}

.footer-links a {
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* VISITOR COUNTER */
.visitor-counter {
    display: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {

    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 640px) {

    .grid-4,
    .grid-3,
    .grid-6 {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

/* SCROLL EXPERIENCE (REVEAL ANIMATIONS) */
.reveal {
    opacity: 0;
    transition: var(--transition-slow);
}

.reveal-up {
    transform: translateY(40px);
}

.reveal-left {
    transform: translateX(-40px);
}

.reveal-right {
    transform: translateX(40px);
}

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

.active.reveal {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ACCESSIBILITY: Disable animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal, .card, .btn-card {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* DARK MODE ACCESSIBILITY FIXES */
html.dark .card, html.dark .card-small {
    background: #1e293b;
    border-color: #334155;
}

html.dark body {
    background-color: #0f172a;
    color: #f8fafc;
}

html.dark .section-title {
    color: #f8fafc;
}

html.dark .card-body p, html.dark .trust-item {
    color: #94a3b8;
}

html.dark .card-small img, html.dark .card-img {
    background: transparent;
}