/* Shared CourtSketch components (page cards, field labels, pill toggles, dropdown menus,
   modals, option toggles, chart placeholders).
   Linked by base.html after Tailwind and the base styles, before page CSS: a page that
   needs a variant overrides the rule in its own <style>. Don't paste these into templates.
   See docs/theming.md ("Shared components"). */

.page-card {
    background: var(--cs-board);
    border: 1px solid var(--cs-line-soft);
    border-radius: 0.75rem;
}
/* The rule above beats Tailwind's rounded-* utilities; cards built as
   "rounded-xl sm:rounded-2xl" (shot index/combo, SRS explorer, ...) keep 1rem from sm up. */
@media (min-width: 640px) {
    .page-card.sm\:rounded-2xl {
        border-radius: 1rem;
    }
}

.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cs-faint);
    font-family: var(--f-mono);
    margin-bottom: 0.45rem;
}

.pill-toggle-track {
    display: inline-flex;
    background: var(--cs-ink);
    border: 1px solid var(--cs-line-soft);
    border-radius: 9999px;
    padding: 3px;
    gap: 2px;
}

.pill-toggle-track button {
    padding: 0.35rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--f-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    color: var(--cs-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.pill-toggle-track button.active {
    background: var(--cs-orange);
    color: var(--cs-on-accent);
    box-shadow: none;
}

.graph-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    border: 1.5px dashed var(--cs-line);
    border-radius: 0.75rem;
    background: var(--cs-ink);
    color: var(--cs-faint);
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    font-family: var(--f-mono);
}
/* Charts render into the placeholder without clearing it: Plotly.newPlot keeps the empty-state
   icon/text next to the plot, and index.js's phone path swaps them for an <img class="img-fluid">.
   Once a chart is there, hide the empty state and drop its frame; the chart stays centered. */
.graph-placeholder:has(> .plot-container, > img.img-fluid) {
    min-height: 0;
    padding: 0;
    border-color: transparent;
}
.graph-placeholder:has(> .plot-container) > :not(.plot-container) {
    display: none;
}

.cs-dropdown-menu {
    background: var(--cs-board);
    border: 1px solid var(--cs-line);
    border-radius: 0.5rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.cs-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--cs-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cs-dropdown-item:hover {
    background: var(--cs-board-2);
    color: var(--cs-chalk);
}

.modal-overlay {
    background: rgba(8, 13, 20, 0.85);
    backdrop-filter: blur(8px);
}

.modal-card {
    background: var(--cs-board);
    border: 1px solid var(--cs-line);
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.option-toggle input {
    display: none;
}

.option-toggle input:checked+.option-toggle-track {
    background: var(--cs-orange);
    border-color: var(--cs-orange-deep);
}

.option-toggle input:checked+.option-toggle-track::after {
    transform: translateX(16px);
}
