/* ═══ Divot Spot — Mobile-First Styles ═══ */

:root {
    --green: #1a9e52;
    --green-dark: #0d7a3e;
    --green-dim: #d4f0e2;
    --green-bg: #eaf7f0;
    --amber: #c07a00;
    --amber-bg: #fff8e6;
    --violet: #7c3aed;
    --violet-bg: #f3eeff;
    --blue: #1565C0;
    --blue-light: #E3F2FD;
    --red: #c0392b;
    --orange: #E65100;
    --muted: #6b8070;
    --text-primary: #0f1f16;
    --text-secondary: #2d4a38;
    --text-muted: #6b8070;
    --border: rgba(0,0,0,0.09);
    --bg: #dfe8e2;
    --surface: #f0f4f0;
    --card: #FFFFFF;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 14px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

/* ── Mobile Bottom Nav ──────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 8px 0 calc(8px + var(--safe-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active { color: var(--green); }
.nav-item .nav-icon { font-size: 22px; }

/* ── Header ─────────────────────────────────────────── */
.app-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 16px 16px 14px;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header h1 {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 2px;
    color: var(--green);
}

.app-header .subtitle {
    font-size: 12px;
    opacity: 0.65;
    margin-top: 2px;
}

/* ── Hamburger Button ──────────────────────────────── */
.hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    padding: 4px;
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

/* ── Navigation Drawer ─────────────────────────────── */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: linear-gradient(135deg, #1a9e52 0%, #0d7a3e 100%);
    color: white;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-drawer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-drawer-name {
    font-size: 14px;
    font-weight: 700;
}

.nav-drawer-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.65;
}

.nav-drawer-sections {
    flex: 1;
    padding: 8px 0;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    padding: 16px 20px 6px;
}

.nav-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s;
    cursor: pointer;
}

.nav-drawer-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-drawer-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-drawer-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 0;
}

.nav-drawer-signout {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.65);
}

/* ── Page Content ───────────────────────────────────── */
.page-content {
    padding: 12px 16px calc(80px + var(--safe-bottom));
    max-width: 600px;
    margin: 0 auto;
}

/* ── Course Card ────────────────────────────────────── */
.course-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.course-card:active { box-shadow: 0 0 0 rgba(0,0,0,0); }

.course-card.tier-A { border-left: 4px solid var(--amber); }
.course-card.tier-B { border-left: 4px solid var(--green); }
.course-card.tier-C { border-left: 4px solid var(--blue); }
.course-card.tier-D { border-left: 4px solid var(--violet); }

.course-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.course-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.course-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.price { font-size: 15px; font-weight: 700; color: var(--green); }
.distance { font-size: 12px; color: var(--text-muted); }

.needs-insider-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px dashed #BDBDBD;
    color: #9E9E9E;
}

.book-link {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
    background: var(--green);
    color: #fff;
    text-decoration: none;
}

.dope-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--green-bg);
    color: var(--green);
}

/* ── Tier Badge ─────────────────────────────────────── */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tier-badge.tier-A { color: var(--amber); background: var(--amber-bg); }
.tier-badge.tier-B { color: var(--green); background: var(--green-bg); }
.tier-badge.tier-C { color: var(--blue); background: var(--blue-light); }
.tier-badge.tier-D { color: var(--violet); background: var(--violet-bg); }

/* ── Tags ───────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 500;
    background: #f0f0f0;
    color: var(--text-secondary);
}

/* ── Star Rating ────────────────────────────────────── */
.google-rating {
    text-align: right;
    flex-shrink: 0;
}

.google-rating .score {
    font-size: 22px;
    font-weight: 800;
}

.google-rating .count {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Filters ────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.filter-chip.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* ── Search Input ───────────────────────────────────── */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--card);
    outline: none;
    -webkit-appearance: none;
}

.search-input:focus { border-color: var(--green); }

