/* =====================================================
   Digital Rewards CSS
   Avatar Frames, Leaderboard Flairs, Dark Mode, etc.
   ===================================================== */

/* === Student Title Badge === */
.student-title-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.3px;
}

/* === Avatar Frame: Crown pseudo-element === */
.avatar-frame-crown {
    position: relative;
}
.avatar-frame-crown::before {
    content: '\eb45';
    font-family: 'tabler-icons';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #F4B400;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* === Leaderboard Flairs === */
.flair-gold-glow {
    background: rgba(244,180,0,0.1) !important;
    box-shadow: inset 0 0 10px rgba(244,180,0,0.2);
    border-left: 3px solid #F4B400 !important;
}
.flair-rainbow {
    border-left: 4px solid transparent !important;
    border-image: linear-gradient(180deg, #ff0000, #ff8800, #ffff00, #00cc00, #0066ff, #9900cc) 1;
    background: rgba(233,30,99,0.04) !important;
}
.flair-star-bg {
    background: linear-gradient(135deg, rgba(255,248,225,0.6) 0%, rgba(255,152,0,0.08) 100%) !important;
    border-left: 3px solid #FF9800 !important;
}
.flair-diamond {
    background: linear-gradient(135deg, rgba(185,242,255,0.15), rgba(185,242,255,0.05)) !important;
    box-shadow: inset 0 0 8px rgba(185,242,255,0.3);
    border-left: 3px solid #B9F2FF !important;
}

/* === XP Boost Indicator === */
.boost-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FF5722, #FF9800);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    animation: boost-pulse 2s ease-in-out infinite;
}
@keyframes boost-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === Badge Showcase Widget === */
.showcase-badges-widget {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.showcase-badge-item {
    text-align: center;
    width: 80px;
}
.showcase-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 1.8rem;
    background: rgba(244,180,0,0.1);
}
.showcase-badge-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

/* === Digital Reward Card Indicators === */
.reward-owned-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    z-index: 2;
}
.reward-card-digital {
    position: relative;
}

/* === Dark Mode Toggle in Dropdown === */
.dark-mode-toggle-item {
    cursor: default;
}
.dark-mode-toggle-item .form-check-input {
    cursor: pointer;
}

/* =====================================================
   DARK MODE THEME
   Applied when html has data-theme="dark"
   ===================================================== */
[data-theme="dark"] body,
[data-theme="dark"] .main-wrapper {
    background: #1a1a2e !important;
    color: #d0d0e0;
}

[data-theme="dark"] .header {
    background: #16213e !important;
    border-bottom-color: #2a2a4a !important;
}

[data-theme="dark"] .sidebar {
    background: #0f0f23 !important;
}
[data-theme="dark"] .sidebar .nav-link,
[data-theme="dark"] .sidebar a {
    color: #b0b0d0 !important;
}
[data-theme="dark"] .sidebar .nav-link:hover,
[data-theme="dark"] .sidebar a:hover {
    color: #fff !important;
}
[data-theme="dark"] .sidebar .sidebar-menu .menu-title {
    color: #6a6a8a !important;
}

[data-theme="dark"] .card {
    background: #16213e !important;
    border-color: #2a2a4a !important;
    color: #d0d0e0;
}
[data-theme="dark"] .stat-card {
    background: #1a1a3e !important;
    color: #fff;
}
[data-theme="dark"] .chart-container {
    background: #16213e !important;
    color: #d0d0e0;
}

[data-theme="dark"] .table {
    color: #d0d0e0;
}
[data-theme="dark"] .table thead th {
    color: #b0b0c0;
    border-bottom-color: #2a2a4a;
}
[data-theme="dark"] .table td {
    border-bottom-color: #2a2a4a;
}
[data-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

[data-theme="dark"] .text-dark {
    color: #e0e0e0 !important;
}
[data-theme="dark"] .text-muted {
    color: #8888aa !important;
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: #e0e0f0;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #1a1a3e;
    border-color: #2a2a4a;
    color: #e0e0e0;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: #1a1a3e;
    border-color: #4a4a6a;
    color: #e0e0e0;
}

[data-theme="dark"] .dropdown-menu {
    background: #16213e;
    border-color: #2a2a4a;
}
[data-theme="dark"] .dropdown-item {
    color: #d0d0e0;
}
[data-theme="dark"] .dropdown-item:hover {
    background: #1a1a3e;
    color: #fff;
}

[data-theme="dark"] .modal-content {
    background: #16213e;
    border-color: #2a2a4a;
    color: #d0d0e0;
}
[data-theme="dark"] .modal-header {
    border-bottom-color: #2a2a4a;
}
[data-theme="dark"] .modal-footer {
    border-top-color: #2a2a4a;
}
[data-theme="dark"] .btn-close {
    filter: invert(1);
}

[data-theme="dark"] .badge-card {
    background: #1a1a3e !important;
    border-color: #2a2a4a !important;
}
[data-theme="dark"] .badge-name {
    color: #d0d0e0 !important;
}
[data-theme="dark"] .badge-desc {
    color: #8888aa !important;
}

[data-theme="dark"] .welcome-banner {
    opacity: 0.95;
}

[data-theme="dark"] .page-wrapper {
    background: #1a1a2e !important;
}
[data-theme="dark"] .content {
    background: #1a1a2e !important;
}
[data-theme="dark"] .breadcrumb-item a {
    color: #8888bb;
}

[data-theme="dark"] hr {
    border-color: #2a2a4a;
}

[data-theme="dark"] .alert-exam {
    background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .border {
    border-color: #2a2a4a !important;
}
[data-theme="dark"] .border-bottom {
    border-bottom-color: #2a2a4a !important;
}

[data-theme="dark"] .reward-card {
    background: #1a1a3e !important;
    border-color: #2a2a4a !important;
}

[data-theme="dark"] .stat-card-ach {
    opacity: 0.95;
}

[data-theme="dark"] .showcase-badge-name {
    color: #d0d0e0;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #b0b0c0 !important;
}
