* { box-sizing: border-box; }

:root {
    --bg: #0a1520;
    --panel: rgba(13, 30, 46, 0.82);
    --panel-solid: #10263c;
    --border: rgba(234, 242, 250, 0.09);
    --border-strong: rgba(234, 242, 250, 0.18);
    --text: #eef4fa;
    --text-dim: #8ba3bd;
    --accent: #e8b23a;
    --accent-2: #2ea3e8;
    --accent-2-deep: #1c5a8a;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    padding: 12px 22px;
    background: linear-gradient(180deg, rgba(13, 30, 46, 0.92), rgba(13, 30, 46, 0.78));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
}

.logo-mark {
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(46, 163, 232, 0.35));
}

.logo-text {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: nowrap;
}

.logo-accent {
    background: linear-gradient(120deg, var(--accent), #f3cd6f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.rederij-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
    padding: 3px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.rederij-btn {
    padding: 3px;
    border-radius: 9px;
    border: 1.5px solid transparent;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    opacity: 0.6;
    transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.rederij-btn:not(.active):first-child {
    opacity: 0.8;
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
}

.rederij-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.rederij-btn.active {
    opacity: 1;
    border-color: rgba(234, 242, 250, 0.55);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.rederij-btn.active:first-child {
    padding: 6px 14px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-2-deep), var(--accent-2));
    font-size: 13px;
    font-weight: 700;
    border-color: transparent;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    border-radius: 8px;
    background: #fff;
    height: 26px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.brand-logo img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 92px;
    object-fit: contain;
}

.panel-brand-logo {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 8px;
    background: #fff;
    height: 22px;
    margin-bottom: 10px;
}

.panel-brand-logo img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 110px;
    object-fit: contain;
}

.controls input {
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.controls input:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(46, 163, 232, 0.2);
}

.controls input::placeholder {
    color: var(--text-dim);
}

.controls button {
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, var(--accent-2-deep), var(--accent-2));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(28, 90, 138, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.controls button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(28, 90, 138, 0.45);
}

.controls button:active {
    transform: translateY(0);
}

.status {
    margin-left: auto;
    display: flex;
    gap: 18px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding-top: 96px;
}

.leaflet-container {
    height: 100%;
    width: 100%;
    background: var(--bg);
    font-family: inherit;
}

.leaflet-control-zoom {
    border: 1px solid var(--border-strong) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 10px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: var(--panel-solid) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: #16324c !important;
    color: var(--accent-2) !important;
}

.leaflet-control-attribution {
    background: rgba(10, 21, 32, 0.7) !important;
    color: var(--text-dim) !important;
    border-radius: 6px 0 0 0;
}

.leaflet-control-attribution a {
    color: var(--accent-2) !important;
}

.ship-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.85));
}

.leaflet-tooltip.ship-label {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0 0 0 3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.leaflet-tooltip.ship-label::before {
    display: none;
}

.ship-icon .arrow {
    display: inline-block;
    transform-origin: 50% 50%;
}

.live-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3b3b;
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.55); }
    70% { box-shadow: 0 0 0 6px rgba(255, 59, 59, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}

.rederij-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    margin-bottom: 8px;
}

.legend {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px 16px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 12px;
    color: var(--text);
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot--live {
    background: #ff3b3b;
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    animation: live-pulse 2s infinite;
}

@media (max-width: 720px) {
    .legend { left: 10px; bottom: 10px; padding: 10px 12px; }
}

/* Scheepsinfo-paneel */

.ship-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 88vw;
    background: linear-gradient(180deg, rgba(16, 38, 60, 0.97), rgba(10, 21, 32, 0.97));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border-strong);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1100;
    overflow-y: auto;
    padding: 26px 22px;
}

.ship-panel.open {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}

.panel-content h2 {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 800;
    font-family: 'Manrope', 'Inter', sans-serif;
    letter-spacing: -0.01em;
    padding-right: 30px;
}

.panel-region {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 18px;
}

.panel-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

.panel-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-stat {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}

.panel-stat .stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.panel-stat .stat-value {
    font-size: 19px;
    font-weight: 700;
    font-family: 'Manrope', 'Inter', sans-serif;
}

.panel-route {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 22px;
}

.panel-route .route-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-route .route-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.panel-route .route-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}

.panel-route .route-port {
    font-size: 14px;
    font-weight: 600;
}

.panel-route .route-eta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.panel-note {
    margin: 10px 2px 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-dim);
}

.panel-show-route {
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, var(--accent-2-deep), var(--accent-2));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(28, 90, 138, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.panel-show-route:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

@media (max-width: 720px) {
    .topbar { flex-direction: column; align-items: stretch; }
    .status { margin-left: 0; }
    #map { padding-top: 144px; }
    .ship-panel { width: 100%; max-width: 100%; }
}
