/**
 * shared.css — Common design tokens and base styles for gif-captcha.
 *
 * Extracted from duplicate inline <style> blocks across all HTML pages.
 * Every page was independently declaring the same CSS variables, reset,
 * body styles, header, footer, button, and utility classes. This file
 * eliminates ~600 lines of duplication across the 6 HTML files.
 */

/* ===== Design Tokens ===== */
:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-hover: #1c2129;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --green: #3fb950;
    --green-bg: rgba(63, 185, 80, 0.15);
    --red: #f85149;
    --red-bg: rgba(248, 81, 73, 0.15);
    --yellow: #d29922;
    --yellow-bg: rgba(210, 153, 34, 0.15);
    --purple: #bc8cff;
    --purple-bg: rgba(188, 140, 255, 0.15);
    --orange: #f0883e;
    --orange-bg: rgba(240, 136, 62, 0.15);
    --cyan: #39d2c0;
    --cyan-bg: rgba(57, 210, 192, 0.15);
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Page Header & Navigation ===== */
.header {
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.header h1 { font-size: 2rem; margin-bottom: 0.3rem; }
.header .subtitle { color: var(--muted); font-size: 1rem; }
.nav-links { margin-top: 0.8rem; }
.nav-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 0.5rem;
}
.nav-links a:hover { text-decoration: underline; }

/* ===== Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.7rem 2rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }
.btn-small { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* ===== Category Tags ===== */
.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.3rem;
}
.tag-narrative { background: var(--purple-bg); color: var(--purple); }
.tag-visual { background: var(--cyan-bg); color: var(--cyan); }
.tag-physical { background: var(--orange-bg); color: var(--orange); }
.tag-animal { background: var(--green-bg); color: var(--green); }
.tag-social { background: var(--yellow-bg); color: var(--yellow); }
.tag-illusion { background: var(--red-bg); color: var(--red); }

/* ===== GIF Container (shared across demo, temporal, generator) ===== */
.gif-container {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}
.gif-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}
.gif-container .gif-loading { color: var(--muted); font-size: 0.9rem; }
.gif-container .gif-error {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}
.gif-container .gif-error a { color: var(--accent); text-decoration: none; }
.gif-container .gif-error a:hover { text-decoration: underline; }

/* ===== Challenge Card (shared across demo, temporal) ===== */
.challenge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.challenge-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.challenge-header .label { font-size: 0.85rem; color: var(--muted); }
.challenge-header .number { font-weight: 700; color: var(--accent); }
.challenge-prompt {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}
.challenge-prompt .prompt-text {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.challenge-prompt .prompt-hint { font-size: 0.8rem; color: var(--muted); }

/* ===== Progress Bar (shared across demo, temporal) ===== */
.progress-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ===== Insight Box (shared across analysis, simulator) ===== */
.insight-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem;
    margin: 1.5rem 0;
}
.insight-box h4 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--accent);
}
.insight-box p { font-size: 0.85rem; color: var(--muted); }

/* ===== Two Column Layout ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ===== Fade-in Animation ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Footer ===== */
footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.skip-link {
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: underline;
    font-family: inherit;
}
.skip-link:hover { color: var(--text); }

/* ===== Responsive Base ===== */
@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .header h1 { font-size: 1.5rem; }
    .container { padding: 1rem; }
}
