/* /assets/css/admin.css */

.admin-page {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - 80px);
    margin: -2rem;
}

/* ═══════════ SIDEBAR ═══════════ */
.admin-sidebar {
    background: rgba(19, 24, 54, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
}

.admin-logo-icon { font-size: 1.75rem; }

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.15s;
    cursor: pointer;
}

.admin-nav-item:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.admin-nav-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(6, 182, 212, 0.15));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.4);
}

.admin-nav-icon { font-size: 1.25rem; }

.admin-sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══════════ MAIN ═══════════ */
.admin-main {
    padding: 2rem 2.5rem 4rem;
    min-width: 0;
    animation: fadeIn 0.3s ease;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.admin-header-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.admin-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ═══════════ DASHBOARD ═══════════ */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(20, 24, 54, 0.85), rgba(13, 17, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    transition: transform 0.2s;
}

.admin-stat-card:hover { transform: translateY(-3px); }

.admin-stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.65rem;
}

.admin-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.35rem;
}

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

/* ═══════════ TABLES ═══════════ */
.admin-table-wrap {
    background: rgba(19, 24, 54, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.admin-table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ═══════════ BADGES ═══════════ */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-badge-green  { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.admin-badge-red    { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.admin-badge-amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.admin-badge-purple { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.admin-badge-cyan   { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

/* ═══════════ MODAL ADMIN ═══════════ */
.admin-modal { z-index: 2000; }

.admin-modal-content {
    max-width: 720px;
    width: 95%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2rem;
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-modal-header h2 {
    font-size: 1.35rem;
    margin: 0;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-form-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══════════ IMAGE UPLOAD ═══════════ */
.admin-uploader {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-uploader:hover,
.admin-uploader.dragover {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
}

.admin-uploader-icon {
    font-size: 2rem;
    opacity: 0.6;
}

.admin-uploader-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.admin-uploader-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-uploader-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.admin-uploader-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.admin-uploader-remove:hover { transform: scale(1.1); }

/* ═══════════ ANSWERS EDITOR ═══════════ */
.admin-answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-answer-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.15s;
}

.admin-answer-row.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.admin-answer-letter {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    color: var(--accent-cyan);
}

.admin-answer-row.correct .admin-answer-letter {
    background: #10b981;
    color: #fff;
}

.admin-answer-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.admin-answer-input:focus {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
}

.admin-answer-correct-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-answer-correct-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}

.admin-answer-row.correct .admin-answer-correct-btn {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* ═══════════ QUESTIONS LIST ═══════════ */
.admin-questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-question-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: all 0.2s;
}

.admin-question-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(124, 58, 237, 0.35);
}

.admin-question-thumb {
    width: 100px;
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.admin-question-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-question-body {
    min-width: 0;
}

.admin-question-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.admin-question-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-question-actions {
    display: flex;
    gap: 0.5rem;
}

/* ═══════════ EMPTY ═══════════ */
.admin-empty {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
    .admin-page {
        grid-template-columns: 1fr;
        margin: -1rem;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 0.75rem;
    }

    .admin-logo, .admin-sidebar-footer { display: none; }

    .admin-nav {
        flex-direction: row;
        gap: 0.5rem;
    }

    .admin-nav-item {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .admin-main {
        padding: 1.5rem 1rem 3rem;
    }

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

    .admin-question-card {
        grid-template-columns: 70px 1fr;
    }

    .admin-question-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}