/* ----------------------------------------------------
   MARITIEM DASHBOARD DESIGN SYSTEM & STYLESHEET
   ---------------------------------------------------- */

:root {
    /* Kleurenpalet */
    --color-navy-dark: #071624;
    --color-navy: #0b223a;
    --color-blue-accent: #0088cc;
    --color-teal: #00ebd7;
    --color-orange-knrm: #ff5500;
    --color-orange-glow: rgba(255, 85, 0, 0.25);
    --color-green: #10b981;
    --color-green-glow: rgba(16, 185, 129, 0.2);
    --color-red: #ef4444;
    --color-slate-50: #f8fafc;
    --color-slate-200: #e2e8f0;
    --color-slate-400: #94a3b8;
    --color-slate-600: #475569;
    
    /* Typografie en schaduwen */
    --font-primary: 'Outfit', sans-serif;
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.45);
    
    /* Glassmorphism eigenschappen */
    --glass-bg: rgba(7, 22, 36, 0.65);
    --glass-bg-hover: rgba(11, 34, 58, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
}

/* Reset & Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-navy-dark);
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--color-slate-50);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Donkere overlay voor betere tekstleesbaarheid */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(7, 22, 36, 0.85) 0%, rgba(11, 34, 58, 0.92) 100%);
    z-index: 1;
}

/* Hoofdcontainer */
.container {
    position: relative;
    z-index: 2;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ship-icon {
    font-size: 2.2rem;
    color: var(--color-orange-knrm);
    filter: drop-shadow(0 0 10px var(--color-orange-knrm));
}

.title-sub h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(120deg, #ffffff, var(--color-slate-200));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-teal);
}

.time-widget {
    display: flex;
    align-items: center;
    gap: 24px;
}

.time-block {
    text-align: right;
    display: flex;
    flex-direction: column;
}

#live-time {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

#live-date {
    font-size: 0.75rem;
    color: var(--color-slate-400);
    text-transform: capitalize;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online .status-dot {
    background-color: var(--color-green);
    box-shadow: 0 0 8px var(--color-green);
}

.status-indicator.offline .status-dot {
    background-color: var(--color-red);
    box-shadow: 0 0 8px var(--color-red);
}

/* Warning Banner */
.warning-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    color: #fca5a5;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.4s ease;
}

.warning-banner strong {
    color: #ffffff;
}

.warning-banner.hidden {
    display: none;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

/* Widgets Base */
.widget {
    grid-column: span 4;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.widget:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-4px);
}

.widget.large-card {
    grid-column: span 6;
}

.widget.chart-container {
    grid-column: span 6;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-slate-50);
}

.card-header h3 i {
    color: var(--color-blue-accent);
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-slate-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge.blue {
    background: rgba(0, 136, 204, 0.2);
    color: var(--color-blue-accent);
    border-color: rgba(0, 136, 204, 0.3);
}

.badge.light-blue {
    background: rgba(0, 235, 215, 0.15);
    color: var(--color-teal);
    border-color: rgba(0, 235, 215, 0.25);
}

.badge.orange {
    background: rgba(255, 85, 0, 0.15);
    color: var(--color-orange-knrm);
    border-color: rgba(255, 85, 0, 0.25);
}

.badge.teal {
    background: rgba(0, 150, 136, 0.15);
    color: #009688;
    border-color: rgba(0, 150, 136, 0.25);
}

.badge.red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Card Content Base */
.card-content {
    padding: 20px;
    flex-grow: 1;
}

/* Widget 1: Weer & Getijden */
.summary-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weersamenvatting, .tide-summary {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.weersamenvatting h4, .tide-summary h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-teal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weersamenvatting p, .tide-summary p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-slate-200);
}

.prev-tide {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--color-slate-400);
}

.prev-tide span {
    color: var(--color-slate-200);
}

/* Widget 2: Wind en Richting (Kompas) */
.compass-flex {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
}

.compass-container {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compass {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid var(--color-slate-600);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.6);
}

.direction-labels span {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--color-slate-400);
}

.direction-labels .n { top: 6px; left: 50%; transform: translateX(-50%); color: var(--color-orange-knrm); }
.direction-labels .e { right: 8px; top: 50%; transform: translateY(-50%); }
.direction-labels .s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.direction-labels .w { left: 8px; top: 50%; transform: translateY(-50%); }

.compass-pointer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(0deg);
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.pointer-arrow {
    width: 4px;
    height: 50px;
    background: var(--color-teal);
    position: absolute;
    top: 15px;
    left: calc(50% - 2px);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--color-teal);
}

.pointer-arrow::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--color-teal);
    position: absolute;
    top: -6px;
    left: -4px;
}

.wind-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wind-large {
    font-size: 3rem;
    font-weight: 900;
    display: flex;
    align-items: baseline;
    line-height: 1;
    color: var(--color-slate-50);
}

.wind-large .unit {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-slate-400);
    margin-left: 4px;
}

.wind-sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    width: 140px;
    font-size: 0.8rem;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-row .label {
    color: var(--color-slate-400);
}

.detail-row .val {
    font-weight: 700;
    color: var(--color-slate-200);
}

/* Widget 3: Golfhoogte */
.wave-flex {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
}

.wave-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--color-blue-accent);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 136, 204, 0.15);
}

.wave-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--color-blue-accent);
    animation: pulseWave 2s infinite ease-out;
}

.wave-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.wave-value span {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

.wave-value .unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-slate-400);
    margin-top: 2px;
}

.wave-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wave-status {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-green);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 12px;
    text-align: center;
    width: fit-content;
}

