/* =========================================
   AIS DASHBOARD
   Centrale stylesheet
   ========================================= */


/* =========================================
   KLEUREN
   ========================================= */

:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --card-alt: #f1f5f9;

    --text: #222831;
    --muted: #68737d;

    --border: #d7dee5;

    --accent: #1976d2;
    --accent-bg: #e7f2fc;
    --accent-hover: #d6eaf9;
    
    --chart-text: rgba(0, 0, 0, 0.60);
    --chart-grid: rgba(0, 0, 0, 0.10);

    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    --radius: 14px;
}


/* =========================================
   DONKERE MODUS
   ========================================= */

@media (prefers-color-scheme: dark) {

    :root {
        --bg: #11161c;
        --card: #1b222a;
        --card-alt: #202932;

        --text: #e8edf2;
        --muted: #aab4be;

        --border: #343e48;

        --accent: #64b5f6;
        --accent-bg: #20384d;
        --accent-hover: #294a65;
        
        --chart-text: rgba(255, 255, 255, 0.70);
        --chart-grid: rgba(255, 255, 255, 0.10);

        --shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    }

}


/* =========================================
   BASIS
   ========================================= */

html {
    background: var(--bg);
}

body {
    font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
    color: var(--text);
    background: var(--bg);
    margin: 30px;
}

/* =========================================
   ALGEMENE KAARTEN
   ========================================= */

.card {
    background: var(--card);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}


/* =========================================
   SCHEPEN
   ========================================= */

