/* ============================================
   CANARDOVERLAY - Admin Dashboard Styles
   ============================================ */

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

:root {
    --primary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --ulule: #98cc00;     /* Vert Ulule OFFICIEL — même vert que ticker/badges inline (l'ancien #5cb85c ne correspondait à rien) */
    --twitch: #9146ff;    /* Violet — abonnés Twitch */
    --mahalo: #fca5a5;    /* Rouge clair — abonnés Mahalo (site web + magazine papier) */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   Header
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    display: flex;
    flex-wrap: wrap; /* petits écrans : les onglets passent à la ligne au lieu de déborder */
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-card);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* ============================================
   Section
   ============================================ */

.section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    overflow-x: auto; /* tables larges : scroll dans la section, jamais la page entière */
}

.section h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Cards (kermesse.html / chat-overlay.html) — même traitement visuel que .section.
   Ces pages utilisaient .card/.main sans qu'aucune règle n'existe : blocs sans fond. */
.card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 1.25rem;
}

/* ============================================
   Status Grid
   ============================================ */

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.375rem;
}

.status-label {
    font-weight: 500;
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background: var(--success);
    color: white;
}

.status-error {
    background: var(--error);
    color: white;
}

.status-info {
    background: var(--primary);
    color: white;
}

/* ============================================
   Actions Grid
   ============================================ */

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ============================================
   Users Table
   ============================================ */

.filters {
    display: flex;
    flex-wrap: wrap; /* petits écrans : recherche + selects empilables */
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: var(--bg-card);
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.users-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.users-table tr:hover {
    background: var(--bg-card);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-ulule {
    background: var(--ulule);
    color: #1f2d00; /* texte sombre : le blanc était illisible sur le vert clair */
}

.badge-twitch {
    background: var(--twitch);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-mahalo {
    background: var(--mahalo);
    color: #7f1d1d;
}

.user-amount, .user-pseudo {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
}

.loading, .empty, .error {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.error {
    color: var(--error);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--primary);
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
}

.btn-secondary {
    background: var(--bg-card);
}

.btn-danger {
    background: var(--error);
}

/* ============================================
   Modal
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-input {
    width: 100%;
    padding: 0.75rem;
    margin: 1rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

/* ============================================
   Color Picker (overlay admin)
   ============================================ */
input[type="color"] {
    width: 36px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--bg-card);
    cursor: pointer;
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}
