/* ===== GLOBAL RESET ===== */
/* Width */
::-webkit-scrollbar {
    width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background: #0d0d0d; 
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 5px;
    border: 2px solid #0d0d0d; /* Creates padding effect */
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #4db8ff; /* Turns blue when you grab it */
}
::selection {
    background: rgba(32, 201, 151, 0.3); /* Teal tint */
    color: #fff;
    text-shadow: 0 0 8px rgba(32, 201, 151, 0.5);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Balthazar', serif !important;
}

body {
    background-color: #0d0d0d;
    /* Adds a very subtle blue gradient light at the top center */
    background-image: radial-gradient(circle at 50% 0%, #1a2a3a 0%, #0d0d0d 60%);
    background-attachment: fixed; /* Keeps the glow at the top when scrolling */
    color: #eee;
    line-height: 1.75;
    padding: 40px;
}
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(32, 201, 151, 0.08), transparent 40%);
    z-index: -1;
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
}
@keyframes rotateBg { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* ===== NAVIGATION BAR ===== */
nav {
    /* Keep your existing nav styles (width, padding, etc.) */
    position: sticky; /* Makes the nav stay at the top */
    top: 0;
    z-index: 1000;
    background: rgba(12, 12, 12, 0.95); /* Slightly darker/opaque for sticky effect */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); /* Subtle shadow when sticky */
    
    /* Remove the old 'border-bottom: 1px solid rgba(255, 255, 255, 0.1);' */
    border-bottom: 1px solid transparent;
    box-sizing: border-box; /* Ensure padding doesn't affect width */

    /* Create the gradient border effect */
    border-image: linear-gradient(90deg, #19A4FF, #20C997) 1;
    border-image-slice: 1;
    border-width: 1px;
}

nav h2 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg, #19A4FF, #20C997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav a {
    color: #ccc;
    text-decoration: none;
    margin-left: 20px;
    transition: 0.3s ease;
}

nav a:hover {
    color: white;
}

