/* Job Quest – Styles */
:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #242834;
    --border: #2e3344;
    --text: #e2e4ea;
    --text2: #9ca3b4;
    --accent: #6c5ce7;
    --accent2: #a29bfe;
    --green: #00b894;
    --gold: #fdcb6e;
    --orange: #e17055;
    --red: #d63031;
    --blue: #74b9ff;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────── */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* ── Header / Nav ─────────────────────── */

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent2);
    letter-spacing: -0.5px;
}

.logo span { color: var(--gold); }

nav { display: flex; gap: 16px; flex-wrap: wrap; }

nav a {
    color: var(--text2);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* ── Player Selector ──────────────────── */

.player-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.player-bar label {
    font-size: 0.85rem;
    color: var(--text2);
    font-weight: 500;
}

.player-bar select, .player-bar input, .player-bar button {
    font-size: 0.95rem;
    font-family: inherit;
}

/* ── Forms / Inputs ───────────────────── */

select, input[type="text"], input[type="date"], textarea {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--accent);
}

textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

/* ── Buttons ──────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #5a4bd6; text-decoration: none; }

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }

.btn-small {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-log {
    background: var(--green);
    color: #fff;
    font-size: 1.1rem;
    padding: 14px 28px;
    border-radius: 8px;
}
.btn-log:hover { background: #00a381; text-decoration: none; }

/* ── Cards ────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 1rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ── Scoreboard ───────────────────────── */

.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 500px) {
    .scoreboard { grid-template-columns: 1fr; }
}

.player-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
}

.player-card.leading {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(253, 203, 110, 0.15);
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat {
    text-align: center;
    padding: 8px;
    background: var(--surface2);
    border-radius: 6px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent2);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.streak-fire { color: var(--orange); }

/* ── Tip Box ──────────────────────────── */

.tip-box {
    background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(162,155,254,0.05));
    border: 1px solid rgba(108,92,231,0.3);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--accent2);
}

.tip-box strong { color: var(--gold); }

/* ── Activity Feed ────────────────────── */

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.feed-item:last-child { border-bottom: none; }

.feed-meta {
    font-size: 0.8rem;
    color: var(--text2);
}

.feed-points {
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
    font-size: 0.95rem;
}

.feed-multiplier {
    font-size: 0.75rem;
    color: var(--gold);
}

.feed-notes {
    font-size: 0.85rem;
    color: var(--text2);
    font-style: italic;
}

.feed-detail {
    font-size: 0.85rem;
    color: var(--text);
}

.feed-player {
    font-weight: 600;
    font-size: 0.85rem;
}

/* ── Activity Picker (Log Page) ───────── */

.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cat-tab {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    transition: all 0.2s;
}

.cat-tab:hover { border-color: var(--accent); color: var(--text); }
.cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.activity-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
}

.activity-card.selected {
    border-color: var(--green);
    background: rgba(0, 184, 148, 0.08);
}

.activity-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.activity-info p {
    font-size: 0.8rem;
    color: var(--text2);
}

.activity-pts {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

.activity-tier {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface2);
    color: var(--gold);
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Log Form (expanded after selection) ── */

.log-form {
    background: var(--surface2);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
}

.log-form .field {
    margin-bottom: 12px;
}

.log-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text2);
    margin-bottom: 4px;
    font-weight: 500;
}

/* ── Success Toast ────────────────────── */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--green);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 999;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
}

@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* ── Badges ───────────────────────────── */

.badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 600;
}

/* ── Rules Page ───────────────────────── */

.tier-ladder {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}

.tier-rung {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--surface2);
    border-left: 4px solid var(--border);
}

.tier-rung.t1 { border-left-color: var(--text2); }
.tier-rung.t2 { border-left-color: var(--blue); }
.tier-rung.t3 { border-left-color: var(--accent2); }
.tier-rung.t4 { border-left-color: var(--gold); }
.tier-rung.t4plus { border-left-color: var(--orange); }

.tier-label {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 36px;
    color: var(--gold);
}

.tier-desc {
    flex: 1;
    font-size: 0.9rem;
}

.tier-pts {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--green);
}

/* ── Milestones Table ─────────────────── */

.milestone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.milestone-name { font-weight: 600; }
.milestone-threshold { color: var(--text2); }
.milestone-reward { color: var(--gold); font-weight: 500; }

/* ── Utilities ────────────────────────── */

.text-center { text-align: center; }

/* Inline SVG alignment */
svg { vertical-align: middle; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text2); }
.text-small { font-size: 0.85rem; }
.hidden { display: none !important; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text2);
}

.empty-state p { margin-bottom: 16px; }

/* ── Loading ──────────────────────────── */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text2);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }