/* =============================================================
   CodeForge — Problems List Stylesheet (Light Warm Theme)
   Matches the warm cream/amber gradient mockup design.
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   0. RESET LOCAL OVERRIDES — force light palette for this page
   ───────────────────────────────────────────────────────────── */
body.mesh-background {
    background:
        radial-gradient(ellipse at 0% 0%,   #b8d9f4 0%, transparent 50%),
        radial-gradient(ellipse at 100% 80%, #f5bf5a 0%, transparent 50%),
        radial-gradient(ellipse at 60% 100%, #f0c97e 0%, transparent 40%),
        #f0ebe1;
    background-attachment: fixed;
    min-height: 100vh;

    /* Override dark-mode tokens inline for this page */
    --bg-primary:    #f5efe6;
    --bg-secondary:  #ede8df;
    --bg-elevated:   #ffffff;
    --bg-card:       rgba(255, 255, 255, 0.72);

    --text-primary:   #111111;
    --text-secondary: #444444;
    --text-muted:     #888888;

    --border:       #d6d0c7;
    --border-hover: #bcb6ae;

    --glass-bg:     rgba(255, 255, 255, 0.45);
    --glass-border: rgba(0, 0, 0, 0.08);

    --accent-primary:   #111111;
    --accent-secondary: #666666;
    --accent-gradient:  linear-gradient(135deg, #111111 0%, #444444 100%);

    --shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.06);
    --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.09);
    --shadow-lg:  0 16px 40px rgba(0, 0, 0, 0.12);

    color: #111111;
}



/* ─────────────────────────────────────────────────────────────
   2. PAGE LAYOUT — unified canvas and two-column grid
   ───────────────────────────────────────────────────────────── */
.problems-page-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 40px 48px 80px;
    animation: fadeInUp 0.7s ease-out both;
}

.problems-canvas {
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.07);
}

.problems-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    padding: 40px 48px;
    align-items: start;
}

/* ─────────────────────────────────────────────────────────────
   3. MAIN COLUMN — header + table
   ───────────────────────────────────────────────────────────── */
.problems-main-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.problems-header {
    margin-bottom: var(--space-xs);
}

.main-title {
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: #111111;
    margin-bottom: 8px;
}

.subtitle {
    color: #555555;
    font-size: 1rem;
    font-weight: 400;
}

/* Sort controls row */
.problems-stats {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: var(--space-sm);
}

.sort-label {
    color: #666;
    font-size: 0.875rem;
    margin-right: 8px;
}

/* ─────────────────────────────────────────────────────────────
   4. PROBLEMS TABLE — borderless, spacious, clean separators
   ───────────────────────────────────────────────────────────── */
.problems-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.problems-table th {
    padding: 12px 12px 12px 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #111111;
    border-bottom: 1px solid #cccccc;
    white-space: nowrap;
}

.problems-table td {
    padding: 18px 12px 18px 0;
    vertical-align: middle;
    border-bottom: 1px solid #e8e3da;
    color: #111111;
    font-size: 0.95rem;
}

.table-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.table-row:hover td {
    background: rgba(0, 0, 0, 0.025);
}

.problems-table tbody tr:last-child td {
    border-bottom: none;
}

/* ID column */
.problem-id a {
    color: #555555;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

/* Title column */
.problem-title a {
    color: #111111;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.problem-title a:hover {
    color: #555555;
}

/* Score column */
.score {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #333333;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────────
   5. DIFFICULTY BADGES — thin outline pill, no background
   ───────────────────────────────────────────────────────────── */
.difficulty-badge,
.difficulty {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    background: transparent !important;
    border: 1.5px solid currentColor !important;
}

/* Easy — green outline */
.difficulty-easy,
.difficulty.easy {
    color: #1a7a3a !important;
    border-color: #1a7a3a !important;
}

/* Medium — amber/orange outline */
.difficulty-medium,
.difficulty.medium {
    color: #b45309 !important;
    border-color: #b45309 !important;
}

/* Hard — red outline */
.difficulty-hard,
.difficulty.hard {
    color: #b91c1c !important;
    border-color: #b91c1c !important;
}

/* ─────────────────────────────────────────────────────────────
   6. TAG PILLS — thin dark outline
   ───────────────────────────────────────────────────────────── */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill,
.outline-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #333333;
    background: transparent;
    border: 1.5px solid #999999;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.tag-pill:hover,
.outline-badge:hover {
    border-color: #333333;
    color: #111111;
}

/* ─────────────────────────────────────────────────────────────
   7. ACTION BUTTON — circular thin-border arrow
   ───────────────────────────────────────────────────────────── */
.action-cell {
    text-align: right;
    padding-right: 0 !important;
    width: 56px;
}

.action-btn.circular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid #999999;
    background: transparent;
    color: #333333;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.action-btn.circular:hover {
    border-color: #111111;
    background: #111111;
    color: #ffffff;
    transform: scale(1.08);
}

/* ─────────────────────────────────────────────────────────────
   8. SIDEBAR — floating glassmorphism filter card
   ───────────────────────────────────────────────────────────── */
.problems-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.filters-card {
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filters-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111111;
    margin-bottom: 4px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Search field wrapper */
.search-group {
    position: relative;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #d4cec5;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111111;
    font-size: 0.9rem;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-input::placeholder {
    color: #aaaaaa;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #888888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* Custom chevron for select */
.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' 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 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Search icon inside search input */
.search-icon-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.search-icon-btn:hover {
    color: #333333;
}

/* Search input extra right padding for the icon */
.search-input {
    padding-right: 44px;
}

/* Sidebar action buttons */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.filter-btn {
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    text-align: center;
    width: 100%;
}

/* "Apply Filters" — solid dark */
.filter-btn.solid {
    background: #111111;
    color: #ffffff;
    border: 1.5px solid #111111;
}

.filter-btn.solid:hover {
    background: #333333;
    border-color: #333333;
    transform: translateY(-1px);
}

/* "Clear All" — outlined */
.filter-btn.outline {
    background: transparent;
    color: #111111;
    border: 1.5px solid #bbbbbb;
}

.filter-btn.outline:hover {
    border-color: #111111;
    background: rgba(0, 0, 0, 0.04);
}

/* ─────────────────────────────────────────────────────────────
   9. EMPTY STATE
   ───────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: #888888;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ─────────────────────────────────────────────────────────────
   10. RESPONSIVE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .problems-layout {
        grid-template-columns: 1fr;
        padding: var(--space-lg) var(--space-xl);
    }

    .problems-sidebar {
        position: static;
        order: -1;
    }

    .filters-card {
        padding: 20px;
    }

    body.mesh-background .navbar-actions {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .problems-layout {
        padding: var(--space-md);
    }

    .main-title {
        font-size: 2.4rem;
    }

    .problems-table th,
    .problems-table td {
        padding: 12px 8px 12px 0;
        font-size: 0.85rem;
    }
}