/* 
   Blackjack Counter Pro - Premium Dashboard Stylesheet
   Premium style for the dashboard and private area pages
*/

/* === VARIABLES === */
:root {
    --dashboard-bg: #0a0e17;
    --sidebar-bg: #1a2138;
    --card-bg: #1a2138;
    --text-primary: #ffffff;
    --text-secondary: #b8c2cc;
    --accent-color: #d4af37;
    --accent-dark: #b59530;
    --accent-light: #f0e6c2;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --box-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f0e6c2 100%);
    --gradient-dark: linear-gradient(135deg, #0a0e17 0%, #1a2138 100%);
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', serif;
  }
  
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-header .logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
  }
  
  .close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
  }
  
  .close-sidebar:hover {
    color: var(--text-primary);
  }
  
  .plan-badge {
    background: var(--gradient-gold);
    color: var(--dashboard-bg);
    padding: 0.15rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    display: inline-block;
  }
  
  
  .notifications {
    position: relative;
    margin-right: 1.5rem;
  }
  
  .notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
  }
  
  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
  }
  
  
  .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--sidebar-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
  }
  
  .dropdown-menu a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
  }
  
  /* === DASHBOARD MAIN CONTENT === */
  .dashboard-main {
    padding: 2rem;
  }
  
  .page-header {
    margin-bottom: 3rem;
  }
  
  .page-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .page-header p {
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.6;
  }
  
  /* === PREMIUM STATS OVERVIEW === */
  .stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
  }
  
  .stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--box-shadow-sm);
    position: relative;
    overflow: hidden;
  }
  
  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: rgba(212, 175, 55, 0.3);
  }
  
  .stat-card:hover::before {
    opacity: 0.1;
  }
  
  .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-right: 1.5rem;
    position: relative;
    z-index: 1;
  }
  
  .stat-info {
    position: relative;
    z-index: 1;
  }
  
  .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
  }
  
  .stat-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  /* === PREMIUM DASHBOARD GRID === */
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .dashboard-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
  }
  
  .dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: rgba(212, 175, 55, 0.3);
  }
  
  .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .card-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
    color: var(--accent-color);
    font-family: var(--font-heading);
  }
  
  .card-actions .view-all {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  .card-actions .view-all:hover {
    color: var(--accent-color);
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  /* Chart cards */
  .progress-chart-card .card-body,
  .accuracy-chart-card .card-body {
    height: 300px;
    position: relative;
  }
  
  .chart-container {
    width: 100%;
    height: 100%;
    position: relative;
  }
  
  /* Session list */
  .session-list {
    display: flex;
    flex-direction: column;
  }
  
  .session-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
  }
  
  .session-item:last-child {
    border-bottom: none;
  }
  
  .session-item:hover {
    background: rgba(255, 255, 255, 0.02);
  }
  
  .session-date .date {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
  }
  
  .session-date .time {
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
  
  .session-details {
    text-align: right;
  }
  
  .session-details .duration,
  .session-details .session-accuracy {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
  }
  
  .session-details i {
    margin-right: 0.25rem;
    color: var(--accent-color);
  }
  
  .session-accuracy.high {
    color: var(--success-color);
  }
  
  .session-accuracy.medium {
    color: var(--warning-color);
  }
  
  .session-accuracy.low {
    color: var(--error-color);
  }
  
  .no-data-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
    font-style: italic;
  }
  
  /* Subscription card */
  .subscription-info {
    text-align: center;
    padding: 1rem 0;
  }
  
  .current-plan {
    margin-bottom: 2rem;
  }
  
  .current-plan .plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    color: var(--accent-color);
  }
  
  .current-plan .plan-name span {
    color: var(--accent-color);
  }
  
  .current-plan .plan-expires {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  .plan-features {
    margin-bottom: 2rem;
    text-align: left;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .plan-features ul {
    list-style: none;
  }
  
  .plan-features ul li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    color: var(--text-primary);
  }
  
  .plan-features ul li i {
    color: var(--accent-color);
    margin-right: 0.75rem;
    margin-top: 0.2rem;
    font-size: 0.9rem;
  }
  
  .btn-upgrade {
    background: var(--gradient-gold);
    color: var(--dashboard-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
  }
  
  .btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  }
  
  /* === PREMIUM RESPONSIVE ADJUSTMENTS === */
  @media (max-width: 1200px) {
    .stats-overview {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 768px) {
    .dashboard-container {
      flex-direction: column;
    }

    .sidebar {
      position: fixed;
      left: 0;
      top: 0;
      height: 100%;
      width: 280px; /* Define a width for the sidebar */
      z-index: 1051 !important;
      background-color: var(--sidebar-bg); /* Ensure background is set */
      transform: translateX(-100%);
      transition: transform 0.3s ease-in-out;
      overflow-y: auto; /* Allow scrolling if content is long */
      box-shadow: var(--box-shadow); /* Add shadow when open */
    }

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

    .close-sidebar {
      display: block; /* This should already be here, ensure it is */
    }

    .main-content {
      /* grid-column: 1; Remove or adjust if not using grid layout in this way */
      margin-left: 0; /* Ensure main content takes full width when sidebar is hidden */
      padding-top: 60px; /* Add padding to prevent overlap with fixed header/toggle */
    }

    .mobile-main-menu-toggle {
      display: flex; /* Show on mobile */
      align-items: center;
      justify-content: center;
      position: fixed;
      top: 15px;
      left: 15px;
      z-index: 1051; /* Above the sidebar overlay when sidebar is hidden */
      background: var(--accent-color);
      color: var(--dashboard-bg);
      border: none;
      border-radius: 50%;
      width: 45px;
      height: 45px;
      font-size: 1.2rem;
      cursor: pointer;
      box-shadow: var(--box-shadow-sm);
      transition: all 0.3s ease;
    }

    /* Optional: overlay for when the sidebar is open */
    .sidebar-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1040 !important;
      transition: opacity 0.3s ease-in-out;
      opacity: 0;
    }

    .sidebar-overlay.active {
      display: block;
      opacity: 1;
    }
  }
  
  @media (max-width: 576px) {
    .stat-card {
      flex-direction: column;
      text-align: center;
    }
    
    .stat-icon {
      margin-right: 0;
      margin-bottom: 1rem;
    }
    
    .session-item {
      flex-direction: column;
    }
    
    .session-date,
    .session-details {
      text-align: center;
    }
    
    .session-date {
      margin-bottom: 0.5rem;
    }
    
    .card-header {
      flex-direction: column;
      align-items: flex-start;
    }
    
    .card-actions {
      margin-top: 0.5rem;
    }
  }
  
  /* === PREMIUM ANIMATIONS === */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .dashboard-card {
    animation: fadeIn 0.5s ease forwards;
  }
  
  .dashboard-card:nth-child(1) { animation-delay: 0.1s; }
  .dashboard-card:nth-child(2) { animation-delay: 0.2s; }
  .dashboard-card:nth-child(3) { animation-delay: 0.3s; }
  .dashboard-card:nth-child(4) { animation-delay: 0.4s; }
  
  /* === PREMIUM UTILITY CLASSES === */
  .text-gold {
    color: var(--accent-color);
    background-color: rgba(212, 175, 55, 0.1);
    font-weight: bold;
}
  
  .bg-dark {
    background: var(--dashboard-bg);
  }
  
  .shadow-gold {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  
  .border-gold {
    border: 1px solid var(--accent-color);
  }
  
  /* === LOADING ANIMATION === */
  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  /* Styles for the new session types card */
  .session-types-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .session-type-item {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .session-type-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .session-type-animate {
    animation: rotateCounter 0.8s ease-in-out;
  }
  
  @keyframes rotateCounter {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
  }
  
  .session-type-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.5rem;
  }
  
  .session-type-info {
    flex: 1;
  }
  
  .session-type-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
  }
  
  .session-type-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  /* Style for updated counters */
  .updated-value {
    animation: pulseHighlight 2s ease;
    font-weight: bold;
  }
  
  @keyframes pulseHighlight {
    0% { color: var(--text-secondary); }
    25% { color: var(--accent-color); }
    50% { color: var(--success-color); }
    75% { color: var(--accent-color); }
    100% { color: var(--text-secondary); }
  }
  
  /* Styles for the detailed statistics section by session type */
  .sessions-stats-tabs {
    width: 100%;
  }
  
  .tabs-header {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
  }
  
  .tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  }
  
  .tab-btn:hover {
    color: var(--accent-color);
  }
  
  .tab-btn.active {
    color: var(--accent-color);
  }
  
  .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
  }
  
  .tabs-content {
    position: relative;
    min-height: 300px;
  }
  
  .tab-content {
    display: none;
    animation: fadeIn 0.5s ease forwards;
  }
  
  .tab-content.active {
    display: block;
  }
  
  .tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 15px;
  }
  
  .tab-loading p {
    color: var(--text-secondary);
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table th {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.leaderboard-table td {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Specific styling for the rank column */
.leaderboard-table td:first-child {
    font-weight: 700;
    color: var(--accent-light);
}

/* Adjust performance column width */
.leaderboard-table th#casino-performance-header,
.leaderboard-table th#flashcards-performance-header,
.leaderboard-table th#auto-performance-header,
.leaderboard-table th#decision-performance-header {
    width: 120px;
}

/* Mobile optimization for leaderboard table */
@media (max-width: 768px) {
    .leaderboard-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .leaderboard-table thead,
    .leaderboard-table tbody,
    .leaderboard-table th,
    .leaderboard-table td,
    .leaderboard-table tr {
        display: block;
    }

    .leaderboard-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .leaderboard-table tr {
        margin-bottom: 15px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--border-radius);
        background: var(--card-bg);
        box-shadow: var(--box-shadow-sm);
    }

    .leaderboard-table td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .leaderboard-table td:last-child {
        border-bottom: none;
    }

    .leaderboard-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--text-secondary);
    }

    /* Set data-label for each column */
    .leaderboard-table tbody td:nth-of-type(1)::before { content: "Rank:"; }
    .leaderboard-table tbody td:nth-of-type(2)::before { content: "Player:"; }
    .leaderboard-table tbody td:nth-of-type(3)::before { content: "Performance:"; }
    .leaderboard-table tbody td:nth-of-type(4)::before { content: "Level:"; }
    .leaderboard-table tbody td:nth-of-type(5)::before { content: "Best Streak:"; }
    .leaderboard-table tbody td:nth-of-type(6)::before { content: "Total Time:"; }
    .leaderboard-table tbody td:nth-of-type(7)::before { content: "Total Sessions:"; }
    .leaderboard-table tbody td:nth-of-type(8)::before { content: "Total Correct:"; }
    .leaderboard-table tbody td:nth-of-type(9)::before { content: "Total Attempts:"; }
    .leaderboard-table tbody td:nth-of-type(10)::before { content: "XP:"; }
    .leaderboard-table tbody td:nth-of-type(11)::before { content: "Achievements:"; }
}
  
  /* Styling for the new columns: Total Correct, Total Attempts, Total Sessions */
  .leaderboard-table th.total-time-col,
  .leaderboard-table td.total-time-col,
  .leaderboard-table th.total-sessions-col,
  .leaderboard-table td.total-sessions-col,
  .leaderboard-table th.total-correct-col,
  .leaderboard-table td.total-correct-col,
  .leaderboard-table th.total-attempts-col,
  .leaderboard-table td.total-attempts-col {
    color: var(--accent-light);
    font-weight: bold;
  }
  
  /* Ensure numerical values in these columns are visually distinct */
  .leaderboard-table td.total-time-col,
  .leaderboard-table td.total-sessions-col,
  .leaderboard-table td.total-correct-col,
  .leaderboard-table td.total-attempts-col {
    font-size: 1.05rem; /* Slightly larger for emphasis */
    color: var(--accent-color);
  }
  
  /* Special styling for ranks */
  .leaderboard-table tbody tr:nth-child(1) td:nth-child(1), /* Rank 1 */
  .leaderboard-table tbody tr:nth-child(2) td:nth-child(1), /* Rank 2 */
  .leaderboard-table tbody tr:nth-child(3) td:nth-child(1) { /* Rank 3 */
    color: gold;
    font-weight: bold;
    font-size: 1.2rem;
  }
  
  /* Additional styles for user's own rank row */
  .leaderboard-your-rank-container {
    margin-bottom: 20px;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    background-color: rgba(212, 175, 55, 0.05);
    padding: 15px;
  }
  
  .leaderboard-your-rank-container h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
  }
  
  .leaderboard-your-rank-container #your-rank-position {
    font-weight: bold;
    font-size: 1.3rem;
  }
  
  .leaderboard-your-rank-container .leaderboard-table th {
    color: var(--accent-light);
  }
  
  .leaderboard-your-rank-container .leaderboard-table td {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
  }
  
  /* Search and filter inputs */
  #leaderboardSearchInput, #leaderboardPeriodFilter {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: var(--border-radius);
  }
  
  #leaderboardSearchInput::placeholder {
    color: var(--text-secondary);
  }
  
  #leaderboardPeriodFilter option {
    background-color: var(--card-bg);
    color: var(--text-primary);
  }
  
  /* Ensure table responsiveness */
  .leaderboard-table-container {
    overflow-x: auto;
  }
  
  .leaderboard-table {
    width: 100%;
    min-width: 800px; /* Ensure table is wide enough to prevent squishing */
    border-collapse: collapse;
  }
  
  /* Mobile adjustments for leaderboard */
  @media (max-width: 768px) {
    .leaderboard-table {
      min-width: unset;
    }
    
    .leaderboard-table th, .leaderboard-table td {
      padding: 8px 5px;
      font-size: 0.85rem;
    }
    
    .leaderboard-your-rank-container h4 {
      font-size: 1rem;
    }
  }
  
  @media (max-width: 576px) {
    .leaderboard-table th, .leaderboard-table td {
      font-size: 0.75rem;
    }
  }
  
  /* Mobile statistics navigation */
  .stats-nav {
    display: flex;
    justify-content: center;
    background: rgba(26, 33, 56, 0.8);
    margin: -15px -15px 15px;
    padding: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .stats-nav-item {
    padding: 8px 15px;
    margin: 0 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 20px;
  }
  
  .stats-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
  }
  
  .stats-nav-item.active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
  }
  
  @media (max-width: 576px) {
    .stats-nav {
      padding: 8px 5px;
    }
    
    .stats-nav-item {
      padding: 6px 10px;
      font-size: 0.8rem;
      margin: 0 2px;
    }
  }
  
  /* Improvements for compact statistics view */
  .compact-stats-view {
    /* Existing styles */
  }
  
  .compact-stats-view .stats-details-grid {
    transition: all 0.3s ease;
  }
  
  /* Animation for stats filtering */
  @keyframes fadeInStats {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .compact-stats-view .detail-stat {
    animation: fadeInStats 0.3s ease forwards;
  }
  }

