/* Dark Theme Shared Styles - Consolidated CSS */

/* ===========================================
   SIDEBAR AND HEADER STYLES
   =========================================== */
.user-sidebar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.user-sidebar .site-logo {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 1rem !important;
}

.user-sidebar .sidebar-menu {
    padding: 1rem 0 !important;
}

.user-sidebar .sidebar-menu > li > a {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    border-radius: 0.5rem !important;
    margin: 0.25rem 1rem !important;
}

.user-sidebar .sidebar-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transform: translateX(5px) !important;
}

.user-sidebar .sidebar-menu > li.active > a {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3) !important;
}

.user-sidebar .sidebar-menu > li > a i {
    margin-right: 0.75rem !important;
    width: 20px !important;
    text-align: center !important;
}

/* Menu Divider Styles */
.user-sidebar .sidebar-menu > li.menu-divider {
    margin: 1.25rem 1rem 0.75rem 1rem !important;
    padding: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    list-style: none !important;
}

.user-sidebar .sidebar-menu > li.menu-divider:first-child {
    margin-top: 0.5rem !important;
}

.user-sidebar .sidebar-menu > li.menu-divider .menu-divider-text {
    display: block !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0.5rem 0.75rem 0.5rem 0.75rem !important;
    margin-top: -0.5rem !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    width: fit-content !important;
    border-radius: 4px !important;
}

.user-sidebar .sidebar-menu > li.menu-divider-empty {
    margin: 0.5rem 1rem !important;
    border-top: none !important;
}

.user-sidebar .submenu {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 0.5rem !important;
    margin: 0.5rem 1rem !important;
    margin-top: 0.25rem !important;
    padding: 0.5rem 0 !important;
    display: none !important;
    overflow: hidden !important;
    list-style: none !important;
}

.user-sidebar .sidebar-menu > li.has_submenu:not(.open) > .submenu {
    display: none !important;
}

.user-sidebar .sidebar-menu > li.has_submenu.open > .submenu {
    display: block !important;
}

.user-sidebar .sidebar-menu > li.has_submenu {
    position: relative !important;
}

.user-sidebar .sidebar-menu > li.has_submenu > a.submenu-toggle {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    gap: 0.5rem !important;
}

.user-sidebar .sidebar-menu > li.has_submenu > a.submenu-toggle span {
    flex: 1 !important;
    margin-left: 0.75rem !important;
    margin-right: auto !important;
    min-width: 0 !important;
}

.user-sidebar .sidebar-menu > li.menu-category > a.submenu-toggle {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0.75rem 1.5rem !important;
    margin: 1.25rem 1rem 0.5rem 1rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-top: 1rem !important;
}

.user-sidebar .sidebar-menu > li.menu-category:first-child > a.submenu-toggle {
    border-top: none !important;
    margin-top: 0.5rem !important;
    padding-top: 0.75rem !important;
}

.user-sidebar .sidebar-menu > li.has_submenu > a.submenu-toggle .submenu-arrow {
    display: none !important;
}

.user-sidebar .sidebar-menu > li.has_submenu.open > a.submenu-toggle .submenu-arrow,
.user-sidebar .sidebar-menu > li.has_submenu.open > a.submenu-toggle .submenu-arrow.rotated {
    transform: rotate(180deg) !important;
}

.user-sidebar .submenu li {
    list-style: none !important;
    margin: 0 !important;
}

.user-sidebar .submenu li a {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.5rem 1.5rem !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    display: block !important;
    border-radius: 0.375rem !important;
    margin: 0.125rem 0.5rem !important;
    text-decoration: none !important;
}

.user-sidebar .submenu li a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.user-sidebar .submenu li.active a {
    background: rgba(52, 152, 219, 0.2) !important;
    color: #3498db !important;
}

/* Nested Submenu Support (submenu inside submenu) */
.user-sidebar .submenu .has_submenu {
    position: relative !important;
}

.user-sidebar .submenu .has_submenu > a.submenu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    padding: 0.5rem 1.5rem !important;
    margin: 0.125rem 0.5rem !important;
    border-radius: 0.375rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.85rem !important;
}

.user-sidebar .submenu .has_submenu > a.submenu-toggle span {
    flex: 1 !important;
    margin-left: 0.5rem !important;
}

.user-sidebar .submenu .has_submenu > a.submenu-toggle .submenu-arrow {
    display: none !important;
}

.user-sidebar .submenu .has_submenu.open > a.submenu-toggle .submenu-arrow {
    transform: rotate(180deg) !important;
}

