/* ============================================ */
/* FBS Communications Dashboard v2 - Wireframe   */
/* ============================================ */

:root {
    /* UVA Brand Colors */
    --uva-blue: #232D4B;
    --uva-navy: #232D4B;
    --uva-navy-light: #2A3C5F;
    --uva-orange: #E57200;
    --uva-orange-light: #F28C28;
    --uva-orange-dark: #d16800;

    /* Surfaces */
    --uva-light-gray: #F1F1EF;
    --uva-medium-gray: #DADADA;
    --uva-text-gray: #666666;
    --border-light: #DADADA;
    --border-mid: #c8c8c8;
    --bg-page: #fafafa;
    --bg-card: #ffffff;
    --bg-card-soft: #f5f5f3;
    --text-body: #232D4B;
    --text-subtle: #666666;

    /* Typography */
    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.4;
}

/* ============================================ */
/* TOP NAVIGATION BAR                            */
/* ============================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: var(--uva-navy);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.topbar-logo {
    height: 36px;
    width: auto;
}

.topbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 0.85rem;
}

.topbar-school {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-transform: uppercase;
}

.topbar-subtitle {
    font-family: var(--font-serif);
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.04em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-selector {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 1.5px solid var(--uva-navy);
    border-radius: 6px;
    background: white;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--uva-navy);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23232D4B' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 320px;
    transition: all 0.2s ease;
}

.page-selector:hover {
    border-color: var(--uva-orange);
}

.page-selector:focus {
    outline: none;
    border-color: var(--uva-orange);
    box-shadow: 0 0 0 2px rgba(229, 114, 0, 0.2);
}

/* ============================================ */
/* FILTER BAR                                    */
/* ============================================ */
.filter-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    background: var(--uva-light-gray);
    border-bottom: 1px solid var(--border-light);
}

.filter-select {
    padding: 0.5rem 2.5rem 0.5rem 0.85rem;
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    background: white;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-body);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--uva-orange);
}

/* ============================================ */
/* PAGE LAYOUT                                   */
/* ============================================ */
.page-content {
    padding: 1.25rem 1.5rem 3rem;
    max-width: 100%;
    overflow-x: hidden;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* ============================================ */
/* INFO TOOLTIPS (hover-triggered)                */
/* ============================================ */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    cursor: help;
    vertical-align: middle;
}

.info-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--uva-orange);
    color: white;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    font-style: normal;
    font-family: var(--font-sans);
    flex-shrink: 0;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--uva-navy);
    color: white;
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    width: 300px;
    line-height: 1.45;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    text-align: left;
    white-space: normal;
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--uva-navy);
}

.tooltip-content strong {
    color: var(--uva-orange);
    font-weight: 600;
}

.tooltip-content code {
    background: rgba(255, 255, 255, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #fff;
    word-break: break-word;
}

.tooltip-content .tt-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.tooltip-content .tt-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* DUMMY DATA banner — make it impossible to miss */
.dummy-banner {
    background: repeating-linear-gradient(
        45deg,
        rgba(229, 114, 0, 0.12),
        rgba(229, 114, 0, 0.12) 10px,
        rgba(229, 114, 0, 0.20) 10px,
        rgba(229, 114, 0, 0.20) 20px
    );
    border: 2px solid var(--uva-orange);
    border-radius: 6px;
    padding: 0.85rem 1.1rem;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.dummy-banner-icon {
    font-size: 1.3rem;
    color: var(--uva-orange);
    line-height: 1;
    margin-top: 0.1rem;
}

.dummy-banner-content {
    flex: 1;
}

.dummy-banner-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--uva-navy);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dummy-banner-body {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--uva-navy);
    line-height: 1.45;
}

.dummy-banner-body strong {
    color: var(--uva-orange-dark);
}

/* Subtle "DUMMY" watermark on placeholder cards */
.placeholder-card {
    position: relative;
}

.placeholder-card::before {
    content: 'DUMMY';
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: rgba(229, 114, 0, 0.6);
    z-index: 1;
    pointer-events: none;
}

.section-header {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--uva-navy);
    margin: 0.25rem 0 0.5rem;
    padding-bottom: 0;
}

.section-header::after {
    content: '';
    display: block;
    width: 3rem;
    height: 3px;
    background: var(--uva-orange);
    margin-top: 0.4rem;
}

.section-header:not(:first-child) {
    margin-top: 2rem;
}

/* ============================================ */
/* WIREFRAME GRID LAYOUTS                        */
/* ============================================ */