/* New styles for the personal rank card on dashboard.html */
#personal-rank-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
    text-align: center;
}

.rank-display,
.score-display {
    margin-bottom: 1rem;
}

.rank-value,
.score-value {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    display: block;
    line-height: 1;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.score-value {
    font-size: 2.5rem;
    color: var(--accent-light);
    text-shadow: none;
}

.rank-label,
.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.rank-message {
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
}

.rank-message a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.rank-message a:hover {
    text-decoration: underline;
}

/* Adjust dashboard grid for new card */
@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr 1fr; /* Two charts and one rank card */
        /* This will put the personal-rank-card in its own column on large screens */
    }
}

@media (max-width: 1199px) and (min-width: 769px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        /* Adjust for smaller screens where three columns might be too tight */
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }
}

/* Ensure the rank card and session types card take full width on smaller screens if necessary */
@media (max-width: 992px) {
    #personal-rank-card, .session-types-card {
        grid-column: 1 / -1; /* Span full width */
    }
}

/* First-time Tutorial Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.8); /* Black w/ opacity */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    animation: fadeInModal 0.3s ease-out forwards;
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    width: 90%; /* Adjust width for responsiveness */
    max-width: 700px; /* Max width for larger screens */
    box-shadow: var(--box-shadow);
    position: relative;
    text-align: center;
    animation: slideInModal 0.4s ease-out forwards;
}

.modal-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--font-heading);
}

.modal-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-content .close-button {
    color: #ffffff; /* Changed from var(--text-secondary) for better contrast */
    position: absolute;
    top: 10px; /* Adjusted for better spacing */
    right: 15px; /* Adjusted for better spacing */
    font-size: 40px; /* Increased size for mobile tap target */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-content .close-button:hover,
.modal-content .close-button:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content .btn-primary {
    background: linear-gradient(135deg, #00d4ff, #00a5cc);
    color: #0a0e17;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 20px;
}

.modal-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.feature-section {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    transition: all 0.3s ease;
}

.feature-section:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.feature-section h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.feature-section h3 i {
    color: var(--accent-color);
    margin-right: 10px;
    font-size: 1.5rem;
}

.feature-section ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.feature-section ul li {
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.feature-section ul li strong {
    color: var(--accent-light);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .modal-content h2 {
        font-size: 1.8rem;
    }
    .feature-section {
        padding: 15px;
    }
    .feature-section h3 {
        font-size: 1.2rem;
    }
    .modal-content .close-button {
        font-size: 45px; /* Even larger on small mobile screens */
        top: 5px;
        right: 10px;
    }
}