:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
}

.dashboard-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* ─── Header ───────────────────────────────────── */
header { padding: 1.5rem 2rem; }

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ─── Celebration Banner & Confetti ─────────────── */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.celebration-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(16, 185, 129, 0.15), rgba(255, 215, 0, 0.15));
    background-size: 200% 200%;
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.4), inset 0 0 30px rgba(255, 215, 0, 0.2);
    padding: 3rem 4rem;
    animation: celebrationPulse 2s infinite alternate, fadeIn 0.6s ease-in-out, shimmer 5s ease infinite;
    position: relative;
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    border-radius: 24px;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}
.close-btn:hover {
    color: #fff;
}

.celebration-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
    animation: rotateGlow 10s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.celebration-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.celebration-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, #f59e0b, #10b981);
    color: #0f172a;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
}

.celebration-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fbbf24, #fcd34d, #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: none;
    padding-bottom: 0;
    animation: shine 3s linear infinite;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    margin: 0.5rem 0;
}

.celebration-content p {
    color: #f8fafc;
    font-size: 1.2rem;
    font-weight: 500;
}

.glory-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
    border: 1px solid #fcd34d;
    transition: all 0.3s ease;
}

.glory-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.15rem;
    border-radius: 12px;
}

.dramatic-notes {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    max-width: 800px;
}

.dramatic-text {
    font-style: italic;
    font-size: 1.15rem !important;
    line-height: 1.6;
    color: #fcd34d !important;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fbbf24;
    border-color: #fbbf24;
}

.download-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shine {
    to { background-position: 200% center; }
}

@keyframes celebrationPulse {
    0% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255, 215, 0, 0.1); }
    100% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.6), inset 0 0 30px rgba(255, 215, 0, 0.3); }
}

/* ─── Flat Two-Column Grid ─────────────────────── */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .main-content { grid-template-columns: 1fr; }
}

/* ─── Cards ────────────────────────────────────── */
.card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h2, h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
}

.highlight-text { color: var(--accent-hover); }

/* ─── Selector Row ─────────────────────────────── */
.selector-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.selector-row h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
    white-space: nowrap;
}

.custom-select {
    appearance: none;
    background-color: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 260px;
}

.custom-select:hover,
.custom-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ─── Progress Section ─────────────────────────── */
.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar-container {
    flex: 1;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.progress-label {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 55px;
    text-align: right;
}

/* ─── Visual Diagrams ──────────────────────────── */
.visual-diagram-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.visual-diagram {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.5s ease;
}

/* ─── Notes List ───────────────────────────────── */
.notes-list {
    list-style-position: inside;
    list-style-type: disc;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notes-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

/* ─── Badge ────────────────────────────────────── */
.badge {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-hover);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    vertical-align: middle;
    margin-left: 0.5rem;
}

.progress-explainer {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Stat Pills ───────────────────────────────── */
.progress-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-pill {
    flex: 1;
    min-width: 110px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.stat-pill strong {
    color: var(--text-main);
    font-size: 1.05rem;
}

.stat-pill-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* ─── Hidden compare state ─────────────────────── */
.card.hidden-card {
    visibility: hidden;
    pointer-events: none;
}

.empty-compare {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.empty-compare .empty-icon { font-size: 2.5rem; }

/* ─── Add Button ───────────────────────────────── */
.add-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    border: none;
    padding: 0.65rem 1.3rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* ─── Modal ────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal h2 {
    font-size: 1.3rem;
    border-bottom: none;
    padding-bottom: 0;
}

.modal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus { border-color: var(--accent); }

.modal-textarea { resize: vertical; line-height: 1.5; }

.error-text {
    color: var(--danger);
    font-size: 0.85rem;
    min-height: 1.2em;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
}

.btn-primary:hover { box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover { border-color: var(--text-muted); }

/* ─── Upload Area ──────────────────────────────── */
.upload-area {
    position: relative;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-area:hover { border-color: var(--accent); }

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--text-muted);
}

.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

/* ─── Utils ────────────────────────────────────── */
.fade-in { animation: fadeIn 0.5s ease-in-out; }

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