/* BluePages Design System — Clean White Theme */
/* Informed by: Airbnb (split layout, score-as-pin), Yelp (spacing, typography),
   Apple Maps (simplicity), TripAdvisor (distinctive badge), Zillow (map interactions) */

/* ── Base ── */
html { font-size: 16px; }
body { letter-spacing: 0.005em; }
a { transition: color 0.15s; }

/* ── Cards ── */
.bp-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.bp-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ── Grade Badge (the BluePages brand element — like TripAdvisor's green bubbles) ── */
.bp-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    flex-shrink: 0;
}
.bp-grade-sm { width: 28px; height: 28px; font-size: 12px; }
.bp-grade-lg { width: 64px; height: 64px; font-size: 28px; }

/* ── Score Text ── */
.bp-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

/* ── Stat Cards ── */
.bp-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    letter-spacing: -0.025em;
}
.bp-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.375rem;
}

/* ── Navigation ── */
.bp-nav-link {
    position: relative;
    color: #64748b;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.15s ease;
}
.bp-nav-link:hover { color: #0f172a; }
.bp-nav-active { color: #0f172a !important; }
.bp-nav-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1.25rem;
    height: 2px;
    background: #2563eb;
    border-radius: 1px;
}

/* ── Category Tags ── */
.bp-cat-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    white-space: nowrap;
}

/* ── Inputs ── */
.bp-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bp-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.bp-input::placeholder { color: #94a3b8; }

/* ── Progress Bars ── */
.bp-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}
.bp-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ── Section Spacing ── */
.bp-section { margin-top: 2rem; }
.bp-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}
.bp-section-sub {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}

/* ── Filter Chips ── */
.bp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.bp-chip:hover { border-color: #0f172a; color: #0f172a; }
.bp-chip-active { background: #0f172a; color: #ffffff; border-color: #0f172a; }

/* ── Table Rows ── */
.bp-table-row { transition: background 0.1s ease; }
.bp-table-row:hover { background: #f8fafc; }

/* ── Leaflet popup overrides for light theme ── */
.leaflet-popup-content-wrapper {
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    font-size: 14px;
}
.leaflet-popup-tip { background: #ffffff; }
.leaflet-popup-close-button { color: #94a3b8 !important; font-size: 18px !important; }

/* ── Chart.js ── */
canvas { image-rendering: crisp-edges; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Focus Ring ── */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ── Print ── */
@media print {
    nav, footer, .no-print { display: none !important; }
    body { background: #fff !important; }
    .bp-card { box-shadow: none !important; border-color: #dee2e6 !important; }
    main { padding: 0 !important; max-width: 100% !important; }
    .bp-grade, .bp-progress-fill, .bp-cat-tag {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .signal-card, .recommendation-card { break-inside: avoid; }
    .print-chart { break-inside: avoid; }
    .print-header { break-after: avoid; }
    h2 { break-after: avoid; }
}

/* ── Animate on load ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
main > * { animation: fadeUp 0.25s ease-out forwards; }
main > *:nth-child(2) { animation-delay: 0.04s; }
main > *:nth-child(3) { animation-delay: 0.08s; }
