/* practice-map.css -- Practice Map page styles
   Matches July dark theme (see reaction-mirror, ego-quiz, etc.)
   Created: May 20, 2026 */

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

:root {
    --bg: #0E1117;
    --bg-card: #161921;
    --bg-elevated: #1C1F2A;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text: #E8E4DD;
    --text-dim: #8B8B8B;
    --text-muted: #5A5A5A;
    --gold: #C9A96E;
    --gold-dim: rgba(201,169,110,0.15);
    --gold-glow: rgba(201,169,110,0.08);
    --accent: #C27C5A;
    --accent-dim: rgba(194,124,90,0.15);
    --green: #7C9A82;
    --green-dim: rgba(124,154,130,0.15);
    --blue: #548bdd;
    --blue-dim: rgba(84,139,221,0.12);
    --font-serif: 'Libre Baskerville', serif;
    --font-sans: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- NAV --- */
.nav {
    text-align: center;
    padding: 1rem 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    z-index: 1000;
    position: relative;
}
.nav a {
    text-decoration: none;
    color: #9A9A9A;
    margin: 0 0.75rem;
}
.nav a:first-child {
    color: var(--text);
    font-weight: 600;
    margin-right: 1.5rem;
}

/* --- MAIN CONTAINER --- */
.practice-map-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* --- GATE (not signed in) --- */
.gate {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 560px;
    margin: 0 auto;
}
.gate-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}
.gate h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 300;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.gate h1 span { color: var(--gold); }
.gate .gate-desc {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}
.gate .gate-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    text-align: left;
    width: 100%;
    max-width: 380px;
}
.gate-feature {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.gate-feature .gf-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    margin-top: 1px;
}
.gate-feature strong { color: var(--text); }
.btn-signin {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-sans);
}
.btn-signin:hover { background: #D4A07A; transform: translateY(-2px); }
.gate-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* --- LOADING --- */
.loading-state {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    font-size: 0.9rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 480px;
    margin: 0 auto;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.7; }
.empty-state h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 0.75rem;
}
.empty-state p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.btn-explore {
    display: inline-block;
    text-decoration: none;
    background: var(--accent);
    color: var(--bg);
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-explore:hover { background: #D4A07A; transform: translateY(-2px); }

/* --- PAGE HEADER --- */
.map-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-top: 0.5rem;
}
.map-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 300;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}
.map-header h1 span { color: var(--gold); }
.map-header .map-subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* --- STATS ROW --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: border-color 0.3s;
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-value {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--gold);
    margin-bottom: 0.25rem;
    line-height: 1;
}
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

/* Streak fire animation */
.stat-card.streak-active {
    border-color: rgba(201,169,110,0.25);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(201,169,110,0.05) 100%);
}
.stat-card.streak-active .stat-value {
    animation: streakPulse 2s ease-in-out infinite;
}
@keyframes streakPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(201,169,110,0.2); }
    50% { text-shadow: 0 0 12px rgba(201,169,110,0.5), 0 0 24px rgba(201,169,110,0.15); }
}

/* --- SECTION HEADERS --- */
.section-header {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.section-header .section-count {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* --- MILESTONES --- */
.milestones-section { margin-bottom: 2rem; }
.milestones-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.milestone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gold-dim);
    border: 1px solid rgba(201,169,110,0.2);
    border-radius: 100px;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--gold);
    transition: transform 0.2s;
}
.milestone:hover { transform: translateY(-1px); }
.milestone .ms-icon { font-size: 1rem; }
.milestone .ms-label { font-weight: 500; }
.milestone-locked {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.05);
    color: var(--text-muted);
    opacity: 0.5;
}

/* --- TOOLS GRID --- */
.tools-section { margin-bottom: 2rem; }
.tools-category {
    margin-bottom: 1.25rem;
}
.tools-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cat-icon {
    font-size: 0.9rem;
}
.cat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 500;
    flex: 1;
}
.cat-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}
.tools-coverage {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
.tools-coverage strong { color: var(--gold); }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: all 0.25s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.tool-card.used {
    border-color: rgba(201,169,110,0.2);
}
.tool-card.used:hover {
    border-color: rgba(201,169,110,0.4);
}
.tool-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.tool-icon { font-size: 1.3rem; }
.tool-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}
.tool-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.tool-check.done {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(124,154,130,0.3);
}
.tool-check.pending {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
}
.tool-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.tool-meta .tool-result {
    color: var(--gold);
    font-weight: 500;
}
.tool-card.unused {
    opacity: 0.5;
}
.tool-card.unused:hover {
    opacity: 0.8;
    border-color: rgba(84,139,221,0.3);
}
.tool-card.unused .tool-try {
    font-size: 0.75rem;
    color: var(--blue);
    margin-top: 0.25rem;
}