/* 4-col grid: scorecard stack + 3 chart cards */
.wireframe-grid-3col {
    display: grid;
    grid-template-columns: 130px 1fr 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Stack + single full-width table */
.wireframe-grid-stack-table {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* 50/50 two-column layout */
.wireframe-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Wireframe-true 5-column organic row: stack | table | stack | table | table */
.wireframe-grid-organic {
    display: grid;
    grid-template-columns: 130px 1fr 130px 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.chart-card-span-2 {
    grid-column: span 1;
}

/* In wireframe-grid-3col, allow boosted table to be wider (matches wireframe proportions) */
.wireframe-grid-3col .chart-card-span-2 {
    grid-column: 2 / span 2;
}
.wireframe-grid-3col:has(.chart-card-span-2) {
    grid-template-columns: 130px 2fr 1fr;
}

/* Half-width row, content on the left */
.wireframe-grid-half-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Stack + 2 equal-width cards side-by-side */
.wireframe-grid-stack-equal2 {
    display: grid;
    grid-template-columns: 130px 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Stack + 2 side-by-side tables/charts */
.wireframe-grid-stack-table-side {
    display: grid;
    grid-template-columns: 140px 1.5fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Funnel top row: 6-scorecard stack + wide column graph */
.wireframe-grid-funnel-top {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Equal 3-col grid for funnel bar charts */
.wireframe-grid-3col-equal {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.chart-card-wide {
    /* takes up extra space when needed */
}

/* ============================================ */
/* SCORECARD                                     */
/* ============================================ */
.scorecard-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    align-self: start;
}

.scorecard {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.scorecard-label {
    font-family: var(--font-sans);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scorecard-title {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--uva-navy);
    margin-top: 0.25rem;
    line-height: 1.25;
    display: flex;
    align-items: flex-start;
}

.scorecard-title .info-tooltip,
.chart-card-title .info-tooltip {
    margin-left: auto;
    flex-shrink: 0;
}

.scorecard-value {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--uva-navy);
    margin-top: 0.4rem;
    padding-top: 0;
    line-height: 1;
}

/* ============================================ */
/* CHART CARD                                    */
/* ============================================ */
.chart-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    min-width: 0;
}

.chart-card-label {
    font-family: var(--font-sans);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.chart-card-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--uva-navy);
    margin-bottom: 0.85rem;
    line-height: 1.3;
}

/* Header row with title + dropdown toggle */
.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.chart-card-header h3,
.chart-card-header .chart-card-title {
    margin-bottom: 0;
}

.card-toggle {
    padding: 0.3rem 1.8rem 0.3rem 0.6rem;
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    background: white;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--uva-navy);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23232D4B' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    flex-shrink: 0;
}

.card-toggle:focus {
    outline: none;
    border-color: var(--uva-orange);
}

.chart-card-title .chart-note {
    font-weight: 400;
    color: var(--text-subtle);
    font-size: 0.7rem;
}

.chart-card-body {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
    min-width: 0;

    /* Hide scrollbar by default — fades in on hover */
    scrollbar-color: transparent transparent;
    scrollbar-width: thin;
    transition: scrollbar-color 0.2s ease;
}

/* WebKit (Chrome, Edge, Safari) */
.chart-card-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.chart-card-body::-webkit-scrollbar-track {
    background: transparent;
}
.chart-card-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.2s ease;
}

/* Reveal scrollbar when hovering the card */
.chart-card:hover .chart-card-body {
    scrollbar-color: rgba(35, 45, 75, 0.35) transparent;
}
.chart-card:hover .chart-card-body::-webkit-scrollbar-thumb {
    background: rgba(35, 45, 75, 0.35);
}
.chart-card:hover .chart-card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(35, 45, 75, 0.55);
}

.chart-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    color: var(--text-subtle);
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
}

.empty-state i {
    margin-right: 0.4rem;
    color: var(--uva-orange);
}

/* ============================================ */
/* DATA TABLES (inside chart cards)              */
/* ============================================ */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    table-layout: auto;
}

.dash-table thead th {
    text-align: left;
    padding: 0.4rem 0.45rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-mid);
    background: transparent;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.dash-table thead th.num {
    text-align: right;
}

.dash-table tbody td {
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid rgba(35, 45, 75, 0.06);
    color: var(--text-body);
    vertical-align: middle;
}

/* Zebra striping using UVA navy at low opacity */
.dash-table tbody tr:nth-child(odd) {
    background: rgba(35, 45, 75, 0.04);
}

.dash-table tbody tr:nth-child(even) {
    background: transparent;
}

.dash-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-table tbody td.name {
    font-weight: 600;
    color: var(--uva-navy);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-table tbody tr:hover {
    background: rgba(229, 114, 0, 0.08) !important;
}

/* Status pill */
.status-pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill.active, .status-pill.enabled { background: #e6f7ee; color: #0a7a3f; }
.status-pill.paused { background: #fff4e1; color: #b25800; }
.status-pill.completed, .status-pill.removed { background: #ececec; color: #555; }

/* Platform pill — compact single-letter badge */
.platform-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.platform-pill.meta { background: rgba(0, 129, 251, 0.15); color: #0081FB; }
.platform-pill.google { background: rgba(66, 133, 244, 0.15); color: #4285F4; }
.platform-pill.linkedin { background: rgba(0, 119, 181, 0.15); color: #0077B5; }

/* Loading state */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: var(--text-subtle);
    font-size: 0.8rem;
}

.loading-state i {
    margin-right: 0.5rem;
}

/* ============================================ */
/* RESPONSIVE                                    */
/* ============================================ */
@media (max-width: 1280px) {
    .wireframe-grid-organic {
        grid-template-columns: 140px 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .wireframe-grid-3col,
    .wireframe-grid-organic {
        grid-template-columns: 1fr;
    }
    .wireframe-grid-3col-equal {
        grid-template-columns: 1fr;
    }
    .scorecard-stack {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .scorecard {
        flex: 1 1 200px;
    }
}
