/* Problems Page Styles */

.page-header {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-tertiary) 100%);
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.problems-section {
    padding: 3rem 0;
    min-height: 100vh;
}

.problems-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group:last-of-type {
    margin-bottom: 1rem;
}

.filter-group h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--green-primary);
}

.filter-checkbox .count {
    margin-left: auto;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Codeforces Rank Colors */
.cf-newbie {
    color: #808080;
    font-weight: 600;
}

.cf-pupil {
    color: #008000;
    font-weight: 600;
}

.cf-specialist {
    color: #03a89e;
    font-weight: 600;
}

.cf-expert {
    color: #0000ff;
    font-weight: 600;
}

.cf-cm {
    color: #aa00aa;
    font-weight: 600;
}

.cf-master {
    color: #ff8c00;
    font-weight: 600;
}

.cf-grandmaster {
    color: #ff0000;
    font-weight: 600;
}

[data-theme="dark"] .cf-newbie {
    color: #cccccc;
}

[data-theme="dark"] .cf-pupil {
    color: #77ff77;
}

[data-theme="dark"] .cf-specialist {
    color: #77ddbb;
}

[data-theme="dark"] .cf-expert {
    color: #aaaaff;
}

[data-theme="dark"] .cf-cm {
    color: #ff88ff;
}

[data-theme="dark"] .cf-master {
    color: #ffbb55;
}

[data-theme="dark"] .cf-grandmaster {
    color: #ff6666;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* Problems Content */
.problems-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.problems-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--green-primary);
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
}

.sort-select:focus {
    outline: none;
    border-color: var(--green-primary);
}

/* Problems Table */
.problems-table {
    overflow-x: auto;
}

.problems-table table {
    width: 100%;
    border-collapse: collapse;
}

.problems-table thead {
    background: var(--bg-tertiary);
}

.problems-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.problems-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.problems-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.problems-table td {
    padding: 1rem;
    color: var(--text-secondary);
}

.problems-table td:first-child {
    text-align: center;
    width: 60px;
}

.problems-table .fa-check-circle.solved {
    color: var(--green-primary);
    font-size: 1.2rem;
}

.problems-table .fa-circle.attempted {
    color: #fbbf24;
    font-size: 0.7rem;
}

.problems-table .fa-circle.unsolved {
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

.problem-title {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.problem-title:hover {
    color: var(--green-primary);
}

.problem-title.pro-badge .fa-crown {
    color: #fbbf24;
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-easy {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .badge-easy {
    background: #052e16;
    color: #bbf7d0;
}

.badge-medium {
    background: #fed7aa;
    color: #7c2d12;
}

[data-theme="dark"] .badge-medium {
    background: #431407;
    color: #fed7aa;
}

.badge-hard {
    background: #fecaca;
    color: #7f1d1d;
}

[data-theme="dark"] .badge-hard {
    background: #450a0a;
    color: #fecaca;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
}

.page-btn.active {
    background: var(--green-primary);
    color: white;
    border-color: var(--green-primary);
}

/* Responsive */
@media (max-width: 968px) {
    .problems-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .problems-toolbar {
        flex-direction: column;
    }
    
    .problems-table {
        font-size: 0.875rem;
    }
    
    .problems-table th,
    .problems-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .tag {
        display: none;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}
