﻿/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0b0f19;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(59,130,246,.25);
    padding: 0 24px;
}
.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    flex-wrap: wrap;
    gap: 12px;
}
.logo-area { display: flex; align-items: center; gap: 14px; }
.logo-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    display: grid; place-items: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(59,130,246,.35);
}
.header h1 {
    font-size: 1.35rem; font-weight: 700; color: #f1f5f9;
    display: flex; align-items: center; gap: 8px;
}
.canada-flag { font-size: 1.3rem; }
.subtitle { font-size: .82rem; color: #94a3b8; margin-top: 2px; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ===== Wizard Button ===== */
.wizard-btn {
    background: rgba(59,130,246,.08);
    border: 1px solid rgba(59,130,246,.18);
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    transition: all .25s ease;
    display: grid; place-items: center;
    position: relative;
    overflow: hidden;
}
.wizard-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(59,130,246,.3), transparent 70%);
    opacity: 0;
    transition: opacity .3s;
}
.wizard-btn:hover {
    border-color: rgba(59,130,246,.4);
    background: rgba(59,130,246,.12);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(59,130,246,.2);
}
.wizard-btn:hover::after { opacity: 1; }
.wizard-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* ===== Wizard Modal ===== */
.wizard-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    place-items: center;
    z-index: 1000;
    animation: fadeIn .3s ease;
}
.wizard-modal-overlay.active { display: grid; }
.wizard-modal {
    background: linear-gradient(160deg, rgba(30,41,59,.95), rgba(15,23,42,.98));
    border: 1px solid rgba(59,130,246,.25);
    border-radius: 20px;
    padding: 40px 36px 32px;
    text-align: center;
    max-width: 380px; width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 60px rgba(59,130,246,.15);
    animation: modalSlideIn .4s cubic-bezier(.34,1.56,.64,1);
}
.wizard-modal-img {
    width: 120px; height: 120px;
    border-radius: 16px; object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(59,130,246,.3);
    border: 2px solid rgba(59,130,246,.2);
}
.wizard-prompt {
    font-size: 1.3rem; font-weight: 700;
    color: #93c5fd;
    margin-bottom: 20px; letter-spacing: .5px;
}
.wizard-prompt.error { color: #f87171; animation: shake .4s ease; }
.wizard-input {
    width: 100%; padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(59,130,246,.25);
    background: rgba(15,23,42,.8);
    color: #e2e8f0;
    font: 500 .95rem 'Inter', sans-serif;
    text-align: center; outline: none;
    transition: border-color .2s, box-shadow .2s;
    margin-bottom: 16px;
}
.wizard-input:focus {
    border-color: rgba(59,130,246,.5);
    box-shadow: 0 0 16px rgba(59,130,246,.15);
}
.wizard-submit {
    width: 100%; padding: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff; font: 600 .9rem 'Inter', sans-serif;
    border: none; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.wizard-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(59,130,246,.4); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideIn { from { transform: scale(.85) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-8px); }
    40%,80% { transform: translateX(8px); }
}

/* Status pill */
.data-status {
    display: flex; align-items: center; gap: 6px;
    font-size: .78rem; font-weight: 500;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(59,130,246,.12);
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,.2);
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #60a5fa;
    animation: pulse-dot 2s ease-in-out infinite;
}
.data-status.loaded .status-dot { background: #34d399; animation: none; }
.data-status.loaded { color: #6ee7b7; border-color: rgba(52,211,153,.2); background: rgba(52,211,153,.1); }
.data-status.error .status-dot  { background: #f87171; animation: none; }
.data-status.error  { color: #fca5a5; border-color: rgba(248,113,113,.2); background: rgba(248,113,113,.1); }
@keyframes pulse-dot { 0%,100% { opacity:.4 } 50% { opacity:1 } }

/* ===== How-to Banner ===== */
.how-to-banner {
    background: rgba(59,130,246,.06);
    border-bottom: 1px solid rgba(59,130,246,.12);
    padding: 0 24px;
}
.how-to-content { max-width: 1280px; margin: 0 auto; }
.how-to-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 12px 0;
    background: none; border: none; color: #93c5fd;
    font: 500 .82rem/1.4 'Inter', sans-serif;
    cursor: pointer; text-align: left;
    transition: color .2s;
}
.how-to-toggle:hover { color: #bfdbfe; }
.how-to-toggle .chevron { transition: transform .25s ease; margin-left: auto; }
.how-to-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.how-to-details {
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
    padding: 0 0 0 26px;
    font-size: .8rem; color: #94a3b8; line-height: 1.65;
}
.how-to-details.open { max-height: 300px; padding-bottom: 14px; }
.how-to-details ul { margin: 6px 0 6px 18px; }
.how-to-details li { margin-bottom: 4px; }
.how-to-details code {
    background: rgba(59,130,246,.15); padding: 2px 6px;
    border-radius: 4px; font-size: .78rem; color: #bfdbfe;
}
.how-to-details strong { color: #cbd5e1; }

/* ===== Main Content ===== */
.main-content { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px 24px 48px; }

/* Loading */
.loading-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; padding: 80px 0;
    color: #94a3b8; font-size: .9rem;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(59,130,246,.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 0; color: #94a3b8; text-align: center; }
.retry-btn {
    margin-top: 8px; padding: 8px 20px; border-radius: 8px;
    background: linear-gradient(135deg,#2563eb,#3b82f6);
    color: #fff; font: 600 .82rem 'Inter',sans-serif;
    border: none; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.retry-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,.4); }

/* ===== Category Sections ===== */
.category-section { margin-bottom: 40px; }
.category-heading {
    font-size: 1.05rem; font-weight: 700; color: #93c5fd;
    margin-bottom: 18px; padding-bottom: 8px;
    border-bottom: 2px solid rgba(59,130,246,.2);
    display: flex; align-items: center; gap: 10px;
}
.category-heading .cat-count {
    font-size: .72rem; font-weight: 600;
    background: rgba(59,130,246,.18); color: #93c5fd;
    padding: 2px 9px; border-radius: 12px;
}

/* ===== Dashboard Cards ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.dash-card {
    background: linear-gradient(160deg, rgba(30,41,59,.85), rgba(15,23,42,.95));
    border: 1px solid rgba(59,130,246,.12);
    border-radius: 14px;
    padding: 24px;
    display: flex; flex-direction: column; gap: 12px;
    transition: transform .2s ease, border-color .2s, box-shadow .2s;
    position: relative; overflow: hidden;
}
.dash-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
    background-size: 200% 100%;
    opacity: 0; transition: opacity .3s;
}
.dash-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,.35); box-shadow: 0 12px 40px rgba(59,130,246,.12); }
.dash-card:hover::before { opacity: 1; animation: shimmer 2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Link cards â€” amber accent */
.dash-card.link-card::before { background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b); background-size: 200% 100%; }
.dash-card.link-card:hover { border-color: rgba(245,158,11,.35); box-shadow: 0 12px 40px rgba(245,158,11,.12); }

.card-title {
    font-size: 1.05rem; font-weight: 700; color: #f1f5f9;
    display: flex; align-items: center; gap: 8px;
}
.card-title .live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #34d399; flex-shrink: 0;
    box-shadow: 0 0 6px rgba(52,211,153,.5);
}
.link-card .card-title .live-dot { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,.5); }
.card-desc { font-size: .82rem; color: #94a3b8; line-height: 1.55; flex: 1; }
.card-meta { font-size: .72rem; color: #64748b; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-meta .lang-badge { background: rgba(59,130,246,.12); color: #93c5fd; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.card-meta .lang-badge.link-badge { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.15); }
.card-actions { display: flex; gap: 10px; margin-top: 4px; }
.card-actions a {
    flex: 1; text-align: center;
    padding: 9px 0; border-radius: 8px;
    font: 600 .8rem 'Inter', sans-serif;
    text-decoration: none; transition: all .15s;
}
.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border: none; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(59,130,246,.45); transform: translateY(-1px); }
.link-card .btn-primary { background: linear-gradient(135deg, #f59e0b, #d97706); }
.link-card .btn-primary:hover { box-shadow: 0 4px 16px rgba(245,158,11,.45); }
.btn-secondary { background: rgba(59,130,246,.08); color: #93c5fd; border: 1px solid rgba(59,130,246,.18); }
.btn-secondary:hover { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.3); }

/* Topics */
.card-topics { display: flex; gap: 6px; flex-wrap: wrap; }
.topic-tag {
    font-size: .68rem; font-weight: 500;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(59,130,246,.1); color: #93c5fd;
    border: 1px solid rgba(59,130,246,.15);
}

/* ===== Footer ===== */
.footer { text-align: center; padding: 20px 24px; font-size: .75rem; color: #475569; border-top: 1px solid rgba(59,130,246,.08); }
.footer a { color: #60a5fa; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .header h1 { font-size: 1.1rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .main-content { padding: 20px 14px 32px; }
    .how-to-banner { padding: 0 14px; }
    .header { padding: 0 14px; }
    .wizard-icon { width: 32px; height: 32px; }
    .wizard-modal { padding: 28px 24px 24px; }
    .wizard-modal-img { width: 90px; height: 90px; }
}


/* ============================================================
   ===== WINDOWS 95 RETRO THEME  (active on hidden tab) =====
   ============================================================ */

body.win95 {
    background: #008080;
    font-family: 'MS Sans Serif', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: auto;
    image-rendering: pixelated;
}

/* Header: classic grey toolbar */
body.win95 .header {
    background: #c0c0c0;
    border-bottom: 2px solid #808080;
    border-top: 2px solid #fff;
    padding: 0 8px;
}
body.win95 .header h1 { color: #000080; font-size: 1.05rem; text-shadow: none; }
body.win95 .subtitle { color: #000; font-size: .72rem; }
body.win95 .logo-icon {
    background: #000080;
    border-radius: 2px;
    box-shadow: inset -1px -1px 0 #000, inset 1px 1px 0 #dfdfdf;
    width: 36px; height: 36px;
}

/* Wizard button: Win95 raised button */
body.win95 .wizard-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    border-radius: 0;
    padding: 3px;
    box-shadow: none;
}
body.win95 .wizard-btn::after { display: none; }
body.win95 .wizard-btn:hover { background: #d0d0d0; transform: none; box-shadow: none; }
body.win95 .wizard-btn:active { border-color: #808080 #fff #fff #808080; }
body.win95 .wizard-icon { border-radius: 0; }

/* Status pill: inset box */
body.win95 .data-status {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    border-radius: 0;
    color: #000; font-size: .72rem;
    padding: 2px 8px;
}
body.win95 .data-status.loaded { background: #c0c0c0; color: #008000; }
body.win95 .status-dot { display: none; }

/* How-to banner */
body.win95 .how-to-banner { background: #c0c0c0; border-bottom: 2px solid #808080; border-top: 1px solid #fff; }
body.win95 .how-to-toggle { color: #000080; font-family: 'MS Sans Serif', Tahoma, sans-serif; font-size: .78rem; }
body.win95 .how-to-toggle:hover { color: #000; }
body.win95 .how-to-details { color: #000; font-family: 'MS Sans Serif', Tahoma, sans-serif; }
body.win95 .how-to-details code { background: #fff; color: #000080; border: 1px solid #808080; border-radius: 0; font-family: 'Courier New', monospace; }
body.win95 .how-to-details strong { color: #000; }

/* Category headings */
body.win95 .category-heading {
    color: #000; font-size: .9rem; font-family: 'MS Sans Serif', Tahoma, sans-serif;
    border-bottom: 2px solid #808080; padding-bottom: 3px; margin-bottom: 10px;
}
body.win95 .category-heading .cat-count {
    background: #000080; color: #fff; border-radius: 0;
    font-size: .65rem; padding: 1px 6px;
}

/* Card grid */
body.win95 .dashboard-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Cards: classic Windows dialog window */
body.win95 .dash-card {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    border-radius: 0;
    padding: 0; gap: 0;
    overflow: visible;
    box-shadow: 2px 2px 0 #000;
    transition: none;
}
body.win95 .dash-card::before { display: none; }
body.win95 .dash-card:hover { transform: none; border-color: #fff #808080 #808080 #fff; box-shadow: 3px 3px 0 #000; }

/* Win95 title bar */
body.win95 .card-title {
    background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
    color: #fff;
    font-size: .78rem; font-weight: 700;
    padding: 3px 6px; gap: 5px;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
    letter-spacing: .2px;
    user-select: none;
}
/* The dot becomes a tiny Win95-style icon square */
body.win95 .card-title .live-dot {
    width: 14px; height: 14px; border-radius: 0;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #fff #404040 #404040 #fff;
    box-shadow: none;
    flex-shrink: 0;
}
body.win95 .link-card .card-title { background: linear-gradient(90deg, #800000 0%, #c04040 100%); }
body.win95 .link-card .card-title .live-dot { background: #ffff80; }

/* Card body */
body.win95 .card-desc {
    color: #000; font-size: .75rem; line-height: 1.4;
    padding: 7px 8px 4px;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
}
body.win95 .card-meta { padding: 0 8px 4px; color: #444; font-family: 'MS Sans Serif', Tahoma, sans-serif; font-size: .68rem; }
body.win95 .card-meta .lang-badge {
    background: #fff; color: #000080;
    border: 1px solid #808080; border-radius: 0;
    font-size: .65rem; padding: 0 5px;
}
body.win95 .card-meta .lang-badge.link-badge { background: #ffff80; color: #000; }
body.win95 .card-topics { padding: 0 8px 4px; }
body.win95 .topic-tag {
    background: #fff; color: #000080;
    border: 1px solid #808080; border-radius: 0;
    font-size: .62rem; padding: 0 5px;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
}

/* Card buttons: Win95 raised buttons */
body.win95 .card-actions { padding: 5px 8px 8px; gap: 6px; }
body.win95 .card-actions a {
    border-radius: 0;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
    font-size: .73rem; font-weight: 400;
    padding: 4px 0;
}
body.win95 .btn-primary {
    background: #c0c0c0; color: #000;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    box-shadow: 1px 1px 0 #000;
}
body.win95 .btn-primary:hover { background: #d0d0d0; box-shadow: 1px 1px 0 #000; transform: none; }
body.win95 .btn-primary:active { border-color: #808080 #fff #fff #808080; box-shadow: none; }
body.win95 .link-card .btn-primary { background: #c0c0c0; color: #000; border-color: #fff #808080 #808080 #fff; box-shadow: 1px 1px 0 #000; }
body.win95 .link-card .btn-primary:hover { background: #d0d0d0; box-shadow: 1px 1px 0 #000; }

/* Footer */
body.win95 .footer {
    background: #c0c0c0;
    border-top: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    color: #000; font-family: 'MS Sans Serif', Tahoma, sans-serif; font-size: .68rem;
    padding: 4px 10px;
}
body.win95 .footer a { color: #000080; }

/* Loading / Error in win95 */
body.win95 .loading-state { color: #000; font-family: 'MS Sans Serif', Tahoma, sans-serif; }
body.win95 .spinner { border-color: #808080; border-top-color: #000080; }
body.win95 .error-state { color: #000; }
body.win95 .retry-btn {
    background: #c0c0c0; color: #000;
    border: 2px solid; border-color: #fff #808080 #808080 #fff;
    border-radius: 0; box-shadow: 1px 1px 0 #000;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
}
body.win95 .retry-btn:hover { background: #d0d0d0; box-shadow: 1px 1px 0 #000; transform: none; }

