/* =============================================
   NeoFRPBypass — Design "Dark Pro" v2
   ============================================= */

/* === TOKENS === */
:root {
    --bg:           #0F0F13;
    --surface:      #16161D;
    --surface-2:    #1C1C26;
    --border:       #25252F;
    --primary:      #4F8EF7;
    --primary-dim:  rgba(79,142,247,0.12);
    --accent:       #7C3AED;
    --accent-dim:   rgba(124,58,237,0.12);
    --success:      #22C55E;
    --warning:      #F59E0B;
    --danger:       #EF4444;
    --text:         #E8E8F0;
    --muted:        #6B6B7E;
    --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius:       8px;
    --radius-sm:    4px;
    --speed:        0.18s;
    --shadow:       0 10px 30px rgba(0,0,0,0.1);
}

/* === ICONES HAUTE PERFORMANCE (MATERIAL SYMBOLS) === */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    flex-shrink: 0;
    user-select: none;
    width: 1.15em;
    height: 1.15em;
    overflow: hidden;
}


/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }

/* === BACK TO TOP === */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    background: var(--accent);
}

/* Light theme */
[data-theme="light"] {
    --bg:           #F4F5F7;
    --surface:      #FFFFFF;
    --surface-2:    #F0F0F5;
    --border:       #E0E0EB;
    --text:         #1A1A2E;
    --muted:        #6B6B7E;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--speed), color var(--speed);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* =============================================
   HEADER & NAVBAR RESPONSIVE HAUTE DENSITÉ
   ============================================= */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-accent {
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.nav-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.logo .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.45rem;
    flex-shrink: 0;
}

nav.desktop-nav {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

nav.desktop-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

nav.desktop-nav ul li {
    flex: 0 0 auto;
    white-space: nowrap;
}

nav.desktop-nav ul li a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    line-height: 1;
    border: 1px solid transparent;
    transition: color var(--speed), background var(--speed), border-color var(--speed), transform var(--speed);
    flex: 0 0 auto;
}

nav.desktop-nav ul li a * {
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

nav.desktop-nav ul li a .material-symbols-outlined {
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform var(--speed);
}

nav.desktop-nav ul li a:hover {
    color: var(--text);
    background: var(--surface-2);
}

nav.desktop-nav ul li a:hover .material-symbols-outlined {
    transform: scale(1.08);
}

nav.desktop-nav ul li a.active {
    color: var(--primary);
    background: var(--primary-dim);
    font-weight: 600;
    border-color: rgba(79, 142, 247, 0.25);
}

/* Bouton principal mis en valeur : FRP Bypass */
nav.desktop-nav ul li a.nav-highlight {
    background: rgba(79, 142, 247, 0.12);
    color: var(--primary);
    border: 1px solid rgba(79, 142, 247, 0.35);
    font-weight: 600;
    padding: 0.5rem 0.95rem;
    box-shadow: 0 0 12px rgba(79, 142, 247, 0.08);
}

nav.desktop-nav ul li a.nav-highlight:hover {
    background: rgba(79, 142, 247, 0.2);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 142, 247, 0.2);
}

nav.desktop-nav ul li a.nav-highlight .material-symbols-outlined {
    color: var(--primary);
}

/* Actions à droite */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: none;
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--speed), background var(--speed), border-color var(--speed), transform var(--speed);
    text-decoration: none;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.icon-btn:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
    transform: scale(1.05);
}

.icon-btn .material-symbols-outlined {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.hamburger-btn {
    display: none;
}

/* =============================================
   FLOATING SPOTLIGHT LIVE SEARCH ("À LA VOLÉE")
   ============================================= */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(1rem, 7vh, 5rem);
    animation: fadeInOverlay 0.18s ease-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-overlay.open { display: flex; }

.search-box.floating-spotlight {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(56, 189, 248, 0.15);
    overflow: hidden;
    animation: floatDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

@keyframes floatDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: relative;
}

.search-input-wrap .search-icon {
    color: var(--primary);
    font-size: 1.6rem;
    flex-shrink: 0;
}

.search-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 1.15rem;
    outline: none;
    font-weight: 500;
}

.search-input-wrap input::placeholder {
    color: var(--muted);
    font-weight: 400;
}

.search-clear-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.15s ease;
}
.search-clear-btn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.search-kbd-badge kbd,
.search-close-btn kbd {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    font-family: var(--font);
}

