/* ============================================
   ADMIN PANEL STYLES
   File: admin.css
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    padding: 20px;
    min-height: 100vh;
}

/* ---------- HEADER ---------- */
header {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left h1 {
    font-size: 24px;
    color: #1a1a1a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#admin-info {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* ---------- COMMON BUTTON STYLES ---------- */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4A90D9;
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: #357ABD;
}

.btn-success {
    background: #28a745;
    color: white;
}
.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}
.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}
.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ---------- STATISTICS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
}

.stat-label {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

/* ---------- SECTIONS ---------- */
.admin-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 18px;
    color: #1a1a1a;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #4A90D9;
}

/* ---------- TABLES ---------- */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f8f9fa;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

tr:hover {
    background: #f8f9fa;
}

/* Loading status text */
.loading-text {
    text-align: center;
    color: #888;
    padding: 40px !important;
}

/* ---------- ROLE BADGES ---------- */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-guest {
    background: #e9ecef;
    color: #495057;
}

.role-moderator {
    background: #cce5ff;
    color: #004085;
}

.role-admin {
    background: #f8d7da;
    color: #721c24;
}

/* ---------- POST STATUS BADGES ---------- */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* ---------- ACTION BUTTONS IN TABLES ---------- */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons span {
    color: #999;
    font-size: 12px;
}

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

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 460px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #1a1a1a;
}

.confirm-modal {
    width: 400px;
}

.confirm-modal p {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4A90D9;
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- MESSAGES ---------- */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: none;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

    header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .header-right {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

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

    .modal-content {
        padding: 24px;
        margin: 12px;
    }

    table {
        font-size: 12px;
    }

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

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

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}