/* ===== HERO SECTION ===== */
.hero {
    width: 100%;
    padding: 140px 20px;
    background: linear-gradient(135deg, #0074FF, #00D4A0);
    text-align: center;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -2px;
    color: white;
    animation: fadeIn 1.2s ease;
}

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

/* ===== PROBLEM LIST ===== */
ul {
    list-style: none;
    max-width: 800px;
    margin: 40px auto;
    padding: 0;
}

ul li a {
    display: block;
    background: #151515;
    padding: 18px 22px;
    margin-bottom: 12px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: 0.3s ease;
}

ul li a:hover {
    border-color: #00C9A7;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 255, 200, 0.15);
}

/* ===== PROBLEM PAGE STYLING ===== */
.problem-container {
    max-width: 960px; /* INCREASED FROM 800px */
    margin: 40px auto;
    padding: 30px;
    background: #141414;
    border-radius: 18px; /* INCREASED ROUNDNESS */
    border: 1px solid #222;
}

.problem-container h1 {
    font-size: 32px;
    margin-bottom: 15px;
}

.problem-container p {
    margin: 10px 0;
    font-size: 18px;
}

/* ===== BACK LINK ===== */
.back-link {
    display: inline-block;
    margin-top: 20px;
    text-decoration: none;
    color: #19A4FF;
    font-weight: 600;
    transition: 0.2s ease;
}

.back-link:hover {
    color: #20C997;
}

a {
    color: #4db8ff;
    font-size: 1.1rem;
    text-decoration: none; /* Remove default underline */
    position: relative; /* Needed for the pseudo-element */
}

a:hover {
    color: #82d1ff;
}

/* The Animated Underline */
a::after {
    content: '';
    position: absolute;
    width: 0; /* Starts hidden */
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, #19A4FF, #20C997); /* Gradient color */
    transition: width 0.3s ease-out; /* Animation speed */
}

a:hover::after {
    width: 100%; /* Slides in completely on hover */
}

/* ===== SECTION STYLING ===== */
/* ===== PROBLEM PAGE STYLING ===== */

/* ===== SECTION STYLING ===== */
.section {
    background: rgba(22, 22, 22, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 25px;
    border-radius: 18px; /* INCREASED ROUNDNESS */
    margin-bottom: 25px;
    /* ... rest of existing rules ... */
}

.section:hover {
    transform: translateY(-4px); /* Lifts up */
    border-color: rgba(77, 184, 255, 0.3); /* Border turns blueish */
    box-shadow: 0 12px 40px rgba(0, 116, 255, 0.15); /* Soft Blue Glow */
}

.info-row {
    display: flex;            /* Enables side-by-side layout */
    align-items: baseline;    /* Aligns text relative to the first line of text */
    margin-bottom: 15px;      /* Replaces your old <br> spacing */
}

/* Update your existing .section b rule to this */
.section b {
    display: inline-block;
    width: 180px;
    flex-shrink: 0;           /* CRITICAL: Prevents the label from getting squished */
    font-weight: 700;
    color: #4db8ff;
}

blockquote {
    margin: 20px 0;
    padding: 15px 25px;
    border-left: 5px solid #20C997; /* Strong teal accent line */
    background: rgba(32, 201, 151, 0.05); /* Very subtle background color */
    font-style: italic;
    color: #cfcfcf;
    border-radius: 4px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}
/* Optional: Ensure the text takes up the rest of the space */
.info-row span {
    display: block;
    flex: 1;                  /* Takes up all remaining width */
}

/* ===== OPTIONS / MATH ===== */
.options {
    font-size: 1.2rem;
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(25, 164, 255, 0.05) 0%, transparent 70%);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* ===== DIFFICULTY / IDEAL TIME ===== */
.ideal-time {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ideal-time b {
    display: inline-block;
    width: 140px;
    font-weight: 700;
}

.ideal-list {
    margin: 0;
    padding-left: 30px;
    line-height: 1.4;
}

/* ===== DIFFICULTY CONTAINER ===== */
.difficulty-container {
    margin-top: 40px;
    padding: 30px 35px;
    background: #161616;
    border-radius: 14px;
    border: 1px solid #222;
    box-shadow: 0 0 18px rgba(0,0,0,0.30);
}

.difficulty-container h2 {
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
    color: #4db8ff;
}

.difficulty-row {
    display: grid;
    grid-template-columns: 80px 160px 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #252525;
}

.difficulty-row:last-child {
    border-bottom: none;
}

.range {
    font-weight: 700;
    color: #82d1ff;
}

.label {
    font-weight: 600;
    color: #eaeaea;
}

.desc {
    color: #cfcfcf;
    line-height: 1.5;
}

/* ===== MATHJAX FIXES ===== */
/* LaTeX look & alignment */
mjx-container,
mjx-container * {
    font-family: "Computer Modern", "CMU Serif", serif !important;
}

mjx-container:not([display]) {
    font-size: 1em !important;
    vertical-align: -0.12em !important; /* inline math baseline tweak */
    line-height: 1.1 !important;
}

mjx-container[display] {
    font-size: 1.1em !important;
    margin: 0.6em 0 !important;
    text-align: center !important;
    vertical-align: baseline !important;
}

mjx-container mjx-mfrac,
mjx-container mjx-msubsup,
mjx-container mjx-munder,
mjx-container mjx-mover {
    font-size: 0.97em !important;
}
/* ===== HOVER EXAMPLE POPUPS ===== */

/* 1. Make the label the reference point for positioning */
.difficulty-row .label {
    position: relative; 
    cursor: help; /* Changes cursor to a question mark */
    text-decoration: underline dotted #4db8ff; /* Subtle hint that it's interactive */
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.difficulty-row .label:hover {
    color: #4db8ff; /* Light up the label on hover */
}

/* 2. The Hidden Popover Card */
.example-popover {
    visibility: hidden;
    opacity: 0;
    
    /* Position styling */
    position: absolute;
    bottom: 140%;       /* Moves it above the text */
    left: 50%;          /* Centers it horizontally */
    transform: translateX(-50%) translateY(10px); /* Start slightly lower for animation */
    
    /* Box Styling */
    width: 320px;       /* Width of the popup */
    background: rgba(15, 15, 15, 0.95); /* Dark background */
    border: 1px solid rgba(77, 184, 255, 0.3); /* Blue border */
    backdrop-filter: blur(10px); /* Glass blur */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 9999;      /* Ensure it sits on top of everything */
    
    /* Text Styling inside the card */
    color: #eee;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    font-weight: 400;
    
    /* Animation settings */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none; /* Prevents mouse flickering */
}

/* 3. The Arrow pointing down (Optional cosmetic) */
.example-popover::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(77, 184, 255, 0.3) transparent transparent transparent;
}

/* 4. Show the card on hover */
.difficulty-row .label:hover .example-popover {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* Float up into place */
}

/* 5. Highlight the Source Title */
.popover-title {
    display: block;
    color: #20C997;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}
/* ===== DASHBOARD LAYOUT ===== */
.hero-header {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-container {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

/* Sidebar Styling */
.dashboard-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-sidebar h3 {
    font-size: 0.9rem;
    color: #4db8ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    margin-top: 20px; /* Spacing for second header */
}
.dashboard-sidebar h3:first-child { margin-top: 0; }

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1;
}

.stat-label {
    color: #888;
    font-size: 0.85rem;
}

/* Legend Styling */
.legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    font-size: 0.85rem;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== GRID STYLING ===== */
.dashboard-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 Columns */
    gap: 15px;
}

.grid-item {
    aspect-ratio: 1 / 1; /* Perfect Square */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    text-decoration: none;
    background: #1a1a1a; /* Fallback */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.grid-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 14px 28px rgba(0,0,0,0.5);
    z-index: 2;
}

/* The Problem Number (01, 02...) */
.p-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

/* The Difficulty Badge (The small number) */
.diff-badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.4); /* Dark pill background */
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== DIFFICULTY COLOR MAP ===== */
/* Each class sets the background color and glow */

/* 0-10: Very Easy (Cyan) */
.d-0, .dot.d-0 { background: rgba(0, 212, 255, 0.15); border-color: rgba(0, 212, 255, 0.3); }
.dot.d-0 { background: #00d4ff; }
.d-0:hover { background: rgba(0, 212, 255, 0.8); }

/* 11-20: Easy (Teal) */
.d-11, .dot.d-11 { background: rgba(32, 201, 151, 0.15); border-color: rgba(32, 201, 151, 0.3); }
.dot.d-11 { background: #20C997; }
.d-11:hover { background: rgba(32, 201, 151, 0.8); }

/* 21-35: Easy-Med (Lime Green) */
.d-21, .dot.d-21 { background: rgba(163, 230, 53, 0.15); border-color: rgba(163, 230, 53, 0.3); }
.dot.d-21 { background: #a3e635; }
.d-21:hover { background: rgba(163, 230, 53, 0.8); }

/* 36-50: Medium (Yellow) */
.d-36, .dot.d-36 { background: rgba(250, 204, 21, 0.15); border-color: rgba(250, 204, 21, 0.3); }
.dot.d-36 { background: #facc15; }
.d-36:hover { background: rgba(250, 204, 21, 0.9); }

/* 51-65: Med-Hard (Orange) */
.d-51, .dot.d-51 { background: rgba(251, 146, 60, 0.15); border-color: rgba(251, 146, 60, 0.3); }
.dot.d-51 { background: #fb923c; }
.d-51:hover { background: rgba(251, 146, 60, 0.9); }

/* 66-80: Hard (Red-Orange) */
.d-66, .dot.d-66 { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.3); }
.dot.d-66 { background: #f87171; }
.d-66:hover { background: rgba(248, 113, 113, 0.9); }

/* 81-90: Very Hard (Red) */
.d-81, .dot.d-81 { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }
.dot.d-81 { background: #ef4444; }
.d-81:hover { background: rgba(239, 68, 68, 0.9); }

/* 91-100: Extreme (Purple) */
.d-91, .dot.d-91 { background: rgba(217, 70, 239, 0.15); border-color: rgba(217, 70, 239, 0.3); }
.dot.d-91 { background: #d946ef; }
.d-91:hover { background: rgba(217, 70, 239, 0.9); }

/* TBD / Placeholder */
.d-tbd { background: rgba(255, 255, 255, 0.02); opacity: 0.5; border-style: dashed; cursor: default; }

/* Mobile Response */
@media (max-width: 800px) {
    .dashboard-container { flex-direction: column; }
    .dashboard-sidebar { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; }
    .legend-list { display: grid; grid-template-columns: 1fr 1fr; }
}
.problem-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05); /* Slight box highlight */
    /* FIX 1: Solid, contrasting background color */
    background-color: #141414; /* Slightly lighter dark gray than the body */
    
    /* FIX 2: Highlighted Border */
    border: 1px solid rgba(77, 184, 255, 0.2); /* Subtle blue line */

    /* FIX 3: Soft Glow (Optional) */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5); /* Deep shadow */
    border-radius: 12px;
}

.problem-diagram img, 
.problem-diagram svg {
    max-width: 100%;
    height: auto;
    /* Inverts colors if you use a standard black-on-white SVG, 
       but I already colored the SVG code above for dark mode. */
}
/* Update your .analysis-dashboard and .info-card styles */

.analysis-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 40px;
}

.info-card {
    background: linear-gradient(145deg, #161616, #0f0f0f); /* Subtle gradient */
    border: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, border-color 0.2s;
    height: 100%;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.info-card h4 {
    color: #888;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
    display: flex; justify-content: space-between;
}

/* Make the text content look editorial */
.text-content {
    font-family: 'Inter', sans-serif; /* Clean sans */
    color: #d1d5db;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Specific styling for the Trap Card to make it pop */
.trap-card {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.2);
    position: relative;
    overflow: hidden;
}

/* Add a subtle warning strip */
.trap-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; background: #ef4444;
}