.search-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.search-close-btn:hover kbd {
    border-color: var(--primary);
    color: var(--text);
}

/* Onglets de filtrage par catégorie */
.search-categories-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.search-categories-bar::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.cat-pill .material-symbols-outlined { font-size: 1.05rem; }
.cat-pill:hover {
    color: var(--text);
    border-color: var(--primary);
}
.cat-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.search-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 1.4rem;
    font-size: 0.78rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}
.search-quick-tip { font-style: italic; }

.search-results-list {
    max-height: 480px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.4rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.active {
    background: var(--surface-2);
    border-left: 3px solid var(--primary);
}

.result-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.result-icon-box.frp { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); }
.result-icon-box.apk { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.result-icon-box.download { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(192, 132, 252, 0.3); }
.result-icon-box.tutorial { background: rgba(249, 115, 22, 0.15); color: #fb923c; border-color: rgba(251, 146, 60, 0.3); }

.result-details {
    flex: 1;
    min-width: 0;
}
.result-title-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.result-title {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text);
}
.result-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-frp { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.badge-apk { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge-dl  { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge-tuto { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

.result-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.25rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-highlight {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 700;
}

.result-arrow {
    color: var(--muted);
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.search-result-item:hover .result-arrow,
.search-result-item.active .result-arrow {
    opacity: 1;
    color: var(--primary);
    transform: translateX(3px);
}

.search-footer-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    padding: 0.65rem 1.4rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--muted);
}
.search-footer-bar kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: var(--text);
}

.search-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

/* =============================================
   LAYOUT
   ============================================= */
main {
    flex: 1;
    padding: 2rem 0;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

.container {
    padding: 0 2rem;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    padding: 4rem 0 3rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.1rem;
}

.hero h1 span { color: var(--primary); }

.hero p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 560px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--speed);
}

.btn .material-symbols-outlined { font-size: 1rem; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { opacity: 0.88; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* =============================================
   SECTION HEADING
   ============================================= */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.35rem;
}

/* =============================================
   CARDS GRID
   ============================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, backdrop-filter 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.4s;
}

/* Désactivation définitive des barres latérales et supérieures au survol */
.card:hover::after {
    opacity: 0;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.4s;
}

.card:hover::before { opacity: 0; }

.card--purple:hover { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 20px 40px rgba(0, 0, 0, 0.3); }
.card--success:hover { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 20px 40px rgba(0, 0, 0, 0.3); }

.card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.card .card-icon .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.6rem;
}

.card--purple .card-icon { background: var(--accent-dim); }
.card--purple .card-icon .material-symbols-outlined { color: var(--accent); }
.card--success .card-icon { background: rgba(34,197,94,0.1); }
.card--success .card-icon .material-symbols-outlined { color: var(--success); }

.card-icon-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}
.card-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.card .card-link { margin-top: 1.25rem; }

/* =============================================
   TABLE PRO
   ============================================= */
.table-wrap { overflow-x: auto; }

.table-pro {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-pro th {
    background: var(--surface-2);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.table-pro td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-pro tr:last-child td { border-bottom: none; }
.table-pro tbody tr:hover { background: var(--surface-2); }

.file-row { display: flex; align-items: center; gap: 0.75rem; }
.file-icon { font-size: 1.4rem; flex-shrink: 0; }
.file-name { font-weight: 500; font-size: 0.9rem; }

/* =============================================
   BADGES
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
    letter-spacing: 0.02em;
}

.badge-tools    { color: #60A5FA; border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.08); }
.badge-firmware { color: #34D399; border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08); }
.badge-drivers  { color: #FBBF24; border-color: rgba(251,191,36,0.3);  background: rgba(251,191,36,0.08); }

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    padding: 2rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.page-header p { color: var(--muted); font-size: 0.95rem; }

/* =============================================
   FILTER TABS
   ============================================= */
.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    background: none;
    transition: all var(--speed);
}

.filter-tab:hover { color: var(--primary); border-color: var(--primary); }
.filter-tab.active { background: var(--primary-dim); border-color: var(--primary); color: var(--primary); }

/* =============================================
   CARD HORIZONTAL (Tutoriels)
   ============================================= */
.list-view { display: flex; flex-direction: column; gap: 0.75rem; }

.card-horizontal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.card-horizontal:hover { 
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(5px); 
}

/* =============================================
   FRP TOOLS LIST - ADAPTIVE LAYOUT
   ============================================= */
.tools-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: background 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.tool-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 25px 50px rgba(0, 0, 0, 0.4);
}

.tool-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tool-icon-img, .tool-icon-symbol {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: 16px;
    font-size: 2rem;
}

.tool-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.tool-text p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.tool-btn {
    width: 100%;
    margin-top: auto;
}

@media (max-width: 768px) {
    .tools-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .tool-item {
        flex-direction: row;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        text-align: left;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        background: var(--surface);
    }
    
    .tool-info {
        flex-direction: row;
        align-items: center;
        gap: 0.85rem;
        text-align: left;
        flex: 1;
        overflow: hidden;
    }
    
    .tool-icon-img, .tool-icon-symbol {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .tool-text {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .tool-text h3 {
        font-size: 0.95rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tool-text p {
        font-size: 0.7rem;
        color: var(--muted);
        line-height: 1.2;
        margin-top: 2px;
        display: -webkit-box !important;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .tool-btn {
        width: auto;
        margin-top: 0;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        background: var(--primary) !important;
        color: white !important;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .tool-btn span:not(.material-symbols-outlined) {
        display: inline !important;
    }
}





.image-wrapper {
    flex-shrink: 0;
    width: 110px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.image-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrapper .material-symbols-outlined { color: var(--primary); font-size: 1.5rem; }

.card-horizontal .content { flex: 1; min-width: 0; }
.card-horizontal h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-horizontal p { font-size: 0.82rem; color: var(--muted); }
.card-horizontal .action { flex-shrink: 0; }

/* =============================================
   CONTACT FORM
   ============================================= */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 640px; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--speed), box-shadow var(--speed);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Custom Select */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B6B7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Custom File Input */
.form-group input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}
.form-group input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    margin-right: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: opacity var(--speed);
}
.form-group input[type="file"]::file-selector-button:hover { opacity: 0.9; }

/* Responsive Grid in Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; gap: 1rem; }
}

.btn { }

/* =============================================
   MOBILE NAVIGATION DRAWER
   ============================================= */
.hamburger-btn { display: none; }
.desktop-only { display: flex; }

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--speed), visibility var(--speed);
}
.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 300px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 9995;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.mobile-drawer-links {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
}

.mobile-drawer-links li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-left: 4px solid transparent;
    transition: all var(--speed);
}

.mobile-drawer-links li a .material-symbols-outlined { 
    color: var(--muted); 
    font-size: 1.4rem;
    transition: color var(--speed);
}

.mobile-drawer-links li a:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.mobile-drawer-links li a:hover .material-symbols-outlined {
    color: var(--primary);
}


.mobile-drawer-links li a.nav-highlight {
    background: rgba(79, 142, 247, 0.08);
    border-left-color: var(--primary);
    color: var(--primary);
}
.mobile-drawer-links li a.nav-highlight .material-symbols-outlined {
    color: var(--primary);
}

.mobile-drawer-links li a.active { 
    background: var(--primary-dim); 
    border-left-color: var(--primary); 
    color: var(--primary); 
}

.mobile-drawer-links li a.active .material-symbols-outlined { 
    color: var(--primary); 
}

.mobile-drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.85rem;
    color: var(--muted);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: auto;
}