/* --- TIMELINE --- */
.timeline-section { margin-bottom: 2rem; }
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, var(--gold) 0%, var(--border) 100%);
}
.timeline-group {
    margin-bottom: 1.25rem;
}
.timeline-date {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    position: relative;
}
.timeline-date::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg);
}
.timeline-event {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.timeline-event:hover { border-color: var(--border-hover); }
.timeline-event .te-tool {
    font-weight: 500;
    color: var(--text);
}
.timeline-event .te-type {
    color: var(--text-dim);
}
.timeline-event .te-detail {
    color: var(--gold);
    font-weight: 500;
}
.timeline-event .te-streak {
    font-size: 0.75rem;
    color: var(--green);
    margin-left: 0.5rem;
}
.timeline-more {
    text-align: center;
    margin-top: 1rem;
}
.btn-load-more {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}
.btn-load-more:hover {
    border-color: var(--gold);
    color: var(--text);
}

/* --- INSIGHTS --- */
.insights-section { margin-bottom: 2rem; }
.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.3s;
}
.insight-card:hover { border-color: rgba(201,169,110,0.3); border-left-color: var(--gold); }
.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.insight-icon {
    font-size: 1.1rem;
}
.insight-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    font-weight: 600;
}
.insight-message {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.insight-message strong { color: var(--text); }

/* --- NEXT STEPS --- */
.next-steps-section { margin-bottom: 3rem; }
.next-step-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
}
.next-step-card:hover {
    border-color: rgba(194,124,90,0.3);
    transform: translateX(4px);
}
.ns-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.ns-content { flex: 1; }
.ns-tool {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.ns-reason {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.ns-arrow {
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
    align-self: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.next-step-card:hover .ns-arrow { opacity: 1; }

/* --- FOOTER --- */
.practice-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
    color: #737373;
    line-height: 1.8;
    background: var(--bg);
}
.practice-footer .footer-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}
.practice-footer a {
    color: #9A9A9A;
    text-decoration: none;
    margin: 0 0.5rem;
}
.practice-footer .footer-legal a {
    color: #737373;
    font-size: 0.85rem;
}
.practice-footer .footer-copy {
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-in { animation: fadeUp 0.5s ease forwards; }
.animate-fade { animation: fadeIn 0.4s ease forwards; }

.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }

/* --- MILESTONE TOAST --- */
.milestone-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.milestone-toast.mt-visible {
    transform: translateX(0);
}
.mt-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #1C1F2A 0%, #1a1714 100%);
    border: 1px solid rgba(201,169,110,0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 16px rgba(201,169,110,0.1);
    min-width: 260px;
    max-width: 360px;
}
.mt-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: milestoneShine 1.5s ease-in-out infinite;
}
@keyframes milestoneShine {
    0%, 100% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(1.3); transform: scale(1.1); }
}
.mt-text { flex: 1; }
.mt-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 2px;
}
.mt-label {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}
.mt-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
.mt-close:hover { color: var(--text); }

/* --- RESPONSIVE --- */
@media (max-width: 700px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .practice-map-container {
        padding: 1.5rem 1rem 3rem;
    }
    .stat-value { font-size: 1.5rem; }
    .milestone-toast {
        right: 10px;
        left: 10px;
    }
    .mt-content {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav { font-size: 0.8rem; }
    .nav a { margin: 0 0.4rem; }
    .gate h1 { font-size: 1.8rem; }
    .next-step-card { flex-direction: column; gap: 0.5rem; }
    .ns-arrow { display: none; }
    .milestones-grid {
        gap: 0.4rem;
    }
    .milestone {
        padding: 0.4rem 0.75rem 0.4rem 0.6rem;
        font-size: 0.72rem;
    }
}