.user-sidebar .submenu .submenu {
    background: rgba(0, 0, 0, 0.3) !important;
    margin: 0.25rem 0.5rem 0.5rem 1.5rem !important;
    padding: 0.25rem 0 !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1) !important;
    padding-left: 0.5rem !important;
}

.user-sidebar .submenu .submenu li a {
    padding: 0.4rem 1rem !important;
    font-size: 0.8rem !important;
    margin: 0.1rem 0.25rem !important;
}

.user-sidebar-bottom {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 1rem !important;
    margin-top: auto !important;
}

.user-sidebar-bottom-title {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.5rem !important;
}

.countdown-wrapper {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: center !important;
}

.countdown-single {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem !important;
    text-align: center !important;
    min-width: 40px !important;
    color: white !important;
    font-weight: 600 !important;
}

.countdown-single span {
    display: block !important;
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase !important;
}

/* Header Styles */
.user-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    color: white !important;
}

.user-header .site-logo img {
    filter: brightness(1.2) !important;
}

.user-header .sidebar-toggeler {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.user-header .sidebar-toggeler:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.05) !important;
}

.user-header .user-dropdown .user-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.user-header .user-dropdown .user-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
}

.user-header .user-dropdown .user-btn img {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
}

.user-header .dropdown-menu {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    padding: 0.5rem !important;
}

.user-header .dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 0.5rem !important;
    margin: 0.25rem 0 !important;
    transition: all 0.3s ease !important;
}

.user-header .dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transform: translateX(5px) !important;
}

.user-header .dropdown-menu .dropdown-item i {
    margin-right: 0.5rem !important;
    width: 16px !important;
    text-align: center !important;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3) !important;
}

.mobile-bottom-nav .nav-item {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.3s ease !important;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
    color: #3498db !important;
    transform: translateY(-2px) !important;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.2rem !important;
    margin-bottom: 0.25rem !important;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.7rem !important;
    font-weight: 500 !important;
}

/* Main Content Area */
.dashbaord-main {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    color: white !important;
    min-height: 100vh !important;
}

/* Responsive Design for Sidebar and Header */
@media (max-width: 991.98px) {
    .user-sidebar {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
    }
    
    .user-header {
        padding: 0.75rem 1rem !important;
    }
    
    .mobile-bottom-nav {
        padding: 0.5rem 0 !important;
    }
    
    .mobile-bottom-nav .nav-item {
        padding: 0.5rem 0.25rem !important;
    }
}

/* ===========================================
   CHALLENGE CARDS STYLES
   =========================================== */
   .challenge-card-v2 {
    background: #2a2e37;
    border: 1px solid #444;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.challenge-card-v2:not(.locked):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.challenge-card-v2 .card-img-container {
    height: 150px;
    position: relative;
    overflow: hidden;
}

.challenge-card-v2 .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.challenge-card-v2:hover .card-img-top {
    transform: scale(1.05);
}

.challenge-card-v2 .card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.challenge-card-v2 .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.metric-item {
    background: #343842;
    padding: 10px;
    border-radius: 8px;
    color: #ccc;
}

.metric-item i {
    margin-right: 8px;
    color: #0d6efd;
}

.prize-section {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.3);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: auto;
    margin-bottom: 1rem;
}

.prize-section .prize-money {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
}

.prize-section .prize-score {
    font-size: 1rem;
    color: #ffc107;
}

.challenge-card-v2.locked {
    filter: grayscale(80%);
    opacity: 0.7;
}

.challenge-card-v2.locked .card-img-container::after {
    content: '\f023';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.5);
}