footer a { color: var(--primary); text-decoration: none; }

/* =============================================
   LATEST SECTION  
   ============================================= */
.latest-section { margin-top: 3.5rem; }

/* =============================================
   RESPONSIVE
   ============================================= */
/* Adaptation progressive sur écrans moyens (1121px - 1280px) */
@media (max-width: 1280px) and (min-width: 1121px) {
    .nav-inner {
        padding: 0 1rem;
        gap: 0.75rem;
    }
    .logo a {
        font-size: 1.05rem;
    }
    nav.desktop-nav ul {
        gap: 0.25rem;
    }
    nav.desktop-nav ul li a {
        padding: 0.45rem 0.65rem;
        font-size: 0.84rem;
        gap: 0.35rem;
        white-space: nowrap !important;
        text-wrap: nowrap !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }
    nav.desktop-nav ul li a .material-symbols-outlined {
        font-size: 1.05rem;
    }
    .header-actions .desktop-only {
        display: none !important;
    }
}

/* Bascule propre vers le menu mobile dès 1120px (garantit zéro écrasement) */
@media (max-width: 1120px) {
    .desktop-nav { display: none !important; }
    .desktop-only { display: none !important; }
    .hamburger-btn { display: inline-flex !important; }
    .nav-inner {
        padding: 0 1rem;
        gap: 1rem;
    }
    .search-overlay {
        padding: 8vh 1.5rem 0;
    }
}

