/**
 * assets/css/dashboard.css
 * Styles for the admin dashboard (register page).
 * Uses the same root variables as the main site.
 */

:root {
    --primary: #00C853;
    --primary-dark: #009624;
    --primary-light: #5EFC82;
    --secondary: #2962FF;
    --accent: #FF6B35;
    --dark: #1a1f2e;
    --darker: #121625;
    --gray: #8a94a6;
    --light-gray: #2a3042;
    --white: #FFFFFF;
    --shadow: 0 10px 40px rgba(0,0,0,.15);
    --transition: all .2s ease;
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--darker);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
}

.dashboard-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px 40px;
}

/* ---------- HEADER ---------- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-icon {
    color: var(--primary);
    font-size: 1.6rem;
}

.brand-highlight {
    color: var(--primary);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    padding: 10px 18px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray);
    border: 1px solid rgba(255,255,255,0.06);
    transition: var(--transition);
    text-decoration: none;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.12);
    color: var(--white);
    transform: translateY(-2px);
}

/* ---------- STATS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: rgba(0,200,83,0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0,200,83,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    flex-shrink: 0;
}
.stat-male .stat-icon {
    background: rgba(41,98,255,0.12);
    color: var(--secondary);
}
.stat-female .stat-icon {
    background: rgba(255,107,53,0.12);
    color: var(--accent);
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 500;
}

/* ---------- ACTION BAR ---------- */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--white);
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0,200,83,0.2);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,200,83,0.3);
}
.btn-ghost {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-3px);
}
.btn-danger {
    background: var(--accent);
    color: var(--white);
}
.btn-danger:hover {
    background: #e55a2b;
    transform: translateY(-3px);
}

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-toggle {
    cursor: pointer;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: var(--shadow);
    padding: 8px 0;
    z-index: 10;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}
.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}
.dropdown-item i {
    width: 20px;
}

/* ---------- SEARCH ---------- */
.search-section {
    margin-bottom: 24px;
}
.search-wrapper {
    position: relative;
    max-width: 480px;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}
.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 60px;
    color: var(--white);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,200,83,0.1);
}
.search-input::placeholder {
    color: var(--gray);
}

/* ---------- TABLE ---------- */
.table-section {
    background: var(--dark);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}
.table-container {
    overflow-x: auto;
    padding: 0 4px;
}
.register-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.register-table thead {
    background: rgba(255,255,255,0.03);
}
.register-table th {
    text-align: left;
    padding: 16px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.register-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
.register-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}
.register-table .actions-col {
    text-align: right;
    width: 150px;
}
.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--white);
}
.action-btn.view-btn:hover { color: var(--secondary); }
.action-btn.edit-btn:hover { color: var(--primary); }
.action-btn.delete-btn:hover { color: var(--accent); }

.empty-row {
    text-align: center;
    color: var(--gray);
    padding: 40px 0 !important;
}

/* ---------- MODALS ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    padding: 32px;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}
.view-modal, .delete-modal {
    max-width: 480px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}
.modal-close:hover {
    color: var(--white);
    transform: rotate(90deg);
}

/* Form inside modal */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--gray);
}
.required { color: var(--accent); }
.optional { color: var(--gray); font-weight: 400; }
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--darker);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: var(--white);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,200,83,0.1);
}
.form-group select option { background: var(--dark); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}
.form-actions .btn {
    min-width: 100px;
}

/* View modal */
.view-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
.view-details .detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.view-details .detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
}
.view-details .detail-value {
    font-weight: 500;
    font-size: 1rem;
}

/* Delete modal */
.delete-message {
    text-align: center;
    padding: 12px 0;
}
.delete-warning {
    color: var(--accent);
    font-weight: 500;
    margin-top: 8px;
}

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 10000;
    max-width: 400px;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success {
    border-left: 4px solid var(--primary);
}
.toast.error {
    border-left: 4px solid var(--accent);
}
#toastMessage {
    flex: 1;
    font-weight: 500;
}
#toastClose {
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.2rem;
    cursor: pointer;
}
#toastClose:hover {
    color: var(--white);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stat-card:last-child {
        grid-column: span 2;
    }
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .action-left, .action-right {
        width: 100%;
    }
    .action-right .dropdown {
        width: 100%;
    }
    .action-right .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
    .search-wrapper {
        max-width: 100%;
    }
    .register-table th, .register-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .actions-cell {
        gap: 4px;
    }
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    .view-details {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card:last-child {
        grid-column: span 1;
    }
    .dashboard-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    .btn-logout {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .brand {
        font-size: 1.1rem;
    }
}