.wave-status.warning {
    background: rgba(255, 85, 0, 0.15);
    border: 1px solid rgba(255, 85, 0, 0.3);
    color: var(--color-orange-knrm);
}

/* Widget 4: Stroom & Waterhoogte */
.stroom-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.stroom-row {
    display: flex;
    justify-content: space-around;
    gap: 12px;
}

.stroom-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.15);
    padding: 10px 14px;
    border-radius: 10px;
    flex: 1;
}

.stroom-item i {
    font-size: 1.4rem;
    color: var(--color-teal);
}

.stroom-item .val-lbl {
    display: flex;
    flex-direction: column;
}

.stroom-item .val {
    font-size: 1.1rem;
    font-weight: 700;
}

.stroom-item .lbl {
    font-size: 0.65rem;
    color: var(--color-slate-400);
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.waterhoogte-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
}

.waterhoogte-item .label {
    font-size: 0.85rem;
    color: var(--color-slate-400);
}

.water-height-val {
    display: flex;
    align-items: baseline;
}

.water-height-val .val {
    font-size: 1.5rem;
    font-weight: 700;
}

.water-height-val .unit {
    font-size: 0.75rem;
    color: var(--color-slate-400);
    margin-left: 2px;
}

/* Chart Widget Styling */
.chart-holder {
    width: 100%;
    min-height: 250px;
}

.apexcharts-canvas {
    margin: 0 auto;
}

/* Widget 5: KNRM & P2000 */
.knrm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.boat-status {
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-block {
    display: flex;
    flex-direction: column;
}

.info-block .lbl {
    font-size: 0.7rem;
    color: var(--color-slate-400);
    text-transform: uppercase;
}

.info-block .val {
    font-size: 1.1rem;
    font-weight: 700;
}

.info-block .val.highlight {
    color: var(--color-orange-knrm);
}

.info-block .val.green {
    color: var(--color-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-green);
    box-shadow: 0 0 6px var(--color-green);
    display: inline-block;
    animation: blinkGreen 1.5s infinite;
}

.ais-widget {
    margin-top: 16px;
}

.ais-widget h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-slate-200);
}

.ais-card {
    background: rgba(0, 136, 204, 0.08);
    border: 1px solid rgba(0, 136, 204, 0.2);
    border-radius: 10px;
    padding: 14px;
}

.ais-header-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.ais-header-details .ship-type {
    color: var(--color-teal);
    font-weight: 700;
}

.ais-header-details .mmsi {
    color: var(--color-slate-400);
}

.ais-card p {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-slate-300);
    margin-bottom: 12px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--color-orange-knrm);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px var(--color-orange-glow);
}

.btn-primary:hover {
    background: #ff7733;
    transform: translateY(-1px);
}

/* P2000 List */
.p2000-alarms {
    display: flex;
    flex-direction: column;
}

.p2000-alarms h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-slate-200);
}

.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 4px;
}

.alarm-list::-webkit-scrollbar {
    width: 6px;
}

.alarm-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.alarm-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.alarm-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.loading-alarms {
    font-size: 0.8rem;
    color: var(--color-slate-400);
    text-align: center;
    padding: 20px;
}

.alarm-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.2s;
}

.alarm-item:hover {
    background: rgba(255,255,255,0.06);
}

.alarm-item.recent {
    border-left: 3px solid var(--color-orange-knrm);
    background: rgba(255, 85, 0, 0.04);
}

.alarm-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
}

.alarm-time {
    color: var(--color-teal);
}

.alarm-capcode {
    color: var(--color-slate-400);
}

.alarm-body {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--color-slate-200);
}

/* Footer */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    color: var(--color-slate-400);
    margin-top: 8px;
}

.refresh-time span {
    color: var(--color-teal);
    font-weight: 700;
}

/* Animaties */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseWave {
    0% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes blinkGreen {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse {
    animation: blinkGreen 2s infinite;
}

/* Responsive Grid Medias */
@media (max-width: 1200px) {
    .widget {
        grid-column: span 6;
    }
    .widget.large-card {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .widget, .widget.large-card, .widget.chart-container {
        grid-column: span 12;
    }
    .main-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .time-widget {
        width: 100%;
        justify-content: space-between;
    }
    .knrm-grid {
        grid-template-columns: 1fr;
    }
    .main-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Custom Leaflet Marker en Popup Styling */
.custom-knrm-marker {
    position: relative;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: var(--color-orange-knrm);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 85, 0, 0.5);
    border: 2px solid #ffffff;
}

.marker-pin i {
    transform: rotate(45deg);
    color: white;
    font-size: 0.85rem;
}

.marker-pulse {
    background: rgba(255, 85, 0, 0.4);
    border-radius: 50%;
    height: 50px;
    width: 50px;
    position: absolute;
    margin: -25px 0 0 -25px;
    left: 50%;
    top: 50%;
    animation: markerPulsate 1.8s ease-out;
    animation-iteration-count: infinite;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

@keyframes markerPulsate {
    0% {
        transform: scale(0.1, 0.1);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.2, 1.2);
        opacity: 0;
    }
}

/* Donkere Glassmorphic Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: rgba(7, 22, 36, 0.95) !important;
    border: 1px solid rgba(0, 136, 204, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
    border-radius: 12px !important;
    padding: 2px !important;
}

.leaflet-popup-tip {
    background: rgba(7, 22, 36, 0.95) !important;
    border-left: 1px solid rgba(0, 136, 204, 0.15) !important;
    border-bottom: 1px solid rgba(0, 136, 204, 0.15) !important;
}

.leaflet-popup-close-button {
    color: var(--color-slate-400) !important;
    font-size: 16px !important;
    padding: 8px 10px 0 0 !important;
}