@media (max-width: 768px) {
    .nav-inner { padding: 0 1rem; gap: 1rem; }
    main { padding: 1.5rem 1rem; }
    .hero h1 { font-size: 2.2rem; }
    .card-horizontal { flex-wrap: wrap; }
    .image-wrapper { width: 80px; height: 55px; }
    .search-overlay {
        padding: 5vh 1rem 0;
    }
}
/* =============================================
   RICH TEXT (Quill Content)
   ============================================= */
.rich-text {
    line-height: 1.8;
    color: var(--text);
}

.rich-text h1, .rich-text h2, .rich-text h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.rich-text p {
    margin-bottom: 1.25rem;
}

.rich-text ul, .rich-text ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.rich-text li {
    margin-bottom: 0.5rem;
}

.rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.rich-text blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background: var(--surface-2);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--muted);
}

.rich-text code {
    background: var(--surface-2);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.rich-text pre {
    background: var(--surface-2);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* =============================================
   SEARCH RESULTS PAGE
   ============================================= */
.search-section {
    margin-bottom: 4rem;
}

.search-section .section-title {
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .rich-text {
        font-size: 1rem;
    }
}

/* =============================================
   MOBILE DETAIL MODE FOR TABLES
   ============================================= */
@media (max-width: 768px) {
    .table-pro thead { display: none; }
    .table-pro, .table-pro tbody, .table-pro tr, .table-pro td { display: block; width: 100%; }
    .table-pro tr { 
        background: var(--surface); 
        border: 1px solid var(--border); 
        border-radius: 16px; 
        margin-bottom: 1.25rem; 
        padding: 1.25rem;
    }
    .table-pro td { 
        border: none; 
        padding: 0.4rem 0; 
        text-align: left;
    }
    .table-pro td:first-child { 
        border-bottom: 1px solid var(--border);
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .table-pro td:last-child { 
        margin-top: 1rem; 
    }
    .table-pro .btn { 
        width: 100%; 
        justify-content: center; 
        padding: 0.8rem; 
        font-size: 0.9rem;
    }
}

/* =============================================
   AD SLOTS & ADSENSE PLACEHOLDERS
   ============================================= */
.ad-slot {
    margin: 2rem auto;
    padding: 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 100%;
    transition: border-color var(--speed), background var(--speed);
}

.ad-slot:hover {
    border-color: rgba(79, 142, 247, 0.3);
    background: rgba(255, 255, 255, 0.01);
}

.ad-slot::before {
    content: 'PUBLICITÉ';
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

/* Horizontal banner styles (Leaderboard) */
.ad-slot--horizontal {
    min-height: 120px;
    max-width: 970px;
}

/* Rectangle styles (Sidebar/In-content) */
.ad-slot--rectangle {
    min-height: 280px;
    max-width: 336px;
}

/* Dynamic responsive wrapper */
.ad-slot-inner {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .ad-slot {
        margin: 1rem auto;
        padding: 0.5rem;
        border-radius: var(--radius-sm);
    }
    .ad-slot--horizontal {
        min-height: 60px;
    }
    .ad-slot--rectangle {
        min-height: 200px;
        max-width: 100%;
    }
    .ad-placeholder-banner {
        padding: 0.75rem;
    }
    .ad-placeholder-banner h4 {
        font-size: 0.8rem;
    }
}

/* Simulated Ad banner matching design system */
.ad-placeholder-banner {
    width: 100%;
    height: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, var(--surface-2) 0%, rgba(79, 142, 247, 0.04) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 1.25rem;
    user-select: none;
}

.ad-placeholder-banner .material-symbols-outlined {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.ad-placeholder-banner h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.ad-placeholder-banner p {
    font-size: 0.75rem;
    color: var(--muted);
    max-width: 320px;
}

/* =============================================
   RESPONSIVE INFO PAGES (Privacy, Terms, About)
   ============================================= */
.info-page-wrapper {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 3rem;
}
.info-page-panel {
    padding: 3rem;
    line-height: 1.8;
}
@media (max-width: 768px) {
    .info-page-wrapper {
        padding: 0 1.25rem;
    }
    .info-page-panel {
        padding: 1.75rem 1.25rem;
    }
}

/* =============================================
   ADMIN FORMS & FULL-WIDTH CARDS SYSTEM
   ============================================= */
.form-layout-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.75rem;
    align-items: start;
    width: 100%;
}

.form-layout-3col {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.75rem;
    align-items: start;
    width: 100%;
}

.form-col-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.form-col-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.5rem;
    min-width: 0;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: border-color var(--speed);
}

.form-card:hover {
    border-color: rgba(79, 142, 247, 0.25);
}

.form-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.form-card-title .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.25rem;
}

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: var(--surface-2);
    transition: all 0.2s ease;
}

.file-drop-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 142, 247, 0.04);
}

