/* Média Metri — Design System dark mode */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --bg:       #0f172a;
    --surface:  #1e293b;
    --surface2: #273549;
    --accent:   #22c55e;
    --accent-h: #16a34a;
    --text:     #f1f5f9;
    --muted:    #94a3b8;
    --border:   #334155;
    --danger:   #ef4444;
    --warning:  #f59e0b;
    --radius:   12px;
    --shadow:   0 4px 24px rgba(0,0,0,.35);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.tagline {
    font-size: .8rem;
    color: var(--muted);
}
.header-nav a {
    font-size: .875rem;
    color: var(--muted);
    padding: .4rem .75rem;
    border-radius: 6px;
    transition: background .2s, color .2s;
}
.header-nav a:hover {
    background: var(--surface2);
    color: var(--text);
    text-decoration: none;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Compteurs animés ───────────────────────────────────────────────────────── */
.counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.counter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    animation: fadeIn .5s ease both;
}
.counter-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    line-height: 1;
    margin-bottom: .5rem;
}
.counter-label {
    font-size: .85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
}

/* ── Tableau de classement ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
thead th {
    background: var(--surface2);
    padding: .75rem 1rem;
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
tbody tr:hover { background: var(--surface2); }
tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
}
.rank {
    font-weight: 700;
    color: var(--muted);
    width: 40px;
}
.rank-1 { color: #fbbf24; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #cd7c3a; }
.media-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}
.media-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--surface2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
}
.evolution-up   { color: var(--accent); }
.evolution-down { color: var(--danger); }
.evolution-eq   { color: var(--muted); }

/* ── Graphique ──────────────────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 280px; }

/* ── Badge certifié ─────────────────────────────────────────────────────────── */
.badge-certified {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    color: var(--accent);
    border-radius: 9999px;
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}
.badge-certified::before {
    content: "✓";
    font-weight: 900;
}

/* ── Formulaires ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .4rem;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .7rem 1rem;
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .2s;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.form-group textarea { min-height: 100px; resize: vertical; }

/* ── Boutons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    font-family: inherit;
}
.btn-primary {
    background: var(--accent);
    color: #0f172a;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { opacity: .85; }
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: var(--accent); }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: var(--danger); }
.alert-info    { background: rgba(148,163,184,.1);  border: 1px solid var(--border); color: var(--muted); }

/* ── Code block ─────────────────────────────────────────────────────────────── */
.code-block {
    background: #0a0f1e;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    color: #86efac;
    overflow-x: auto;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: .85rem;
    margin-top: 3rem;
}
.footer a { color: var(--accent); }

/* ── Tabs (admin) ───────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.tab {
    padding: .6rem 1.2rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid transparent;
    border-bottom: none;
    background: none;
    font-family: inherit;
    transition: all .2s;
}
.tab.active, .tab:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Médias page fiche ──────────────────────────────────────────────────────── */
.media-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.media-logo-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--border);
}
.media-info h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.media-info p  { color: var(--muted); font-size: .9rem; }

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; height: auto; padding: 1rem; }
    .counters { grid-template-columns: 1fr 1fr; }
    .container { padding: 1rem; }
    .media-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .counters { grid-template-columns: 1fr; }
    .counter-value { font-size: 2rem; }
}

/* ── Plan badge ─────────────────────────────────────────────────────────────── */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 20px;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Teaser / feature locked ────────────────────────────────────────────────── */
.feature-locked {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}
.feature-content {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    opacity: .5;
}
.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .7);
    backdrop-filter: blur(2px);
    border-radius: var(--radius);
}
.lock-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    padding: 1.25rem;
}
.lock-icon { font-size: 1.8rem; }
.lock-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.btn-upgrade {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    padding: .4rem 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: .8rem;
}

/* ── Stat cards avec teaser ─────────────────────────────────────────────────── */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.stat-card--locked { opacity: .8; }
.stat-value.blurred {
    filter: blur(5px);
    cursor: default;
    user-select: none;
}
.stat-label { font-size: .75rem; color: var(--muted); }
.upgrade-hint {
    font-size: .7rem;
    color: var(--warning);
    text-decoration: none;
    font-weight: 600;
}
.upgrade-hint:hover { text-decoration: underline; }

/* ── Upgrade gate (plein écran) ─────────────────────────────────────────────── */
.upgrade-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}
.upgrade-gate__inner {
    max-width: 440px;
    width: 100%;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
}
.upgrade-gate__icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.upgrade-gate__title { font-size: 1.2rem; margin-bottom: .5rem; }
.upgrade-gate__text  { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.upgrade-gate__btn   { margin-bottom: 1rem; }
.upgrade-gate__back  { font-size: .8rem; }
.upgrade-gate__back a { color: var(--muted); }

/* ── Upgrade banner (bandeau discret) ──────────────────────────────────────── */
.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-size: .8rem;
    color: var(--muted);
    background: rgba(245, 158, 11, .06);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 8px;
    padding: .6rem 1rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.upgrade-banner__btn {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, .3);
    padding: .25rem .75rem;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.upgrade-banner__btn:hover { background: rgba(245, 158, 11, .25); }

/* ── Blurred numbers (index.php public) ─────────────────────────────────────── */
.blur-num {
    filter: blur(5px);
    cursor: default;
    transition: filter .25s;
    position: relative;
    display: inline-block;
}
.blur-num:hover { filter: blur(0); }
.blur-num::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .72rem;
    padding: .3rem .6rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.blur-num:hover::after { opacity: 1; }

/* ── Progress bar relative ──────────────────────────────────────────────────── */
.rel-bar-wrap { background: rgba(255,255,255,.05); border-radius: 4px; height: 4px; overflow: hidden; margin-top: 4px; }
.rel-bar      { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #3b82f6); transition: width .6s; }

/* ── Tabs (admin multi-profils) ─────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.5rem; }
.tab  {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 8px;
    padding: .45rem .9rem;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.tab:hover, .tab.active, .tab[data-tab].active-tab {
    background: rgba(34, 197, 94, .1);
    border-color: var(--accent);
    color: var(--accent);
}

