/* ============================================
   Getcodexa Admin Panel - Custom Styles
   Primary Color: #009FB1
   ============================================ */

:root {
    --primary: #009FB1;
    --primary-dark: #007A8A;
    --primary-light: #00C4D9;
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d2e;
    --sidebar-text: #a4a6b3;
    --sidebar-active: #009FB1;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* ============================================
   Content Loading Spinner
   ============================================ */

.content-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 60px 20px;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    background: linear-gradient(135deg, #1a1d2e 0%, #2d3154 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    text-align: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo i {
    font-size: 32px;
    color: #fff;
}

.login-header h2 {
    font-weight: 700;
    color: #1a1d2e;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
}

.login-card .input-group-text {
    background: #f8f9fa;
    border-right: none;
    color: var(--primary);
}

.login-card .form-control {
    border-left: none;
    padding: 10px 14px;
}

.login-card .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.login-card .input-group:focus-within .input-group-text {
    border-color: var(--primary);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 12px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 159, 177, 0.4);
}

.login-footer {
    font-size: 12px;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sidebar-brand i {
    color: var(--primary);
    font-size: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

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

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--sidebar-text);
}

.admin-info i {
    font-size: 20px;
    color: var(--primary);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    font-size: 22px;
    color: #555;
    text-decoration: none;
    padding: 4px 8px;
    display: none;
}

.page-title {
    font-weight: 600;
    color: #333;
    font-size: 18px;
}

.content-wrapper {
    padding: 24px;
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card-info {
    flex: 1;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1d2e;
    margin-bottom: 2px;
}

.stat-card-title {
    font-size: 13px;
    color: #888;
    margin-bottom: 0;
}

/* ============================================
   General Card Styles
   ============================================ */
.card-header h6 {
    font-weight: 600;
    color: #333;
}

/* ============================================
   Button Overrides
   ============================================ */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   Sidebar Section Title
   ============================================ */
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.3);
    padding: 16px 16px 8px;
    list-style: none;
}

.sidebar-nav .nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Users Table
   ============================================ */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 2px solid #eee;
    padding: 12px 16px;
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8fbfc;
}

/* ============================================
   Badges
   ============================================ */
.badge-type {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
}

.badge-self-paced {
    background-color: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.badge-classroom {
    background-color: rgba(0, 159, 177, 0.1);
    color: #009FB1;
}

.badge-classroom-type {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
}

.badge-instructor {
    background-color: rgba(253, 126, 20, 0.12);
    color: #e06b10;
}

.badge-organization {
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.badge-university {
    background-color: rgba(111, 66, 193, 0.12);
    color: #6f42c1;
}

/* ============================================
   Streak Badges
   ============================================ */
.streak-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.streak-high {
    background-color: rgba(255, 107, 107, 0.1);
    color: #e03131;
}

.streak-medium {
    background-color: rgba(253, 126, 20, 0.1);
    color: #e06b10;
}

.streak-low {
    background-color: rgba(173, 181, 189, 0.15);
    color: #6c757d;
}

/* ============================================
   Profile Page
   ============================================ */
.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.streak-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.streak-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

.streak-circle i {
    font-size: 16px;
}

.streak-circle span {
    font-size: 20px;
}

.detail-item {
    margin-bottom: 4px;
}

.detail-item label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 4px;
    display: block;
}

.detail-item p {
    font-size: 15px;
    color: #333;
    margin-bottom: 0;
    font-weight: 500;
}

.detail-item code {
    background: #f4f6f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--primary-dark);
}

/* ============================================
   Filter Form
   ============================================ */
.form-select:focus,
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 159, 177, 0.15);
}

/* ============================================
   Classroom Codes
   ============================================ */
.code-display {
    background: #f0f7f8;
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border: 1px solid rgba(0, 159, 177, 0.15);
}

.code-display-sm {
    background: #f0f7f8;
    color: var(--primary-dark);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 159, 177, 0.15);
}

.code-display-large {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.badge-status {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-used {
    background-color: rgba(40, 167, 69, 0.12);
    color: #28A745;
}

.badge-available {
    background-color: rgba(255, 193, 7, 0.12);
    color: #d4a006;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================
   Feedback
   ============================================ */
.feedback-yes {
    color: #28A745;
    font-size: 18px;
}

.feedback-no {
    color: #dc3545;
    font-size: 18px;
}

/* ============================================
   Scores
   ============================================ */
.score-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

.score-badge-sm {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.score-high {
    background-color: rgba(40, 167, 69, 0.12);
    color: #28A745;
}

.score-medium {
    background-color: rgba(253, 126, 20, 0.12);
    color: #e06b10;
}

.score-low {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.badge-reward {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: rgba(255, 193, 7, 0.15);
    color: #b38600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.accordion-button:not(.collapsed) {
    background-color: #f8fbfc;
    color: #333;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 159, 177, 0.15);
}

/* ============================================
   Rank Badges
   ============================================ */
.rank-badge {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.rank-gold {
    color: #FFD700;
    background-color: rgba(255, 215, 0, 0.12);
}

.rank-silver {
    color: #A0A0A0;
    background-color: rgba(160, 160, 160, 0.12);
}

.rank-bronze {
    color: #CD7F32;
    background-color: rgba(205, 127, 50, 0.12);
}

/* ============================================
   User Badges
   ============================================ */
.user-badge-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-badge-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.user-badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-badge-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}