/* ── Rating Bars ────────────────────────────────────── */
.rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rating-label { font-size: 12px; color: var(--text-secondary); width: 100px; flex-shrink: 0; }
.rating-bar-track { flex: 1; height: 8px; background: #E0E0E0; border-radius: 99px; overflow: hidden; }
.rating-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.rating-value { font-size: 13px; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }

/* ── Score Slider (for rating input) ────────────────── */
.score-slider {
    display: flex;
    gap: 8px;
    margin: 4px 0 8px;
}

.score-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.score-btn.selected {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* ── Near Me Button ─────────────────────────────────── */
.near-me-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    border: none;
    background: var(--green);
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.near-me-btn:active { opacity: 0.9; }

/* ── Course Hero Image ──────────────────────────────── */
.course-hero {
    width: 100%;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.course-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Course Card Thumbnail ─────────────────────────── */
.course-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.course-thumb-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* ── Stat Box (Course Detail) ────────────────────────── */
.stat-box {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px 8px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Voting & Schedule ─────────────────────────────── */

.btn-primary {
    background: var(--green);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-small {
    background: var(--card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.btn-warning { color: var(--orange); border-color: var(--orange); }
.btn-danger { color: var(--red); border-color: var(--red); }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--card);
}
.form-input:focus { outline: 2px solid var(--green); border-color: transparent; }

/* Session Cards */
.voting-session-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.voting-session-card:active { box-shadow: 0 0 0 rgba(0,0,0,0); }

.voting-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.voting-status-badge.status-draft { background: #f0f0f0; color: var(--text-muted); }
.voting-status-badge.status-open { background: var(--green-bg); color: var(--green); }
.voting-status-badge.status-closed { background: var(--blue-light); color: var(--blue); }
.voting-status-badge.status-scheduled { background: var(--amber-bg); color: var(--amber); }

/* Ballot */
.ballot-progress {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ballot-course-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.ballot-course-card.voted { border-color: var(--green); border-width: 2px; }

.interest-buttons {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.interest-btn {
    flex: 1;
    min-width: 56px;
    padding: 10px 6px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.interest-btn.interest-gotta { background: var(--green-bg); color: var(--green-dark); }
.interest-btn.interest-want { background: var(--green-bg); color: var(--green); }
.interest-btn.interest-either { background: #FFF8E1; color: #F9A825; }
.interest-btn.interest-meh { background: #FFF3E0; color: #FF9800; }
.interest-btn.interest-no { background: #FFEBEE; color: #F44336; }

.interest-btn.selected.interest-gotta { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.interest-btn.selected.interest-want { background: var(--green); color: #fff; border-color: var(--green-dark); }
.interest-btn.selected.interest-either { background: #FFC107; color: #333; border-color: #FFA000; }
.interest-btn.selected.interest-meh { background: #FF9800; color: #fff; border-color: #F57C00; }
.interest-btn.selected.interest-no { background: #F44336; color: #fff; border-color: #D32F2F; }

.interest-legend {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.interest-label {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.interest-label.interest-gotta { background: var(--green-dark); color: #fff; }
.interest-label.interest-want { background: var(--green); color: #fff; }
.interest-label.interest-either { background: #FFC107; color: #333; }
.interest-label.interest-meh { background: #FF9800; color: #fff; }
.interest-label.interest-no { background: #F44336; color: #fff; }

/* Results */
.results-course-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.results-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.results-rank.top-3 { background: var(--green-bg); color: var(--green); }
.results-rank.rank-1 { background: var(--amber-bg); color: var(--amber); }

/* Schedule */
.schedule-slot {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.schedule-slot.slot-off {
    border-left-color: var(--text-muted);
    background: #FAFAFA;
}
.schedule-slot.slot-next-up {
    border-left-color: var(--amber);
    background: var(--amber-bg);
}
.schedule-slot.slot-past {
    opacity: 0.6;
}
.schedule-slot.slot-cancelled {
    border-left-color: var(--red);
    opacity: 0.5;
}
.schedule-slot.slot-swapped {
    border-left-color: var(--amber);
}
.schedule-slot.slot-confirmed {
    border-left-color: var(--green);
}
.next-up-badge {
    display: inline-block;
    background: var(--amber);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 4px;
}
.slot-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.slot-action-link {
    font-size: 12px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}
.slot-action-link:hover { text-decoration: underline; }
.slot-action-rate {
    font-size: 12px;
    color: var(--amber);
    text-decoration: none;
    font-weight: 600;
}
.slot-action-rate:hover { text-decoration: underline; }
.slot-course-link {
    color: inherit;
    text-decoration: none;
}
.slot-course-link:hover { text-decoration: underline; }
.schedule-link {
    font-size: 12px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
}
.schedule-link:hover { text-decoration: underline; }

/* ── Desktop adjustments ────────────────────────────── */
@media (min-width: 768px) {
    .page-content { max-width: 700px; padding: 20px 24px 40px; }
    .bottom-nav { display: none; }
    .course-card { padding: 20px 24px; }
    .course-name { font-size: 17px; }
    .app-header { padding: 24px 24px 20px; }
    .app-header h1 { font-size: 24px; }
    .interest-btn { font-size: 12px; padding: 8px 6px; }
}

/* ── Activity Feed ─────────────────────────────────── */
.activity-feed {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    overflow: hidden;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #f5f5f5;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-bg);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.activity-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Played Matrix ─────────────────────────────────── */
.played-matrix-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
}

.played-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

.played-matrix th,
.played-matrix td {
    padding: 8px 6px;
    border-bottom: 1px solid #f0f0f0;
}

.played-matrix thead th {
    position: sticky;
    top: 0;
    background: var(--bg);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.played-matrix-course-header {
    text-align: left !important;
    min-width: 140px;
}

.played-matrix-user-header {
    min-width: 50px;
}

.played-matrix-course-cell {
    text-align: left;
}

.played-matrix tbody tr:hover {
    background: var(--green-bg);
}

/* ── Drive Time Chip ───────────────────────────────── */
.drive-time-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.drive-time-icon {
    font-size: 14px;
}

.drive-time-separator {
    opacity: 0.5;
}

/* ── Pagination ────────────────────────────────────── */
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.page-btn:active { transform: scale(0.95); }
.page-btn.active { background: var(--green); color: white; border-color: var(--green); }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Blazor defaults ────────────────────────────────── */
#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; padding: 12px; background: #ffdddd; z-index: 1000; text-align: center; }
#blazor-error-ui .reload { color: var(--blue); }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--red); }
.validation-message { color: var(--red); font-size: 12px; }
