/* ============ Admin Layout ============ */
/* أنماط خاصة بلوحة تحكم المشرفين */

.admin-main {
    padding-top: 16px;
    padding-bottom: 24px;
}

.admin-header h1 {
    margin: 0 0 4px;
    font-size: 1.8rem;
}

.admin-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

/* ============ Grid Layout ============ */
.admin-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 700px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

/* ============ Cards ============ */
.admin-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 14px 16px 16px;
    box-shadow: var(--shadow);
}

.admin-card h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--text);
}

/* Fix h1 in admin */
.admin-main h1 {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text);
}

.admin-list-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ============ Bank Panel ============ */
.new-bank-panel,
.admin-new-bank {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

/* ============ Form Styling ============ */
.admin-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    padding: 9px 10px;
    font-size: 0.95rem;
    font-family: inherit;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    border-color: var(--brand);
    outline: none;
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

/* ============ Messages ============ */
.admin-message {
    font-size: 0.9rem;
    margin: 0;
}

.admin-message.success {
    color: var(--accent);
}

.admin-message.error {
    color: var(--danger);
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

.error-msg.success {
    color: var(--accent);
}

/* ============ Questions List ============ */
.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    background: var(--bg);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.admin-filters label {
    font-weight: bold;
    color: var(--text);
    margin-bottom: 4px;
}

.admin-filters select {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    padding: 6px 8px;
    font-size: 0.9rem;
}

.admin-questions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-questions>li {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.admin-question-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.admin-question-text {
    font-weight: 600;
    color: var(--text);
}

.admin-question-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

/* ============ Badges ============ */
.admin-badge,
.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: var(--border);
    color: var(--text);
}

/* ============ Small Buttons ============ */
.btn-small {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

.btn-small.danger,
.delete-btn {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.btn-small.danger:hover,
.delete-btn:hover {
    background: #c82333;
    border-color: #c82333;
}

.btn-small:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.edit-btn {
    border-color: var(--brand);
    background: var(--brand);
    color: white;
}

.edit-btn:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

/* ============ Empty State ============ */
.admin-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 24px;
}

/* ============ Responsive ============ */
@media (max-width: 800px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-form-row {
        grid-template-columns: 1fr;
    }
}

/* ============ Modal Styles ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-description {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 0.95rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.transfer-btn {
    background-color: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
}

.transfer-btn:hover {
    background-color: #2563eb !important;
}

/* ============ Trash Bin Styles ============ */
.trash-list {
    max-height: 400px;
    overflow-y: auto;
}

.trash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
}

.trash-item-info h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: var(--text);
}

.trash-meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.trash-deleted-by {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.7;
}

.trash-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trash-item-actions .btn-small {
    font-size: 0.8rem;
    padding: 6px 10px;
    white-space: nowrap;
}

.restore-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border: none !important;
}

.restore-btn:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
}

.permanent-delete-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid #ef4444 !important;
}

.permanent-delete-btn:hover {
    background: #ef4444 !important;
    color: white !important;
}

.empty-text,
.loading-text {
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

.error-text {
    text-align: center;
    color: #ef4444;
    padding: 20px;
}

/* Google Button Styles */
.google-btn {
    background: white;
    color: #333;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ============ Tabs Navigation ============ */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.admin-tab {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg);
    border: none;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.admin-tab:not(:last-child) {
    border-left: 1px solid var(--border);
}

.admin-tab.active {
    background: var(--brand);
    color: white;
}

.admin-tab:hover:not(.active) {
    background: var(--border);
    color: var(--text);
}

/* ============ Hidden Utility ============ */
.hidden {
    display: none !important;
}

/* ============ Exams List ============ */
.exam-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.exam-card:hover {
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.exam-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exam-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.exam-count {
    font-size: 0.85rem;
    color: var(--muted);
}

.exam-actions {
    display: flex;
    gap: 8px;
}

/* ============ Exam Questions ============ */
.exam-questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.exam-questions-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

.exam-question-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.question-number {
    color: var(--brand);
    font-weight: 700;
    margin-left: 6px;
}

.correct-option {
    color: var(--accent);
    font-weight: 600;
}

.question-explanation {
    font-size: 0.88rem;
    color: var(--muted);
    background: rgba(var(--brand-rgb), 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.text-center {
    text-align: center;
    padding: 20px;
    color: var(--muted);
}