.preset-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-pill:hover {
    background: var(--primary-dim);
    color: var(--primary);
    border-color: rgba(79,142,247,0.3);
}

@media (max-width: 960px) {
    .form-layout-2col,
    .form-layout-3col {
        grid-template-columns: 1fr;
    }
    .form-col-side {
        position: static;
    }
}

/* =============================================
   CUSTOM SELECT & DROPDOWNS SYSTEM
   ============================================= */
select,
.select-pro {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 2.5rem 0.65rem 0.95rem;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234F8EF7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 0.75rem) center;
    background-size: 1.15rem;
    transition: border-color var(--speed), box-shadow var(--speed), background-color var(--speed);
    outline: none;
}

select:hover,
.select-pro:hover {
    border-color: rgba(79, 142, 247, 0.4);
    background-color: var(--surface);
}

select:focus,
.select-pro:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
    background-color: var(--surface);
}

select option {
    background: var(--surface);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-weight: 500;
}

/* Custom Status Select (Compact in tables & headers) */
.select-status {
    padding: 0.35rem 2rem 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    height: auto;
    background-size: 0.95rem;
    background-position: calc(100% - 0.5rem) center;
}

.select-status.status-new {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.select-status.status-in_progress {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.select-status.status-resolved,
.select-status.status-approved {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* =============================================
   CUSTOM DATE BADGES (HUMANIZED)
   ============================================= */
.date-badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text);
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
}

.date-badge-pro:hover {
    border-color: rgba(79, 142, 247, 0.4);
    background: var(--surface);
}

.date-badge-icon {
    font-size: 1.05rem !important;
    color: var(--primary);
    flex-shrink: 0;
}

.date-badge-content {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.date-relative-text {
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
}

.date-exact-subtext {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Dropdown Action Menu Popup */
.action-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.action-dropdown-trigger {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-dropdown-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    min-width: 160px;
    z-index: 200;
    padding: 0.35rem;
    flex-direction: column;
    gap: 0.2rem;
}

.action-dropdown-menu.show {
    display: flex;
    animation: fadeInDown 0.15s ease-out;
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    font-size: 0.82rem;
    color: var(--text);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-dropdown-item:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.action-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ADVERTISING CAMPAIGN CREATOR & PREVIEW SYSTEM
   ============================================= */
.ad-format-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ad-format-card {
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    user-select: none;
}

.ad-format-card:hover {
    border-color: rgba(79, 142, 247, 0.5);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.ad-format-card.active {
    border-color: var(--primary);
    background: rgba(79, 142, 247, 0.06);
    box-shadow: 0 0 0 1px var(--primary), 0 6px 20px rgba(79, 142, 247, 0.15);
}

.ad-format-card .format-icon {
    font-size: 2.2rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
    transition: color 0.2s ease;
}

.ad-format-card.active .format-icon {
    color: var(--primary);
}

.ad-format-card .format-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.ad-format-card .format-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-dim);
    color: var(--primary);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.45rem;
}

.ad-format-card .format-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
}

.ad-format-card .check-circle {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--primary);
    font-size: 1.15rem;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s ease;
}

.ad-format-card.active .check-circle {
    opacity: 1;
    transform: scale(1);
}

.ad-live-preview-box {
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}

.ad-live-preview-box:hover {
    border-color: rgba(79, 142, 247, 0.4);
}

/* =============================================
   SOCIAL BUBBLES & BRAND ICONS (YOUTUBE, ETC.)
   ============================================= */
.social-flex {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.social-bubble {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-bubble svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.social-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.social-bubble[title*="YouTube"]:hover,
.social-bubble.social-youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
}

.social-bubble[title*="Facebook"]:hover,
.social-bubble.social-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.45);
}

