/* RecGov Monitor — Professional Styles */

/* ── Typography & Base ── */

:root {
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-info: #0891b2;
    --color-info-light: #cffafe;
    --color-lottery: #3b82f6;
    --color-lottery-light: #dbeafe;
    --color-muted: #9ca3af;
    --color-muted-light: #f3f4f6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #111827;
}

/* ── Navbar ── */

.navbar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    box-shadow: var(--shadow-md);
    border: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

/* ── Section Titles ── */

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

/* ── Status Badges ── */

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2em 0.6em;
    border-radius: 20px;
}

.status-active {
    background: var(--color-success-light);
    color: var(--color-success);
}

.status-paused {
    background: var(--color-muted-light);
    color: #6b7280;
}

/* ── Dashboard Cards ── */

.dash-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    border-left: 3px solid #d1d5db;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dash-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: #d1d5db;
}

.dash-card-available { border-left-color: var(--color-success); }
.dash-card-low { border-left-color: var(--color-warning); }
.dash-card-partial { border-left-color: #f59e0b; }
.dash-card-full { border-left-color: var(--color-danger); }

.dash-card-paused {
    opacity: 0.6;
    border-left-color: #d1d5db;
    border-left-style: dashed;
}

.dash-card-header {
    padding: 1.1rem 1.25rem 0;
    border-bottom: none;
}

.dash-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.dash-card-body {
    padding: 0.65rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dash-card-date-block {
    background: #f8fafc;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-card-date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-card-date-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 2.2rem;
    flex-shrink: 0;
}

.dash-card-date-value {
    font-size: 0.84rem;
    color: #374151;
    font-weight: 500;
}

.dash-card-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dash-card-detail {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.dash-card-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

.dash-card-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #f3f4f6;
}

.dash-card-status-detail {
    font-size: 0.75rem;
    color: #6b7280;
}

.dash-card-btn {
    margin-top: auto;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.summary-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2em 0.65em;
    border-radius: 20px;
}

.summary-available {
    background: var(--color-success-light);
    color: var(--color-success);
}

.summary-low {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.summary-partial {
    background: #fef3c7;
    color: #b45309;
}

.summary-full {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.dash-card-checked {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
}

/* ── Poller Status Indicator ── */

.poller-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.poller-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.poller-active {
    background: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-light);
}

.poller-inactive {
    background: #d1d5db;
    box-shadow: 0 0 0 3px #f3f4f6;
}

.poller-text {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* ── Admin Stats Page ── */

.admin-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.admin-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.admin-card-label {
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-top: 0.25rem;
}

.admin-table {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-table table {
    margin-bottom: 0;
}

.admin-table th {
    background: #f9fafb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.admin-hidden-row {
    display: none;
}

.admin-expand-toggle {
    padding: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ── Detail Page Header ── */

.detail-header {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.detail-meta {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.detail-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ── Night Timeline Cards ── */

.nights-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.night-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    display: flex;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.night-card:hover {
    box-shadow: var(--shadow-md);
}

.night-card-accent {
    width: 5px;
    flex-shrink: 0;
}

.night-available .night-card-accent { background: linear-gradient(180deg, #16a34a, #22c55e); }
.night-low .night-card-accent { background: linear-gradient(180deg, #d97706, #f59e0b); }
.night-full .night-card-accent { background: linear-gradient(180deg, #dc2626, #ef4444); }
.night-lottery .night-card-accent { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
.night-walkup .night-card-accent { background: linear-gradient(180deg, #0891b2, #22d3ee); }
.night-no-data .night-card-accent { background: linear-gradient(180deg, #9ca3af, #d1d5db); }

.night-card-body {
    flex: 1;
    padding: 1rem 1.25rem;
}

.night-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.night-number {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #374151;
}

.night-date {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.night-campsite {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.night-district {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ── Variant Grid (Companion Variants) ── */

.variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.variant-block {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.variant-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.variant-note {
    font-size: 0.78rem;
    color: #6b7280;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    line-height: 1.45;
    color: #0369a1;
}

/* ── Availability Bars ── */

.availability-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.avail-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.avail-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.avail-bar-wrap {
    flex: 1;
    min-width: 0;
}

.avail-progress {
    height: 10px;
    border-radius: 5px;
    background: #e5e7eb;
}

.avail-progress .progress-bar {
    border-radius: 5px;
    transition: width 0.3s ease;
}

.avail-progress .bar-available {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.avail-progress .bar-low {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.avail-progress .bar-booked {
    background: linear-gradient(90deg, #fca5a5, #fecaca);
}

.avail-count {
    font-size: 0.82rem;
    min-width: 120px;
    text-align: right;
    white-space: nowrap;
}

.avail-count strong {
    color: #111827;
}

.avail-total {
    color: #9ca3af;
}

.season-tag {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ── Availability Status Messages ── */

.availability-status {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 0.75rem;
}

.lottery-status {
    color: var(--color-lottery);
}

.walkup-status {
    color: var(--color-info);
}

.nodata-status {
    color: var(--color-muted);
}

/* ── Per-Division Status Tags ── */

.avail-status-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-full {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.tag-low {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.tag-available {
    background: var(--color-success-light);
    color: var(--color-success);
}

.tag-lottery {
    background: var(--color-lottery-light);
    color: var(--color-lottery);
}

.tag-walkup {
    background: var(--color-info-light);
    color: var(--color-info);
}

.tag-nodata {
    background: var(--color-muted-light);
    color: var(--color-muted);
}

/* ── Itinerary Status Banner ── */

.itinerary-status-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
}

.itinerary-status-banner strong {
    font-weight: 700;
}

.banner-icon {
    flex-shrink: 0;
    display: flex;
}

.banner-text {
    flex: 1;
}

.banner-full {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.banner-full .banner-icon { color: #dc2626; }

.banner-partial {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.banner-partial .banner-icon { color: #ea580c; }

.banner-low {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    color: #92400e;
}

.banner-low .banner-icon { color: #d97706; }

.banner-available {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.banner-available .banner-icon { color: #16a34a; }

.banner-nodata {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border: 1px solid #e5e7eb;
    color: #4b5563;
}

.banner-nodata .banner-icon { color: #9ca3af; }

/* ── Legend ── */

.legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Activity Feed ── */

.activity-feed {
    position: relative;
    padding-left: 24px;
}

.activity-feed::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e5e7eb;
    border-radius: 1px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    position: relative;
}

.activity-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: -24px;
    margin-top: 3px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.dot-success { background: var(--color-success); box-shadow: 0 0 0 2px var(--color-success-light); }
.dot-danger { background: var(--color-danger); box-shadow: 0 0 0 2px var(--color-danger-light); }
.dot-muted { background: #d1d5db; }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.activity-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 6px;
}

.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-muted { background: #f3f4f6; color: #6b7280; }

.activity-date-label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 500;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.1rem;
}

/* ── Info Tip Box ── */

.info-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

.info-tip-icon {
    flex-shrink: 0;
    color: #94a3b8;
    margin-top: 1px;
}

.info-tip strong {
    color: #334155;
}

.info-tip em {
    font-style: normal;
    font-weight: 600;
    color: #334155;
}

/* ── Alerts ── */

.alert-styled {
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 500;
}

/* ── Empty State ── */

.empty-state {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
}

/* ── Step Indicator ── */

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    color: #adb5bd;
    font-weight: 500;
    font-size: 0.9rem;
}

.step-indicator .step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dee2e6;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-indicator .step.active {
    color: #3b82f6;
}

.step-indicator .step.active .step-num {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.step-indicator .step.completed {
    color: var(--color-success);
}

.step-indicator .step.completed .step-num {
    background: var(--color-success);
}

.step-indicator .step-divider {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 1px;
}

/* ── Trailhead Cards ── */

.trailhead-card {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md) !important;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.trailhead-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 0.2rem 0.75rem rgba(59, 130, 246, 0.15);
}

.trailhead-card.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* ── Night Builder Rows ── */

.night-row {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm) !important;
}

.night-label {
    min-width: 90px;
}

/* ── Summary Panel ── */

.itinerary-summary {
    position: sticky;
    top: 1rem;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

/* ── Footer ── */

footer p {
    font-size: 0.8rem;
}

/* ── Buttons ── */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
}

/* ── Cards (global override) ── */

.card {
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ── Form Controls ── */

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .detail-header .d-flex {
        flex-direction: column;
        gap: 0.75rem;
    }

    .detail-actions {
        align-self: flex-start;
    }

    .night-card-body .row {
        gap: 0.75rem;
    }

    .avail-row {
        flex-wrap: wrap;
    }

    .variant-grid {
        grid-template-columns: 1fr;
    }
}
