/* styles.css - Shared stylesheet for all pages - LIGHT MODE */

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

:root {
    --primary: #0ed618d7;
    --primary-dark: #16a10a;
    --secondary: #6de962;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --shadow-xl: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth transitions for all interactive elements */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

*:focus {
    outline: none;
}

/* Navbar */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: #16a34a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 140px;
}

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 1.1rem;
}

.logo-text {
    font-weight: 800;
    letter-spacing: -0.3px;
}

.nav-menu {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
    display: block;
}

.nav-menu a:hover {
    color: #16a34a;
    border-bottom-color: #16a34a;
}

.nav-menu a.active {
    color: #16a34a;
    border-bottom-color: #16a34a;
    font-weight: 600;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-area {
    position: relative;
    display: flex;
    align-items: center;
}

/* Container */
.container {
    max-width: 1400px;   /* maksimal kenglik */
    width: 90%;          /* responsive kenglik */
    padding: 2rem 1rem;  /* yuqori va pastdan bo'shliq */
    margin: 0 auto;      /* gorizontal markazlash */
    justify-content: center; /* ichki elementlarni markazlash */
    flex: 1;
}

/* Hero Section */
.hero {
    background: var(--primary);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px var(--shadow);
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border: none;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #10b981;
    border: 2px solid #10b981;
    box-shadow: none;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: #f0fdf4;
    border-color: #059669;
    color: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #22c55e;
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-beginner {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6; /* Moviy - Beginner */
}

.badge-easy {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981; /* Yashil - Easy */
}

.badge-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b; /* Sariq - Medium */
}

.badge-hard {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444; /* Qizil - Hard */
}

.badge-expert {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6; /* Binafsha - Expert */
}
/* --- Kategoriya ranglari (misollar) --- */
.badge-array {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6; /* Moviy */
}

.badge-string {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981; /* Yashil */
}

.badge-math {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b; /* Sariq */
}

.badge-dp {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6; /* Binafsha (Dynamic Programming) */
}

.badge-graph {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444; /* Qizil */
}

.badge-tree {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e; /* Yashil tusi (Tree) */
}

.badge-list {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb; /* Ko‘k (List) */
}

.badge-stack {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308; /* Oltin rang (Stack) */
}

.badge-queue {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4; /* Okean ko‘k (Queue) */
}

.badge-sorting {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7; /* Pushti-binafsha (Sorting) */
}

.badge-ga {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e; /* To‘q qizil (Graph Algorithms) */
}

/* Search and Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
    overflow: visible;
}

.search-box {
    flex: 2;
    min-width: 0;
}

#difficultyFilter,
#tagFilter {
    flex: 1;
    min-width: auto;
    padding: 0.75rem 0.75rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    position: static;
    z-index: auto;
    max-width: 100%;
    width: 100%;
    overflow: visible;
}

#difficultyFilter:hover,
#tagFilter:hover {
    border-color: var(--primary);
}

#difficultyFilter:focus,
#tagFilter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    z-index: 100;
}

/* Mobile inline dropdowns for problem filters */
.mobile-filter-select {
    display: none !important;
    position: relative;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.mobile-filter-trigger {
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.mobile-filter-trigger::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.mobile-filter-select.open .mobile-filter-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.mobile-filter-select.open {
    z-index: 1600;
}

.mobile-filter-options {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1200;
}

.mobile-filter-select.open .mobile-filter-options {
    display: block;
}

.mobile-filter-option {
    width: 100%;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    padding: 0.7rem 0.8rem;
    text-align: left;
    color: var(--text);
    font-size: 0.92rem;
    cursor: pointer;
}

.mobile-filter-option:last-child {
    border-bottom: none;
}

.mobile-filter-option.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
}

/* Mobile select dropdown optimization */
@media (max-width: 768px) {
    .filters {
        align-items: stretch;
    }

    #difficultyFilter,
    #tagFilter {
        display: block;
        padding: 0.65rem 0.5rem;
        font-size: 0.9rem;
        width: 100%;
        flex: 1 1 100%;
        appearance: auto !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        background-image: none !important;
        padding-right: 0.65rem !important;
        position: static !important;
        z-index: auto !important;
    }

    .mobile-filter-select {
        display: none !important;
        width: 100%;
        flex: 1 1 100%;
    }
    
    /* Ensure select options are visible and constrained */
    #difficultyFilter,
    #tagFilter {
        min-height: 40px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .mobile-filter-select {
        display: none !important;
    }

    #difficultyFilter,
    #tagFilter {
        display: block;
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
        min-height: 38px;
        width: 100%;
        flex: 1 1 100%;
        appearance: auto !important;
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        background-image: none !important;
        padding-right: 0.6rem !important;
        position: static !important;
        z-index: auto !important;
    }
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: rgba(16, 185, 129, 0.02);
}