.social-bubble[title*="Telegram"]:hover,
.social-bubble.social-telegram:hover {
    background: #229ed9;
    border-color: #229ed9;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(34, 158, 217, 0.45);
}

/* =============================================
   HD VIDEO PLAYER & YOUTUBE CINEMA COMPONENT
   ============================================= */
.video-hd-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    margin: 1.5rem 0;
}

.video-hd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.video-badge-yt {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.video-badge-mp4 {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.video-title-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.video-responsive-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-responsive-wrap iframe,
.video-responsive-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-hd-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-youtube-red {
    background: #ff0000;
    color: #ffffff !important;
    border: 1px solid #ff0000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-youtube-red:hover {
    background: #cc0000;
    border-color: #cc0000;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.35);
    transform: translateY(-1px);
}

.video-fallback-banner {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.yt-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.yt-svg-brand {
    width: 24px;
    height: 24px;
}




/* =============================================
   MOBILE ERGONOMICS & RESPONSIVE ADAPTATION (SMARTPHONES & SMALL PORTABLE)
   ============================================= */

/* 1. Global Safe-Area Variables & Dynamic Viewport Insets */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --target-size: 36px;
}

/* 2. Zero Horizontal Overflow & Text Balancing */
body {
    overflow-wrap: anywhere;
    word-break: normal;
}

h1, h2, h3 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

img, video, iframe {
    max-inline-size: 100%;
    block-size: auto;
}

/* 3. Touch Target Standardization (WCAG 2.5.5 / 2.5.8) */
@media (pointer: coarse), (max-width: 600px) {
    :root {
        --target-size: 44px;
    }

    .icon-btn,
    .hamburger-btn,
    .sidebar-toggle-btn,
    .social-bubble {
        min-width: var(--target-size);
        min-height: var(--target-size);
        width: var(--target-size);
        height: var(--target-size);
    }

    .btn {
        min-height: 44px;
        padding: 0.65rem 1.15rem;
    }

    /* Empêche le zoom automatique forcé sur iOS Safari */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    select,
    textarea,
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem !important;
        min-height: 44px;
    }

    /* Puces et tags tactiles */
    .filter-tab,
    .icon-pill,
    .preset-pill {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        padding: 0.35rem 0.85rem;
    }
}

/* 4. Navigation & Header Mobile Optimizations (< 900px & < 600px) */
@media (max-width: 900px) {
    .mobile-drawer {
        width: min(320px, 86vw);
        height: 100dvh;
        max-height: 100dvh;
        padding: 0;
    }

    .mobile-drawer-header {
        padding-top: max(1.25rem, var(--sat));
    }

    .mobile-drawer-footer {
        padding-bottom: max(1.25rem, var(--sab));
    }

    .mobile-drawer-links li a {
        min-height: 48px;
        font-size: 1.05rem;
        padding: 0.85rem 1.5rem;
    }
}

@media (max-width: 600px) {
    /* Navbar compacte */
    .nav-inner {
        padding: 0 0.85rem;
        height: 56px;
        gap: 0.5rem;
    }

    .logo a {
        font-size: 1.05rem;
        gap: 0.4rem;
    }

    .logo a .material-symbols-outlined {
        font-size: 1.3rem;
    }

    .header-actions {
        gap: 0.2rem;
    }

    /* Conteneur principal */
    main {
        padding: 1.25rem 0.75rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    /* Hero section */
    .hero {
        padding: 2.25rem 0.75rem 1.5rem;
        text-align: center;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 1.4rem + 2.5vw, 2.4rem);
        letter-spacing: -0.5px;
    }

    .hero p {
        font-size: 0.98rem;
        margin-bottom: 1.5rem;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 1rem;
    }

    /* Grille de cartes générale */
    .grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .card {
        padding: 1.15rem 1rem;
    }

    /* Search Overlay plein écran sur smartphone */
    .search-overlay {
        padding: 0 !important;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
        height: 100dvh;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }

    .search-input-wrap {
        padding: max(0.75rem, var(--sat)) 1rem 0.75rem;
        min-height: 58px;
    }

    .search-input-wrap input {
        font-size: 1.05rem;
    }

    #search-results {
        flex: 1;
        max-height: none;
        -webkit-overflow-scrolling: touch;
    }

    /* Formulaires de contact et d'info */
    .contact-form {
        padding: 1.25rem 1rem !important;
    }

    .glass-panel {
        padding: 1.25rem 1rem !important;
    }

    /* Video player HD actions sur mobile */
    .video-hd-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.85rem 1rem;
    }

    .video-hd-actions .btn,
    .btn-youtube-red {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .video-fallback-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
    }

    .video-fallback-banner .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Actions de pied d'article tutoriel */
    .article-footer-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
    }

    .article-footer-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    /* Barre de filtres de téléchargement */
    .downloads-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem 1rem !important;
        gap: 0.85rem !important;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.35rem;
        width: 100%;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 40px;
    }

    /* Pied de page mobile */
    .main-footer {
        margin-top: 3.5rem !important;
        padding: 2.5rem 0 max(1.5rem, var(--sab)) !important;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .social-flex {
        justify-content: flex-start;
        gap: 0.65rem;
    }
}

