@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* === Custom Properties === */
:root {
    --bg: #f8f9fb;
    --surface: #ffffff;
    --surface-alt: #f1f3f5;
    --border: #e2e5e9;
    --border-light: #eef0f2;
    --text: #1a1d21;
    --text-secondary: #5f6672;
    --text-muted: #8b929e;
    --accent: #4f6ef7;
    --accent-hover: #3b5ce4;
    --accent-light: #eef1fe;
    --danger: #e5484d;
    --danger-hover: #d13438;
    --danger-light: #fef0f0;
    --success: #30a46c;
    --success-light: #e9f9f0;
    --warning: #f5a623;
    --warning-light: #fef8ec;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === Body === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    padding: 32px 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Container === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid var(--border-light);
}

/* === Header === */
header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.header-top {
    position: relative;
    text-align: center;
}

.header-auth {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-user-link {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
}

.header-user-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 0.82em !important;
}

header h1 {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95em;
    font-weight: 400;
}

/* === Search Box === */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.search-box input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    font-family: inherit;
    transition: background var(--transition), transform var(--transition);
}

.search-box button:hover {
    background: var(--accent-hover);
}

.search-box button:active {
    transform: scale(0.98);
}

.search-box button:last-child {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.search-box button:last-child:hover {
    background: var(--surface-alt);
    border-color: #ccc;
}

/* === Stats === */
.stats {
    background: var(--accent-light);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stats strong {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.15em;
}

/* === Table === */
.blacklist-table {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

thead {
    background: var(--surface-alt);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    font-size: 0.92em;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--surface-alt);
}

.pseudo {
    font-weight: 600;
    color: var(--text);
}

.pseudo-compte {
    color: var(--text-secondary);
}

.serveur {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85em;
}

.raison {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.preuve {
    font-size: 0.85em;
    color: var(--text-muted);
}

.nb-signalements {
    font-weight: 700;
    color: var(--danger);
    text-align: center;
    background: var(--danger-light);
    border-radius: 20px;
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.85em;
}

.date {
    color: var(--text-muted);
    font-size: 0.85em;
}

.no-data {
    text-align: center !important;
    color: var(--text-muted);
    padding: 48px 20px !important;
    font-size: 0.95em;
}

/* === Login Box === */
.login-box {
    max-width: 400px;
    margin: 40px auto;
    padding: 32px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* === Forms === */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.88em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.93em;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

/* === Buttons === */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-edit {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    font-family: inherit;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-alt);
    border-color: #ccc;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    padding: 7px 14px;
    font-size: 0.82em;
}

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

.btn-danger:active {
    transform: scale(0.97);
}

.btn-edit {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 7px 14px;
    font-size: 0.82em;
    margin-right: 4px;
}

.btn-edit:hover {
    background: var(--accent-light);
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* === Messages === */
.success-message {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.9em;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(48, 164, 108, 0.2);
}

.error-message {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.9em;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(229, 72, 77, 0.2);
}

/* === Sections === */
.add-section,
.list-section {
    margin-bottom: 36px;
}

.add-section h2,
.list-section h2 {
    color: var(--text);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* === Info Section === */
.info-section {
    background: var(--surface-alt);
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 28px;
}

.info-section h3 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 0.95em;
    font-weight: 600;
}

.info-section p {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.warning-text {
    color: var(--warning);
    font-weight: 600;
    font-size: 0.88em;
    margin-top: 8px;
}

/* === Footer === */
footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85em;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* === Search Prompt === */
.search-prompt {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 1.05em;
}

/* === Role Badges === */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid rgba(79, 110, 247, 0.3);
}

.role-user {
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

/* === Report CTA === */
.report-cta {
    text-align: center;
    padding: 24px;
    background: var(--accent-light);
    border: 1px solid rgba(79, 110, 247, 0.2);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.report-cta p {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}

.report-cta .btn-primary {
    padding: 12px 28px;
    font-size: 0.95em;
}

.report-cta-user {
    display: block;
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.report-cta-user a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.report-cta-user a:hover {
    text-decoration: underline;
}

/* === User Nav === */
.user-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.user-nav strong {
    color: var(--accent);
}

/* === Responsive === */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 20px;
        border-radius: 12px;
    }

    header h1 {
        font-size: 1.35em;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .search-box {
        flex-direction: column;
        padding: 12px;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 8px;
    }

    .admin-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .login-box {
        margin: 20px auto;
        padding: 20px;
    }
}