.ship {
    background: var(--card);
    color: var(--text);

    padding: 15px;
    margin-top: 10px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


/* =========================================
   KNOPPEN
   ========================================= */

.button {
    display: inline-block;

    background: var(--accent-bg);
    color: var(--accent);

    padding: 8px 14px;

    border-radius: 8px;

    text-decoration: none;
    margin-top: 10px;

    transition:
        background-color 0.15s ease,
        transform 0.1s ease;
}

.button:hover {
    background: var(--accent-hover);
}

.button:active {
    transform: translateY(1px);
}


/* =========================================
   FILTER KNOPPEN
   ========================================= */

.filter-button {
    display: inline-block;

    background: var(--accent-bg);
    color: var(--accent);

    padding: 8px 14px;

    border-radius: 8px;

    text-decoration: none;
    margin: 5px;

    transition: background-color 0.15s ease;
}

.filter-button:hover {
    background: var(--accent-hover);
}

.filter-button.active {
    background: var(--accent);
    color: white;
    font-weight: bold;
}


/* =========================================
   POPUP KNOPPEN
   ========================================= */

.popup-button {
    display: block;

    width: 100%;
    box-sizing: border-box;

    margin: 6px 0;
    padding: 8px;

    border: none;
    border-radius: 8px;

    background: var(--accent-bg);
    color: var(--accent);

    text-decoration: none;

    font-size: 14px;
    cursor: pointer;

    transition: background-color 0.15s ease;
}

.popup-button:hover {
    background: var(--accent-hover);
}


/* =========================================
   PAGINERING
   ========================================= */

.pagination {
    margin-top: 25px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;

    padding: 8px 12px;
    margin: 3px;

    border-radius: 8px;

    text-decoration: none;
}

.pagination a {
    background: var(--card-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--accent-bg);
    color: var(--accent);
}


/* =========================================
   DASHBOARD HEADER
   ========================================= */

.dashboard-header {
    position: relative;
}


/* =========================================
   MENU
   ========================================= */

.menu-toggle {
    position: absolute;
    top: 15px;
    right: 15px;

    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: 22px;
    line-height: 1;

    padding: 7px 10px;

    cursor: pointer;

    color: var(--accent);

    z-index: 3000;
}

.menu-toggle:hover {
    background: var(--accent-hover);
}


/* Menu openen/sluiten */

.site-menu {
    display: none;

    position: absolute;
    top: 60px;
    right: 15px;

    min-width: 220px;

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;

    box-shadow: var(--shadow);

    z-index: 2000;

    overflow: hidden;
}

.site-menu.open {
    display: block;
}


/* Tooltip Hoofdmenu */

.menu-toggle::after {
    content: "Hoofdmenu";

    position: absolute;
    right: 0;
    top: 100%;

    margin-top: 6px;

    padding: 5px 9px;

    background: #333;
    color: white;

    font-size: 12px;
    white-space: nowrap;

    border-radius: 5px;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.15s ease;
}

.menu-toggle:hover::after {
    opacity: 1;
}

.menu-toggle:has(+ .site-menu.open)::after {
    opacity: 0;
}


/* Menu links */

.site-menu a {
    display: block;

    text-align: left;

    padding: 12px 15px;

    color: var(--text);
    text-decoration: none;

    border-bottom: 1px solid var(--border);
}

.site-menu a:last-child {
    border-bottom: none;
}

.site-menu a:hover {
    background: var(--card-alt);
}


/* Mobiel */

@media (max-width: 600px) {

    .menu-toggle {
        top: -5px;
        right: 0;
    }

    .site-menu {
        top: 40px;
        right: 0;
    }

}

/* =========================================
   TABELLEN
   ========================================= */

table {
    color: var(--text);
}

td,
th {
    border-color: var(--border);
}


/* =========================================
   TEKST
   ========================================= */

.subtitle,
.dashboard-header p,
.page-header p {
    color: var(--muted);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* =========================================
   TRANSITIES
   ========================================= */

body,
.card,
.ship,
.site-menu,
.menu-toggle,
.button,
.popup-button,
.filter-button,
.pagination a {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* =========================================
   INDEX / DASHBOARD
   ========================================= */

.dashboard-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.dashboard-header p {
    color: var(--muted);
    font-size: 1.1em;
}

.dashboard-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.dashboard-buttons .popup-button {
    width: auto;
    min-width: 0;
}

.status-card {
    background: var(--card-alt);
    color: var(--text);
    padding: 20px;
    border-radius: var(--radius);
    line-height: 1.8;
    text-align: left;
    font-size: 1.05em;
    box-shadow: var(--shadow);
}

.status-card .popup-button {
    display: inline-block;
    width: auto;
}

.daily-record-label {
    color: var(--muted);
}

.recent-destination-row {
    border-bottom-color: var(--border);
}

.observation-item + .observation-item {
    border-top-color: var(--border);
}


/* =========================================
   INDEX / DASHBOARD
   ========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stats-grid .status-card {
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    font-size: 0.9em;
    line-height: 1.5;
}

.stats-grid .status-card b {
    display: block;
    margin-top: 4px;

    font-size: 1.55em;
    line-height: 1.2;

    color: var(--text);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
    align-items: stretch;
}

.info-grid > div {
    min-height: 300px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

.daily-records-card {
    grid-column: 1 / -1;
}

.daily-records {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.daily-record {
    text-align: center;
}

.daily-record-name {
    font-weight: bold;
}

.daily-record-value {
    font-size: 1.1em;
}

.recent-destination-row {
    display: grid;
    grid-template-columns: 45px minmax(110px, 150px) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95em;
}

.recent-destination-time {
    white-space: nowrap;
}

.recent-destination-name,
.recent-destination-destination {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-card b {
    font-weight: bold;
}

.traffic-chart-card {
    background: var(--card-alt);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.traffic-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.traffic-chart-title {
    font-size: 1.15em;
    font-weight: bold;
}

.traffic-chart-subtitle {
    font-size: 0.9em;
    opacity: 0.7;
}

.traffic-chart-current {
    text-align: right;
}

.traffic-chart-current b {
    display: block;
    font-size: 1.5em;
}

.traffic-chart-current span {
    font-size: 0.8em;
    opacity: 0.7;
}

.traffic-chart {
    position: relative;
    width: 100%;
    height: 280px;
}

.station-info {
    font-size: 1em;
    line-height: 1.8;
    height: 100%;
    box-sizing: border-box;
}

.ship-summary-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 6px 0;
}

.ship-summary-row span:first-child {
    min-width: 260px;
}

.ship-count {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
}

.observation-item {
    margin-bottom: 15px;
    padding: 8px 0 15px 0;
}

.country-flag {
    width: 24px;
    vertical-align: middle;
    margin-right: 6px;
}

@media (max-width: 700px) {
    .daily-records {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .recent-destination-row {
        grid-template-columns: 42px minmax(90px, 1fr) minmax(0, 1.3fr);
        gap: 6px;
        font-size: 0.9em;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

.ship-hover-popup {
    position: absolute;

    transform: translate(-50%, -115%);

    background: rgba(20, 20, 20, 0.82);
    color: white;

    padding: 5px 8px;

    border-radius: 5px;

    font-size: 12px;
    line-height: 1.4;

    white-space: nowrap;

    pointer-events: none;

    z-index: 10000;
}

/* klein pijltje onder de popup */

.ship-hover-popup::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: -6px;

    transform: translateX(-50%);

    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(20, 20, 20, 0.82);
}