/* Table */
.table-container {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    transition: all 0.3s ease;
}

th, td {
    padding: 1rem 0.75rem;
    text-align: left;
}

th {
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
    font-weight: 700;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
    cursor: pointer;
    transform: translateX(2px);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.6rem 0.95rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-nav {
    font-weight: 700;
    min-width: auto;
    padding: 0.6rem 1.2rem;
}

.pagination-numbers {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Problem Detail */
.problem-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.problem-title {
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-size: clamp(1.65rem, 2.5vw, 2.35rem);
    font-weight: 700;
}

.problem-statement {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.problem-statement h2 {
    margin-bottom: 1rem;
    color: var(--text);
}

.problem-description {
    color: #1f2937;
    line-height: 1.75;
    font-size: 1rem;
}

.problem-statement h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.problem-section-title {
    margin-top: 2rem;
}

.problem-statement ul {
    margin-left: 2rem;
    margin-top: 1rem;
}

.problem-statement pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.problem-statement code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    color: var(--primary);
}

.problem-meta-tags {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.problem-note {
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef6ff 100%);
    border-radius: 0.6rem;
    border: 1px solid #dbeafe;
    color: #1e293b;
}

.code-section {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.editor-language {
    width: 100%;
    max-width: 340px;
}

.editor-language label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#languageSelect {
    width: 100%;
    height: 42px;
    padding: 0 2.3rem 0 0.8rem;
    border-radius: 0.55rem;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1rem;
    background-position: right 0.7rem center;
}

#languageSelect:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.CodeMirror {
    height: 400px;
    border-radius: 0.5rem;
    font-size: 14px;
    border: 1px solid var(--border);
}

textarea {
    width: 100%;
    min-height: 400px;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

/* Contest Timer */
.contest-header {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.leaderboard-item:hover {
    transform: translateX(5px);
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
}

.rank-1 { color: #d97706; }
.rank-2 { color: #64748b; }
.rank-3 { color: #92400e; }

/* Profile */
.profile-header {
    display: flex;
    gap: 2rem;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    flex-shrink: 0;
    color: white;
}

.profile-info h2 {
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #16a34a;
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #16a34a;
    transition: width 0.5s ease;
    border-radius: 1rem;
}

/* Submission History */
.submission-item {
    padding: 0.85rem 0.95rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    cursor: pointer;
    gap: 0.75rem;
}

.submission-item:hover {
    border-color: #86efac;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.14);
}

.empty-attempts {
    justify-content: center;
    text-align: center;
    cursor: default;
}

.attempt-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 160px;
}

.attempt-number {
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #ffffff;
    min-width: 115px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.status-accepted { color: var(--success); font-weight: 700; }
.status-wrong { color: var(--danger); font-weight: 700; }
.status-pending { color: var(--warning); font-weight: 700; }
.status-error { color: #475569; font-weight: 700; }

.attempt-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.lang-badge {
    background: #ecfeff;
    color: #0f766e;
    border: 1px solid #99f6e4;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.metric-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.date-text {
    font-size: 0.82rem;
    color: #64748b;
}

.attempts-title {
    font-size: 1.05rem;
}

.attempts-pagination {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

#codeModal {
    display: none;
}

.code-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 2000;
}

.code-modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.code-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
}

.code-modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.code-modal-close {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.code-modal-pre {
    margin: 0;
    padding: 1rem;
    background: #0f172a;
    color: #e2e8f0;
    overflow: auto;
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.6;
}

.code-modal-footer {
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

#attemptsTableContainer.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-top: 1px solid #e8edf4;
    padding: 1rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 0.8rem;
}

.footer-brand h3 {
    display: none;
}

.footer-brand p {
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Contest Layout */
.contest-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Responsive */
@media (max-width: 468px) {
    .nav-menu {
        display: none;
    }

    .problem-layout, .contest-layout {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Utilities */
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }

.contest-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--border);
        }
        .contest-tab {
            padding: 1rem 1.5rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 1rem;
            font-weight: 500;
            border-bottom: 3px solid transparent;
            transition: all 0.3s ease;
        }
        .contest-tab:hover {
            color: var(--text-primary);
        }
        .contest-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        .countdown-timer {
            color: white;
            padding: 2rem;
            border-radius: 12px;
            text-align: center;
            margin-bottom: 2rem;
            box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
        }
        
        /* Light mode uchun yumshoq ranglar */
        :root:not(.dark-mode) .countdown-timer {
            background: var(--bg-secondary);
            color: #2d3748;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }
        
        .countdown-timer h2,
        .countdown-timer p {
            color: inherit;
        }
        
        .countdown-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-top: 1.5rem;
        }
        
        .countdown-item {
            background: rgba(255, 255, 255, 0.25);
            padding: 1rem;
            border-radius: 8px;
            backdrop-filter: blur(10px);
        }
        
        /* Light mode uchun countdown item */
        :root:not(.dark-mode) .countdown-item {
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid rgba(0, 0, 0, 0.06);
        }
        
        .countdown-value {
            font-size: 2.5rem;
            font-weight: bold;
            display: block;
            color: white;
        }
        
        /* Light mode uchun countdown value */
        :root:not(.dark-mode) .countdown-value {
            color: #2d3748;
        }
        
        .countdown-label {
            font-size: 0.9rem;
            opacity: 0.95;
            margin-top: 0.5rem;
            color: white;
        }
        
        /* Light mode uchun countdown label */
        :root:not(.dark-mode) .countdown-label {
            color: #4a5568;
            opacity: 1;
        }
        .contest-started-banner {
            background: var(--success);
            color: white;
            padding: 1.5rem;
            border-radius: 12px;
            text-align: center;
            margin-bottom: 2rem;
        }
        .contest-ended-banner {
            background: var(--danger);
            color: white;
            padding: 1.5rem;
            border-radius: 12px;
            text-align: center;
            margin-bottom: 2rem;
        }
         /* Sidebar Styles */
        .problems-sidebar {
            width: 300px;
            background: var(--bg-secondary, #fff);
            border-right: 1px solid var(--border-color, #e0e0e0);
            padding: 1.5rem;
            overflow-y: auto;
            position: fixed;
            left: 0;
            top: 60px;
            bottom: 0;
            z-index: 100;
        }

        .sidebar-header {
            margin-bottom: 1.5rem;
        }

        .sidebar-header h2 {
            font-size: 1.25rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary, #333);
        }

        .sidebar-header p {
            font-size: 0.875rem;
            color: var(--text-secondary, #666);
        }

        .problem-card {
            width: 100%;
            background: var(--bg-tertiary, #f9f9f9);
            border: 2px solid var(--border-color, #e0e0e0);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: block;
            text-align: left;
        }

        .problem-card:hover {
            transform: translateX(5px);
            border-color: var(--primary-color, #007bff);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .problem-card.active {
            background: var(--primary-color, #007bff);
            border-color: var(--primary-color, #007bff);
            color: white;
        }

        .problem-card.active .problem-title,
        .problem-card.active .problem-meta {
            color: white;
        }

        .problem-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .problem-number {
            font-weight: bold;
            font-size: 0.875rem;
            color: var(--text-secondary, #666);
        }

        .problem-card.active .problem-number {
            color: rgba(255,255,255,0.9);
        }

        .problem-status {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
        }

        .status-solved {
            background: #28a745;
            color: white;
        }

        .status-attempted {
            background: #ffc107;
            color: white;
        }

        .status-unsolved {
            background: #e0e0e0;
            color: #999;
        }

        .problem-card .problem-title {
            font-weight: 600;
            font-size: 0.95rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary, #333);
        }

        .problem-meta {
            display: flex;
            gap: 0.5rem;
            font-size: 0.75rem;
        }

        .difficulty-badge {
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 500;
        }

        .difficulty-easy {
            background: #d4edda;
            color: #155724;
        }

        .difficulty-medium {
            background: #fff3cd;
            color: #856404;
        }

        .difficulty-hard {
            background: #f8d7da;
            color: #721c24;
        }

        .problem-card.active .difficulty-badge {
            background: rgba(255,255,255,0.2);
            color: white;
        }

        /* Main content adjustment */
        .contest-problems-page .container {
            margin-left: 300px;
            padding-left: 2rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .problems-sidebar {
                width: 250px;
            }
            
            .contest-problems-page .container {
                margin-left: 250px;
            }
        }

        @media (max-width: 576px) {
            .problems-sidebar {
                position: fixed;
                left: -300px;
                z-index: 1000;
                transition: left 0.3s ease;
            }

            .problems-sidebar.open {
                left: 0;
            }

            .contest-problems-page .container {
                margin-left: 0;
            }
        }


/* =============================================
   ENHANCED MOBILE-FIRST RESPONSIVE DESIGN
   ============================================= */

/* Tablets & Small Screens */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 1.5rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .problem-layout,
    .contest-layout {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile & Extra Small */
@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
    }

    .container {
        width: 95%;
        padding: 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .filters {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .search-box {
        flex: 1 1 100%;
        min-width: 0;
    }

    #difficultyFilter,
    #tagFilter {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 0;
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .pagination-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        min-width: 40px;
    }

    .pagination-nav {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .problem-layout,
    .contest-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .problem-statement {
        max-height: none;
        padding: 1.5rem;
    }

    .problem-description {
        font-size: 0.95rem;
    }

    .problem-title {
        font-size: 1.55rem;
    }

    .code-section {
        padding: 1rem;
    }

    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-language {
        max-width: 100%;
    }

    .editor-actions .btn {
        width: 100%;
    }

    .submission-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .attempt-main,
    .attempt-meta {
        width: 100%;
    }

    .attempt-meta {
        justify-content: flex-start;
        gap: 0.7rem;
    }

    .code-modal-panel {
        width: 94vw;
        max-height: 86vh;
    }

    .code-modal-header,
    .code-modal-footer,
    .code-modal-pre {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .CodeMirror {
        height: 300px;
    }

    textarea {
        min-height: 300px;
        font-size: 13px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .leaderboard-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .rank {
        font-size: 1.25rem;
        min-width: 40px;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box {
        min-width: 100%;
    }

    .search-box input,
    .search-box select {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    .contest-header {
        padding: 1.5rem;
    }

    .timer {
        font-size: 2rem;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .countdown-item {
        padding: 0.75rem;
    }

    .countdown-value {
        font-size: 1.75rem;
    }

    .countdown-label {
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
    }

    .editor-actions {
        flex-direction: column;
    }

    .editor-actions .btn {
        width: 100%;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    .container {
        width: 100%;
        padding: 0.75rem;
    }

    .filters {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .search-box {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        box-sizing: border-box;
    }

    #difficultyFilter,
    #tagFilter {
        flex: 1 1 100%;
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        box-sizing: border-box;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1rem;
        padding-right: 2.5rem;
    }

    .pagination-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        min-width: auto;
        width: auto;
    }

    .pagination-nav {
        display: none;
    }

    .pagination-numbers {
        gap: 0.2rem;
    }

    .hero {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }

    /* Table mobile card view */
    .table-container {
        margin: 0 -0.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    #problemsTable thead {
        display: none;
    }

    #problemsTable tbody {
        display: block;
    }

    #problemsTable tbody tr {
        display: flex;
        flex-direction: column;
        padding: 0.75rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.5rem;
        background: #fff;
    }

    #problemsTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
    }

    #problemsTable tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-light);
        margin-right: 0.5rem;
        min-width: 100px;
    }

    #problemsTable tbody td:first-child {
        padding-top: 0;
    }

    #problemsTable tbody td:last-child {
        padding-bottom: 0;
    }

    .hero h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .card h3 {
        font-size: 0.95rem;
    }

    .card-meta {
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }

    .problem-statement {
        padding: 1rem;
    }

    .problem-statement h2 {
        font-size: 1.25rem;
    }

    .problem-statement h3 {
        font-size: 1.05rem;
        margin-top: 1.5rem;
    }

    .status-badge {
        min-width: 100px;
        font-size: 0.8rem;
    }

    .attempt-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.78rem;
    }

    .date-text,
    .metric-value {
        font-size: 0.8rem;
    }

    .problem-statement pre {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .code-section {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .CodeMirror {
        height: 250px;
        font-size: 12px;
    }

    textarea {
        min-height: 250px;
        font-size: 12px;
        padding: 0.75rem;
    }

    .profile-header {
        padding: 1rem;
        gap: 1rem;
    }

    .profile-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .stats-grid {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem 0.4rem;
    }

    .filters {
        gap: 0.5rem;
    }

    .search-box input,
    .search-box select {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .contest-header {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .timer {
        font-size: 1.75rem;
        margin: 0.75rem 0;
    }

    .countdown-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .countdown-item {
        padding: 0.5rem;
        border-radius: 6px;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .countdown-label {
        font-size: 0.75rem;
    }

    .leaderboard-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .rank {
        font-size: 1rem;
        min-width: 35px;
    }

    .footer {
        padding: 1.5rem 1rem;
    }

    .footer-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Extra Small Devices (Under 380px) */
@media (max-width: 375px) {
    .container {
        width: 100%;
        padding: 0.5rem;
    }

    .hero {
        padding: 1.5rem 0.75rem;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .card {
        padding: 0.5rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.4rem 0.3rem;
    }
}

/* Landscape Mode Optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .CodeMirror,
    textarea {
        height: auto;
        min-height: 200px;
    }
}

/* Horizontal Scrolling Prevention */
html,
body {
    overflow-x: hidden;
}

/* Image Responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Pre/Code Block Responsive */
pre {
    overflow-x: auto;
}

pre code {
    overflow-x: auto;
}

/* --- Arena Navbar --- */
.arena-nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    z-index: 2000;
    display: flex;
    align-items: center;
}

.arena-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.arena-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1a202c;
    font-weight: 800;
    font-size: 1.25rem;
}

.arena-logo-box {
    width: 40px;
    height: 40px;
    background: #10b981;
    color: #ffffff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.arena-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.arena-link {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.arena-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #10b981;
    transition: width 0.3s ease;
}

.arena-link:hover {
    color: #10b981;
}

.arena-link:hover::after,
.arena-link.active::after {
    width: 100%;
}

.arena-link.active {
    color: #10b981;
}

.arena-user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.arena-account {
    position: relative;
}

.arena-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s ease;
}

.arena-avatar:hover {
    transform: scale(1.05);
}

.arena-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    z-index: 2001;
}

.arena-dropdown.active {
    display: flex;
    animation: arenaSlideIn 0.2s ease;
}

@keyframes arenaSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.arena-dropdown-header {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
}

.arena-dropdown-header strong {
    color: #1a202c;
    font-size: 0.9rem;
    display: block;
}

.arena-dropdown-header span {
    color: #718096;
    font-size: 0.8rem;
}

.arena-divider {
    height: 1px;
    background: #edf2f7;
    margin: 0.5rem 0;
}

.arena-dropdown-item {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.arena-dropdown-item:hover {
    background: #f0fdf4;
    color: #10b981;
}

.arena-logout:hover {
    background: #fef2f2;
    color: #ef4444;
}

.arena-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.arena-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: #4a5568;
    border-radius: 2px;
    transition: 0.3s;
}

.arena-mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.arena-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.arena-mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.arena-btn-login {
    background: #10b981;
    color: #ffffff;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.arena-btn-login:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

@media (max-width: 900px) {
    .arena-mobile-toggle {
        display: flex;
        order: 2;
    }
    .arena-user-section {
        order: 1;
        margin-left: auto;
        margin-right: 1rem;
    }
    .arena-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        transition: 0.4s;
        z-index: 1999;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
    }
    .arena-menu.active {
        left: 0;
    }
    .arena-link {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
    }
}

/* =============================================
   SELECT2 RESPONSIVE STYLING
   ============================================= */

/* Main Container */
.select2-container {
    width: 100% !important;
    max-width: 100%;
}

/* Selection Box */
.select2-container--default .select2-selection--single {
    height: 48px;
    background-color: #ffffff;
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    padding-left: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-secondary) transparent transparent transparent;
    border-width: 6px 5px 0 5px;
}

/* Focus and Hover State */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Dropdown Panel */
.select2-dropdown {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 9999;
    margin-top: 4px;
    animation: select2FadeIn 0.2s ease-out;
}

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

/* Results List */
.select2-results__options {
    max-height: 300px;
    padding: 0.5rem;
}

.select2-results__option {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

/* Search Box inside Dropdown */
.select2-search--dropdown {
    padding: 0.75rem;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    .select2-container {
        width: 100% !important;
    }
    
    .select2-dropdown {
        width: 100% !important;
        position: absolute;
    }
    
    .select2-results__options {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .select2-results__option {
        padding: 0.85rem 1rem; /* Slightly larger tap targets */
        font-size: 1rem;
    }
    
    .select2-container--default .select2-selection--single {
        height: 50px; /* Better for touch */
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 48px;
    }
}

/* Global Sorting Removal */
.sorting, .sorting_asc, .sorting_desc, .sorting_disabled {
    background-image: none !important;
}
table.dataTable thead th:after, 
table.dataTable thead th:before,
table.dataTable thead td:after,
table.dataTable thead td:before {
    display: none !important;
    content: "" !important;
}
.dt-column-order {
    display: none !important;
}

/* Ensure Navbar Links never show sorting indicators */
.sm-navbar a::before,
.sm-navbar a::after,
.sm-nav-links a::before,
.sm-nav-links a::after,
.sm-link::before,
.sm-link::after {
    content: none !important;
    display: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-top: 1px solid #edf2f7;
    padding: 1rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand h3 {
    display: none;
}

.footer-brand p {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #10b981;
}

.footer-copy {
    color: #a0aec0;
    font-size: 0.8rem;
    margin: 0;
}

/* Contests Page */
.contests-hero {
    margin-bottom: 2rem;
    padding: 1.4rem;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
}

.contests-title {
    margin-bottom: 0.35rem;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.2;
}

.contests-subtitle {
    color: #64748b;
    margin-bottom: 1rem;
}

.contests-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.contests-overview-item {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.contests-overview-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f766e;
}

.contests-overview-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.contest-section {
    margin-top: 2rem;
}

.contest-card-grid {
    margin-bottom: 0.5rem;
}

.contest-card {
    cursor: pointer;
    border: 1px solid #dbeafe;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

.contest-card:hover {
    border-color: #86efac;
}

.contest-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.contest-card-header h3 {
    margin: 0;
    line-height: 1.3;
}

.contest-status {
    flex-shrink: 0;
}

.contest-description {
    margin-bottom: 0.8rem;
}

.contest-timeline {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
}

.contest-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.contest-meta-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
}

.contest-meta-item .text-secondary {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.contest-meta-item strong {
    font-size: 0.9rem;
}

.contest-empty {
    text-align: center;
    padding: 3rem 1rem;
}

@media (max-width: 768px) {
    .contests-hero {
        padding: 1rem;
    }

    .contests-overview {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .contest-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .contest-meta-grid {
        grid-template-columns: 1fr;
    }
}
