/* Pravda theme (moved out of the inline <style> of the legacy dashboard). */
/* Global Styles - Pravda Theme */

/* IBM Plex Sans, self-hosted (no Google Fonts call — that would leak every
   visitor's IP/referer to a third party). woff2 in assets/fonts/. */
@font-face {
    font-family: 'IBM Plex Sans';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-sans-400.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-sans-500.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-sans-600.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-sans-700.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Sans Condensed';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-cond-600.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Sans Condensed';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('/assets/fonts/plex-cond-700.woff2') format('woff2');
}

:root {
    --primary-color: #00c6a3;
    --secondary-color: #2d3436;
    --success-color: #00c6a3;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --background-color: #ffffff;
    --card-color: #f8f9fa;
    --text-color: #2d3436;
    --border-color: #dee2e6;
    --header-color: #2d3436;
    --header-text: #ffffff;

    /* The two type roles. Condensed carries the "news portal" titles; the
       body stays in a plain, readable grotesque — a deliberately ordinary
       voice for the pastiche. Arial remains the last-resort fallback. */
    --font-body: 'IBM Plex Sans', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-display: 'IBM Plex Sans Condensed', 'IBM Plex Sans', 'Arial Narrow', Arial, sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tabular figures everywhere numbers line up (stat cards, tables, axes). */
.summary-card .card-title,
.summary-card h2,
.summary-card h3,
table {
    font-variant-numeric: tabular-nums;
}

/* Pravda-specific styling */
.pravda-top-banner {
    background-color: var(--header-color);
    color: var(--header-text);
    border-bottom: 2px solid var(--primary-color);
    padding: 10px 0;
}

.top-banner-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: #FFF;
    background-color: var(--primary-color);
    padding: 2px 8px;
    border: 1px solid var(--primary-color);
}

.top-banner-subtitle {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2rem;
    text-transform: uppercase;
    color: var(--header-text);
    letter-spacing: 1px;
}

.pravda-header {
    background-color: var(--header-color);
    color: var(--header-text);
    padding: 10px 0;
    margin-bottom: 0;
}

.pravda-header label {
    color: var(--primary-color);
}

.pravda-logo {
    display: flex;
    align-items: center;
}

.pravda-logo-text {
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-color);
}

.pravda-logo-text-secondary {
    font-weight: bold;
    font-size: 20px;
    color: var(--header-text);
}

.pravda-subnav {
    background-color: var(--secondary-color);
    padding: 10px 0;
    margin-bottom: 15px;
}

.pravda-nav-row {
    min-height: 40px;
}

/* Card Styling — square corners kept (part of the pastiche); the lift is
   quieter and the shadow layered so cards read as paper, not buttons. */
.card {
    border-radius: 0;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(45, 52, 54, 0.06);
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(45, 52, 54, 0.08), 0 8px 24px rgba(45, 52, 54, 0.06) !important;
}

/* A thin teal rule along the top: the one house accent, on every panel. */
.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    box-shadow: inset 0 2px 0 var(--primary-color);
    padding: 0.7rem 1rem;
}

.card-header h5 {
    font-family: var(--font-display);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 12px;
    color: #6c757d;
}

/* Summary Cards */
.summary-card {
    border-left: 4px solid var(--primary-color);
    background-color: var(--card-color);
    border-radius: 0;
    overflow: hidden;
}

/* The label above the big number: small, quiet, condensed. */
.summary-card .card-title {
    font-family: var(--font-display);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    color: #6c757d !important;
    margin-bottom: 0.25rem;
}

/* The headline number itself: condensed, tight, tabular. */
.summary-card .card-text {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

/* Info Card */
.info-card {
    border-left: 4px solid var(--info-color);
    background-color: #f8f9fa;
    border-radius: 0;
}

/* Tab Navigation Styling */
.tab-navigation {
    background-color: var(--card-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    margin-bottom: 20px !important;
    border-radius: 0;
    overflow: hidden;
}

.tab-link {
    border-radius: 0 !important;
    padding: 14px 15px;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.6px;
    color: var(--text-color);
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

/* Active tab: teal underline instead of a full teal fill — lighter, more
   "section nav" than "selected button", and the label stays legible. */
.tab-link.active {
    background-color: transparent !important;
    color: var(--secondary-color) !important;
    border-bottom-color: var(--primary-color);
}

.tab-link:hover:not(.active) {
    background-color: #e9ecef;
}

/* File selector styling - Pravda style */
.dropdown-selector {
    min-width: 300px;
    border-radius: 0;
}

/* Network chart specific styling */
#domain-network-chart {
    width: 100% !important;
}

#domain-network-chart .js-plotly-plot,
#domain-network-chart .plot-container,
#domain-network-chart .main-svg {
    width: 100% !important;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }

    .dropdown-selector {
        min-width: 100%;
    }

    .top-banner-logo,
    .top-banner-subtitle {
        font-size: 1.5rem;
    }

    .tab-link {
        padding: 10px;
        font-size: 12px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.main-content {
    animation: fadeIn 0.3s ease-in-out;
}

/* Slider styling */
.rc-slider-track {
    background-color: var(--primary-color);
}

.rc-slider-handle {
    border-color: var(--primary-color);
}

/* Button styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color);
    filter: brightness(110%);
    border-color: var(--primary-color);
}

/* Text color classes */
.text-primary {
    color: var(--primary-color) !important;
}

/* Plotly's mode bar sits above the chart, not over its legend. Only these
   three charts display it (displayModeBar: True in the layout). */
#articles-per-day-chart,
#sources-by-day-chart,
#domain-network-chart {
    padding-top: 34px;
}

#articles-per-day-chart .modebar-container,
#sources-by-day-chart .modebar-container,
#domain-network-chart .modebar-container {
    top: -34px !important;
}
