/* =========================================
   PROBLEMS PAGE — problems.css
   ========================================= */

/* ---- Page Layout ---- */
.problems-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* ---- Page Header ---- */
.problems-page-header {
    background: linear-gradient(180deg, rgba(231, 111, 81, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3rem 0 2rem;
}

.page-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.page-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
    max-width: 440px;
}

.problems-stats-bar {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    min-width: 80px;
}

.stat-pill-solved {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.15);
}

.stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1;
}

.stat-pill-solved .stat-num {
    color: #22c55e;
}

.stat-lbl {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Body Layout ---- */
.problems-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
    align-items: start;
}

@media (max-width: 900px) {
    .problems-body {
        display: flex;
        flex-direction: column;
    }

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

    .problems-stats-bar {
        justify-content: center;
        width: 100%;
    }
}

/* ---- Filter Sidebar ---- */
.filter-sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

.filter-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    padding: 1.25rem;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.75rem;
}

/* Search */
.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-size: 0.8rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.6rem;
    padding: 0.65rem 0.9rem 0.65rem 2.4rem;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: rgba(231, 111, 81, 0.5);
    box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.1);
}

.search-input::placeholder {
    color: #334155;
}

/* Difficulty Buttons */
.diff-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.diff-btn {
    width: 100%;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #64748b;
    transition: all 0.2s ease;
    text-align: left;
    font-family: 'Inter', sans-serif;
}

.diff-btn:hover,
.diff-btn.active {
    background: rgba(231, 111, 81, 0.1);
    border-color: rgba(231, 111, 81, 0.3);
    color: var(--primary-color);
}

.diff-easy-btn.active {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.diff-medium-btn.active {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.diff-hard-btn.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Category Chips */
.filter-chips {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-align: left;
    width: 100%;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.chip.active {
    background: rgba(231, 111, 81, 0.1);
    border-color: rgba(231, 111, 81, 0.25);
    color: var(--primary-color);
}

.chip i {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* ---- Results Bar ---- */
.results-bar {
    margin-bottom: 1rem;
}

.results-label {
    font-size: 0.82rem;
    color: #475569;
}

/* ---- Problems Grid ---- */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

@media (min-width: 1200px) {
    .problems-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .problems-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Problem Card ---- */
.problem-card {
    --mx: 50%;
    --my: 50%;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        rgba(10, 16, 35, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 1rem;
    padding: 1.35rem;
    cursor: default;
    transition: transform 0.24s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    animation: cardFadeIn 0.35s ease forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.problem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #f4a261 60%, transparent);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: scaleX(0.75);
    transform-origin: left;
}

.problem-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(220px circle at var(--mx) var(--my),
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.card-bg-pattern {
    position: absolute;
    width: 140px;
    height: 140px;
    right: -48px;
    top: -48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 111, 81, 0.22), rgba(231, 111, 81, 0));
    z-index: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0.78;
}

.problem-card>*:not(.card-bg-pattern) {
    position: relative;
    z-index: 1;
}

.problem-card:hover {
    border-color: rgba(231, 111, 81, 0.45);
    background: rgba(231, 111, 81, 0.06);
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.48), 0 0 0 1px rgba(231, 111, 81, 0.12);
}

.problem-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.problem-card:hover::after {
    opacity: 1;
}

.problem-card:hover .card-bg-pattern {
    transform: scale(1.16);
    opacity: 1;
}

/* Card top row */
.card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-meta-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.card-num {
    font-family: 'Fira Code', monospace;
    font-size: 0.73rem;
    color: #94a3b8;
    font-weight: 600;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.15rem 0.48rem;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid;
}

.status-chip.solved {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.11);
}

.status-chip.unsolved {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.42);
}

.card-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Card title */
.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
    transition: color 0.2s, transform 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.problem-card:hover .card-title {
    color: #ffffff;
    transform: translateX(1px);
}

.card-concept {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #8fa1bb;
    line-height: 1.5;
}

.card-concept i {
    margin-top: 0.22rem;
    color: #f4a261;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.card-concept span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-skill-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.track-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: transform 0.3s ease;
    transform-origin: left;
}

.track-easy {
    width: 38%;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(34, 197, 94, 0.48));
}

.track-medium {
    width: 66%;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(245, 158, 11, 0.48));
}

.track-hard {
    width: 92%;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(239, 68, 68, 0.48));
}

.problem-card:hover .track-fill {
    transform: scaleX(1.03);
}