.challenge-card-v2 .required-stars {
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.challenge-card-v2 .btn {
    font-weight: bold;
}

/* ===========================================
   STAR PROGRESS STYLES
   =========================================== */
.star-progress-box {
    background-color: #2a2a2a;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #4a4a4a;
}

.star-progress-box i {
    font-size: 2em;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.star-filled {
    color: #ffc107;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.star-empty {
    color: #4a4a4a;
}

/* ===========================================
   USER STATS STYLES
   =========================================== */
.user-stats-box {
    background: linear-gradient(90deg, #2a2a2a, #3a3a3a);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border: 1px solid #4a4a4a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-basis: 0;
    flex-grow: 1;
}

.stat-icon {
    font-size: 1.8em;
    margin-right: 0;
    margin-bottom: 5px;
    height: 30px;
    line-height: 30px;
}

.stat-text h5 {
    margin: 0;
    font-weight: bold;
    color: #b0b0b0;
    font-size: 0.7em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
}

/* Icon Colors */
.score-icon-perm { color: #845ef7; }
.score-icon-float { color: #fcc419; }
.pnl-icon-profit { color: #28a745; }
.pnl-icon-loss { color: #dc3545; }
.pnl-icon-net { color: #0dcaf0; }

/* ===========================================
   LEADERBOARD STYLES
   =========================================== */
.leaderboard-box {
    background: #2c2c2c;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #4a4a4a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-title {
    text-align: center;
    color: #ffc107;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.leaderboard-list {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.leader-item {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    flex-basis: 200px;
    border: 1px solid #555;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leader-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.leader-rank {
    font-size: 2em;
    margin-bottom: 10px;
}

.leader-rank .fa-crown.gold { color: #ffd700; }
.leader-rank .fa-crown.silver { color: #c0c0c0; }
.leader-rank .fa-crown.bronze { color: #cd7f32; }

.leader-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #f0f0f0;
    margin-bottom: 5px;
    word-break: break-all;
}

.leader-score {
    font-size: 1.1em;
    color: #845ef7;
}

.leader-score .fa-gem {
    margin-right: 5px;
}

/* ===========================================
   CHALLENGE TIMER STYLES
   =========================================== */
.challenge-timer-box {
    background: linear-gradient(90deg, #6e4a0f, #a87c2f);
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    border: 1px solid #ffc107;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.timer-icon {
    font-size: 2.5em;
    margin-right: 15px;
}

.timer-text {
    display: flex;
    flex-direction: column;
}

.timer-title {
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    color: #f0e6d2;
}

.timer-countdown {
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 1px;
}

.challenge-passed-icon {
    font-size: 1.5em;
    color: #28a745;
}

/* ===========================================
   TOP-UP STATUS STYLES
   =========================================== */
.top-up-status-box {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border: 1px solid #3b82f6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.status-item {
    display: flex;
    align-items: center;
    text-align: left;
}

.status-icon {
    font-size: 2.5em;
    margin-right: 15px;
    opacity: 0.8;
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-title {
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    color: #dbeafe;
}

.status-value {
    font-size: 1.6em;
    font-weight: bold;
}

.status-separator {
    width: 1px;
    height: 50px;
    background-color: #60a5fa;
    opacity: 0.5;
}

/* ===========================================
   MODAL STYLES
   =========================================== */
.modal-content {
    background-color: #2a2e37;
    border-radius: 15px;
    border: 1px solid #444;
    color: #ff9800;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid #444;
    padding: 1.25rem;
}

.modal-header .modal-title {
    color: #ffc107;
    font-weight: 600;
    font-size: 1.5rem;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #444;
    padding: 1rem 1.5rem;
    background-color: #252932;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

/* ===========================================
   FORM STYLES
   =========================================== */
.form-control, .form-select {
    background-color: #343842;
    color: #ff9800;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease;
}

.form-control::placeholder {
    color: #888;
}

.form-control:focus, .form-select:focus {
    background-color: #343842;
    color: #ff9800;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

label {
    color: #ccc;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===========================================
   BUTTON STYLES
   =========================================== */
.btn.sp_theme_btn {
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: white;
}

.btn.sp_theme_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-secondary {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
    font-weight: bold;
    border-radius: 8px;
}

.btn-secondary:hover {
    background-color: #5a5a5a;
    border-color: #5a5a5a;
}

/* ===========================================
   USER CARDS STYLES
   =========================================== */
.user-cards-container .cards-wrapper {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    gap: 20px;
}

.empty-card-slot {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed #4f4f7a;
    border-radius: 18px;
    min-width: 240px;
    max-width: 240px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #4f4f7a;
}

.empty-card-slot i {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */
@media (max-width: 768px) {
    .leaderboard-list {
        flex-direction: column;
        gap: 10px;
    }
    
    .leader-item {
        flex-basis: auto;
    }
    
    .user-stats-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .challenge-timer-box {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .top-up-status-box {
        flex-direction: column;
        gap: 15px;
    }
    
    .status-separator {
        display: none;
    }
}

@media (max-width: 576px) {
    .star-progress-box i {
        font-size: 1.5em;
        margin: 0 2px;
    }
    
    .leaderboard-title {
        font-size: 1.2rem;
    }
    
    .timer-countdown {
        font-size: 1.2em;
    }
}