/* 5. Optimisations pour Très Petits Téléphones (< 380px, ex: iPhone 5/SE, Galaxy Fold fermé) */
@media (max-width: 380px) {
    .nav-inner {
        padding: 0 0.5rem;
    }

    .logo a {
        font-size: 0.95rem;
    }

    .logo a span.material-symbols-outlined {
        font-size: 1.15rem;
    }

    .header-actions .icon-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    main {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .card {
        padding: 1rem 0.75rem;
    }

    .preset-card-btn {
        padding: 0.55rem 0.65rem;
    }
}

/* =============================================
   UNIVERSAL LIGHTBOX & SCREENSHOT ZOOM
   ============================================= */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease-out;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox-container {
    position: relative;
    z-index: 1;
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.25rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.lightbox-caption {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
}

.lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lightbox-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.lightbox-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--surface-2);
}
.lightbox-btn.lightbox-close:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.lightbox-zoom-level {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    min-width: 45px;
    text-align: center;
}

.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 1.5rem;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(11, 19, 43, 0.8) 100%);
    user-select: none;
}

.lightbox-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-zoomable {
    cursor: zoom-in !important;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.lightbox-zoomable:hover {
    filter: brightness(1.05);
}

/* =============================================
   FULL-CONTAINER COVERING IMAGES & MEDIA
   ============================================= */
.article-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 480px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    margin-bottom: 2.5rem;
}

.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.tutorial-cover,
.download-cover,
.card-thumb-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
    position: relative;
}

.tutorial-cover img,
.download-cover img,
.card-thumb-container img,
.tutorial-thumb img,
.download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .tutorial-cover img,
.card:hover .download-cover img,
.card:hover .card-thumb-container img {
    transform: scale(1.03);
}

/* Images dans le corps de texte des tutoriels (Quill/Rich-text) */
.rich-text img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
    margin: 1.75rem auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Galerie de captures d'écran */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.screenshot-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screenshot-card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: #000;
}

.screenshot-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.screenshot-card-caption {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    border-top: 1px solid var(--border);
}

/* =============================================
   THREADED COMMENTS & REPLIES STYLING
   ============================================= */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.comment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.comment-card.is-admin-comment {
    border-left: 3px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.05) 0%, var(--surface) 100%);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-admin .material-symbols-outlined { font-size: 0.85rem; }

.comment-date {
    color: var(--muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-body {
    line-height: 1.65;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-reply-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.btn-reply-toggle:hover {
    background: rgba(56, 189, 248, 0.1);
}

.reply-form-wrapper {
    margin-top: 1rem;
    padding: 1.25rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Réponses imbriquées (Threaded tree) */
.comment-replies-list {
    margin-top: 1rem;
    padding-left: clamp(1rem, 3vw, 2.5rem);
    border-left: 2px solid rgba(56, 189, 248, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.reply-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    position: relative;
}

.reply-item::before {
    content: '';
    position: absolute;
    left: -clamp(1rem, 3vw, 2.5rem);
    top: 1.25rem;
    width: clamp(0.75rem, 2.5vw, 2rem);
    height: 2px;
    background: rgba(56, 189, 248, 0.3);
}

.reply-item.is-admin-reply {
    border-left: 3px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0%, var(--surface-2) 100%);
}