/* Card footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    text-decoration: none;
    border-radius: 0.55rem;
    padding: 0.5rem 0.7rem;
    font-weight: 600;
    border: 1px solid;
    transition: all 0.2s ease;
    flex: 1;
}

.card-action-read {
    color: #d5e5f8;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.12);
}

.card-action-open {
    color: #ffd7ca;
    border-color: rgba(231, 111, 81, 0.35);
    background: rgba(231, 111, 81, 0.15);
}

.card-action-btn:hover {
    transform: translateY(-1px);
}

.card-action-read:hover {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.2);
}

.card-action-open:hover {
    color: #ffffff;
    border-color: rgba(231, 111, 81, 0.56);
    background: rgba(231, 111, 81, 0.26);
}

@media (max-width: 520px) {
    .card-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---- Status / Difficulty / Category badges ---- */
.diff-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    backdrop-filter: blur(2px);
}

.diff-easy {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.diff-medium {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.diff-hard {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}

.cat-array {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.08);
}

.cat-linked-list {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.25);
    background: rgba(167, 139, 250, 0.08);
}

.cat-tree {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.25);
    background: rgba(74, 222, 128, 0.08);
}

.cat-graph {
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.25);
    background: rgba(251, 146, 60, 0.08);
}

.cat-hashmap {
    color: #f472b6;
    border-color: rgba(244, 114, 182, 0.25);
    background: rgba(244, 114, 182, 0.08);
}

.cat-stack-queue {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
}

.cat-custom {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.08);
}

/* Status dot on card */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.solved {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
    animation: solvedPulse 1.8s ease-in-out infinite;
}

.status-dot.unsolved {
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.38);
}

@keyframes solvedPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
    }
}

@media (max-width: 700px) {
    .card-top-row {
        gap: 0.6rem;
    }

    .card-badges {
        justify-content: flex-start;
    }
}

/* ---- No Results ---- */
.no-results {
    text-align: center;
    padding: 5rem 2rem;
    color: #475569;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.4;
}

.no-results p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ===================================================
   SINGLE PROBLEM PAGE — CLEAN FOCUSED LAYOUT
   =================================================== */

.single-problem-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.single-problem-main {
    flex: 1;
    margin-top: 80px;
    padding: 3rem 0 5rem;
}

.problem-focus-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 2.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Problem hero */
.problem-hero {
    margin-bottom: 2.5rem;
}

.problem-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.problem-focus-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 1rem;
    line-height: 1.15;
}

.problem-real-world {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(231, 111, 81, 0.07);
    border: 1px solid rgba(231, 111, 81, 0.18);
    color: #f4a261;
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.problem-real-world i {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Divider */
.section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 2rem 0;
}

/* Description section */
.problem-description-block {
    margin-bottom: 2rem;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.problem-description-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #94a3b8;
}

/* Statement box */
.problem-statement {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--primary-color);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.98rem;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

/* Examples */
.problem-examples {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.example-block {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.example-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.example-block code {
    font-family: 'Fira Code', monospace;
    font-size: 0.88rem;
    color: #94a3b8;
    white-space: pre-wrap;
    display: block;
    line-height: 1.6;
}

/* Platform links */
.platform-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-link-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.platform-links-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
    border: 1px solid;
    flex: 1;
    min-width: 160px;
    justify-content: center;
}

.platform-btn-leetcode {
    background: rgba(255, 161, 22, 0.08);
    border-color: rgba(255, 161, 22, 0.25);
    color: #ffa116;
}

.platform-btn-leetcode:hover {
    background: rgba(255, 161, 22, 0.15);
    border-color: rgba(255, 161, 22, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 161, 22, 0.15);
}

.platform-btn-codeforces {
    background: rgba(30, 155, 215, 0.08);
    border-color: rgba(30, 155, 215, 0.25);
    color: #1e9bd7;
}

.platform-btn-codeforces:hover {
    background: rgba(30, 155, 215, 0.15);
    border-color: rgba(30, 155, 215, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 155, 215, 0.15);
}

.platform-btn-external {
    background: rgba(231, 111, 81, 0.08);
    border-color: rgba(231, 111, 81, 0.25);
    color: var(--primary-color);
}

.platform-btn-external:hover {
    background: rgba(231, 111, 81, 0.15);
    border-color: rgba(231, 111, 81, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 111, 81, 0.15);
}

.platform-btn i {
    font-size: 1rem;
}

/* Sidebar single problem nav */
.custom-sidebar-panel {
    padding: 1.5rem;
}

/* Legacy compatibility */
.problems-table-wrapper,
.problems-table {
    display: none !important;
}
