/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a { color: #1976d2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: #1a237e;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.4em;
    font-weight: bold;
    color: #fff;
}
.nav-brand:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: #bbdefb; }
.nav-links a:hover { color: #fff; }
.nav-user { color: #e8eaf6; font-weight: 500; }

/* ── Container ──────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 20px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 8px 18px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover { background: #1565c0; text-decoration: none; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.85em; }
.btn-secondary { background: #757575; }
.btn-secondary:hover { background: #616161; }
.btn-success { background: #388e3c; }
.btn-success:hover { background: #2e7d32; }
.btn-danger { background: #d32f2f; }
.btn-danger:hover { background: #c62828; }

/* ── Tables ─────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}
.table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: #fafafa; }

/* ── Forms ──────────────────────────────────────────────── */
form p { margin-bottom: 12px; }
form label { display: block; font-weight: 500; margin-bottom: 4px; }
form input[type="text"],
form input[type="number"],
form input[type="email"],
form input[type="password"],
form input[type="date"],
form input[type="time"],
form select,
form textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.errorlist {
    color: #d32f2f;
    list-style: none;
    padding: 0;
    margin: 4px 0;
    font-size: 0.9em;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

.messages { margin-bottom: 16px; }

/* ── Priority List ──────────────────────────────────────── */
.priority-list {
    list-style: none;
    max-width: 600px;
    margin: 16px 0;
}
.priority-item {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}
.priority-item:active { cursor: grabbing; }
.priority-item.dragging { opacity: 0.4; }
.priority-item .priority-label { flex: 1; }
.drag-handle { color: #999; font-size: 1.2em; }
.priority-rank { font-weight: bold; color: #666; min-width: 30px; }
.excluded-item { cursor: default; background: #fafafa; border-color: #eee; color: #888; }
.priority-empty { padding: 12px; color: #999; font-style: italic; }
.text-muted { color: #888; font-size: 0.9em; }

/* ── Home Links ─────────────────────────────────────────── */
.home-links { display: flex; gap: 12px; margin-top: 16px; }

/* ── Member Actions ─────────────────────────────────────── */
.member-actions { display: flex; gap: 12px; margin-bottom: 16px; }

/* ── Draft Info ─────────────────────────────────────────── */
.draft-info { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.draft-actions { margin-top: 16px; display: flex; gap: 12px; }

/* ── Member Summary (results) ───────────────────────────── */
.member-summary {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.member-summary h3 { margin-bottom: 4px; }
.member-summary ul { margin: 8px 0 0 20px; }

/* ── Breadcrumbs ───────────────────────────────────────── */
.breadcrumbs {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 12px;
}
.breadcrumbs a { color: #1976d2; }

/* ── Navbar separator ──────────────────────────────────── */
.nav-separator { color: #5c6bc0; margin: 0 4px; }

/* ── Home links (flex-wrap for groups) ─────────────────── */
.home-links { flex-wrap: wrap; }

/* ── Game Selector ─────────────────────────────────────── */
.game-selector { margin: 16px 0; }

.gs-tabs { display: flex; gap: 0; margin-bottom: 12px; }
.gs-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.9em;
}
.gs-tab:first-child { border-radius: 4px 0 0 4px; }
.gs-tab:last-child { border-radius: 0 4px 4px 0; }
.gs-tab.active { background: #1976d2; color: #fff; border-color: #1976d2; }
.gs-panel { display: none; }
.gs-panel.active { display: block; }

.gs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.gs-filter-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}
.gs-day-group { display: flex; gap: 8px; }
.gs-day-label {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    font-size: 0.85em;
    font-weight: normal !important;
    cursor: pointer;
}
.gs-price-group { display: flex; align-items: center; gap: 4px; }
.gs-price-input {
    width: 80px !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Calendar */
.gs-calendar {
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    max-width: 350px;
}
.gs-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.gs-cal-title { font-weight: 600; font-size: 1.1em; }
.gs-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8em;
    color: #999;
    margin-bottom: 4px;
}
.gs-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.gs-cal-cell {
    text-align: center;
    padding: 6px 2px;
    font-size: 0.9em;
    position: relative;
    border-radius: 4px;
}
.gs-cal-cell.empty { visibility: hidden; }
.gs-cal-cell.has-games {
    background: #e3f2fd;
    cursor: pointer;
    font-weight: 600;
}
.gs-cal-cell.has-games:hover { background: #bbdefb; }
.gs-cal-badge {
    position: absolute;
    top: 1px;
    right: 2px;
    font-size: 0.65em;
    background: #1976d2;
    color: #fff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
}

/* Calendar price tiers (colorblind-safe: blue → yellow → orange) */
.gs-cal-cell.has-games.gs-price-low { background: #abd9e9; }
.gs-cal-cell.has-games.gs-price-low:hover { background: #91cde0; }
.gs-cal-cell.has-games.gs-price-mid { background: #ffffbf; }
.gs-cal-cell.has-games.gs-price-mid:hover { background: #f0f0a0; }
.gs-cal-cell.has-games.gs-price-high { background: #fdae61; }
.gs-cal-cell.has-games.gs-price-high:hover { background: #f59b42; }

.gs-price-legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.8em;
    color: #666;
}
.gs-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.gs-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #ccc;
}
.gs-legend-swatch.gs-price-low { background: #abd9e9; }
.gs-legend-swatch.gs-price-mid { background: #ffffbf; }
.gs-legend-swatch.gs-price-high { background: #fdae61; }

.gs-results-table { font-size: 0.9em; }
.gs-result-row { cursor: pointer; }
.gs-result-row:hover { background: #f0fff0 !important; }
.gs-result-row td:last-child { white-space: nowrap; }
.gs-result-row td:last-child .btn { min-width: 72px; }
.gs-clear-date { margin-left: auto; }

/* ── Help Text ─────────────────────────────────────────── */
.help-text {
    color: #666;
    background: #f9f9f9;
    border-left: 3px solid #ddd;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.93em;
    line-height: 1.5;
}
.help-text ul { margin: 6px 0 0 20px; }
.help-text li { margin-bottom: 2px; }

/* ── Info Card ─────────────────────────────────────────── */
.info-card {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 16px 0;
}
.info-card h3 { margin-bottom: 6px; font-size: 1.05em; }
.info-card p { margin-bottom: 4px; }

/* ── Highlight row ─────────────────────────────────────── */
.table tr.highlight-row { background: #e3f2fd; }
.table tr.highlight-row:hover { background: #bbdefb; }

/* ── Inline roster ─────────────────────────────────────── */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.roster-item {
    background: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.93em;
}
.roster-item strong { display: block; margin-bottom: 2px; }

/* ── Dashboard ────────────────────────────────────────── */
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin: 16px 0; }
.pick-log-dashboard { background: #fff; border-radius: 8px; padding: 8px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ── Posts ────────────────────────────────────────────── */
.posts-section { margin: 16px 0; }
.posts-section h2 { margin-bottom: 8px; }
.pinned-post { border-left: 3px solid #1976d2; }

/* ── Carousel ─────────────────────────────────────────── */
.carousel {
    position: relative;
    max-width: 500px;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.carousel-slide { display: none; }
.carousel-slide.active { display: block; }
.carousel-slide img { width: 100%; display: block; border-radius: 8px; }
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 2em;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots { text-align: center; padding: 8px 0; position: absolute; bottom: 0; width: 100%; }
.carousel-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    margin: 0 4px;
    cursor: pointer;
}
.carousel-dot.active { background: #fff; }
.carousel-caption {
    text-align: center;
    color: #fff;
    padding: 6px;
    background: rgba(0,0,0,0.4);
    font-size: 0.9em;
    position: absolute;
    bottom: 30px;
    width: 100%;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
}

.btn-google:hover {
    background: #f8f9fa;
    color: #202124;
}

.google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    color: #4285f4;
    font-weight: 700;
}
