/* NMEA Router - Shared CSS for index.html and trip.html */

:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
    --bg-tertiary: #f8f9fa;
    --bg-accent: #e8f4f8;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #555;
    --text-bold: #2c3e50;
    --border-color: #ddd;
    --link-color: #3498db;
    --card-shadow: rgba(0,0,0,0.1);
    --sailing-color: #2980b9;
    --motoring-color: #d38d23;
    --moored-color: #7f8c8d;
    --empty-color: #ecf0f1;
    --heatmap-empty: #ecf0f1;
    --heatmap-1: #a9dfbf;
    --heatmap-2: #52be80;
    --heatmap-3: #27ae60;
    --heatmap-4: #1e8449;
    --heatmap-5: #0b5345;
    --btn-hover: rgba(127, 255, 0, 0.8);
    --primary-color: #2980b9;
    --secondary-color: #95a5a6;
}

body.dark-theme {
    --bg-primary: #080f1a;
    --bg-secondary: #0d1a2d;
    --bg-tertiary: #112237;
    --bg-accent: #1e3a52;
    --text-primary: #e0e8f0;
    --text-secondary: #a8b8cc;
    --text-tertiary: #c8d8e8;
    --text-bold: #ffffff;
    --border-color: #2a4a6f;
    --link-color: #3498db;
    --card-shadow: rgba(0,0,0,0.4);
    --sailing-color: #3498db;
    --motoring-color: #d38d23;
    --moored-color: #95a5a6;
    --empty-color: #1e3a52;
    --heatmap-empty: #0f1f3c;
    --heatmap-1: #1e3a52;
    --heatmap-2: #2d5a7f;
    --heatmap-3: #3d7a45;
    --heatmap-4: #4d9a25;
    --heatmap-5: #5dff11;
    --btn-hover: rgba(255, 255, 0, 0.2);
    --primary-color: #3498db;
    --secondary-color: #bdc3c7;
}

body {
    font-family: 'DM Mono', monospace;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
    color: var(--text-primary);
}

canvas {
    width: 100% !important;
    height: auto !important;
}

h2 {
    color: var(--text-primary);
    margin-top: 0px;
    margin-bottom: 15px;
}

.level-1-container {
    max-width: 1500px;
    margin: 0 auto 25px auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px var(--card-shadow);
}

.header-bar {
    max-width: 1500px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.navigation-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.nav-link-active {
    color: var(--text-bold);
    background: var(--bg-accent);
    font-weight: 600;
}

.theme-toggle {
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--btn-hover);
    opacity: 0.8;
}

.shutdown-btn {
    color: #e74c3c;
    padding: 8px 12px;
}

.shutdown-btn:hover {
    background: rgba(231, 76, 60, 0.12);
    border-color: #e74c3c;
    opacity: 1;
}

.app-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.app-btn:hover {
    background: var(--btn-hover);
    border-radius: 4px;
}

.app-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #999;
    transition: background-color 0.3s ease;
}

.status-dot.connected {
    background-color: #27ae60;
}

.status-dot.disconnected {
    background-color: #e74c3c;
}

.sailing-percentage {
    color: var(--sailing-color);
    font-weight: bold;
}

.motoring-percentage {
    color: var(--motoring-color);
    font-weight: bold;
}


/* Card Stat Styles */

.card-stats {
display: flex;
gap: 28px;
margin-bottom: 16px;
align-items: flex-start;
}

.card-stat {
}

.card-stat-value {
font-family: 'DM Mono', monospace;
font-size: 24px;
font-weight: 500;
color: var(--text-primary);
letter-spacing: -0.02em;
line-height: 1;
}


.card-stat-value .unit-sm {
font-size: 13px;
font-weight: 400;
color: var(--text-secondary);
}

.card-stat-label {
font-size: 10px;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--text-secondary);
margin-top: 4px;
}

.card-stat-value.is-sail { color: var(--sailing-color); }
.card-stat-value.is-motor { color: var(--motoring-color); }

.stat-divider {
width: 1px;
height: 32px;
background: var(--border-color);
margin-bottom: 6px;
}


/* Voyage Bar Legend Styles */

.voyage-bar-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.vbl-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

.vbl-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    flex-shrink: 0;
  }

.vbl-dot.sail { background: var(--sailing-color); }
.vbl-dot.motor { background: var(--motoring-color); }

.vbl-val { font-weight: 500; color: var(--text-primary); margin-right: 1px; }

/*------------------ Voyage Progress Bar Styles ------------------*/
/* voyage bar */
  .voyage-bar-wrap { 
    width: 100%;
    margin-bottom: 6px; 
}

  .voyage-bar {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-color);
    display: flex;
    gap: 1px;
  }

  .vb-sail {
    background: var(--sailing-color);
    border-radius: 6px 0 0 6px;
    transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
  }

  .vb-motor {
    background: var(--motoring-color);
    transition: width 0.8s 0.1s cubic-bezier(0.16,1,0.3,1);
  }

/* Analytics and Summary Card Styles */
.analyticsTitle {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
    grid-column: 1 / -1;
}

.analyticsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    grid-column: 1 / -1;
}

.analyticsCard {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid var(--link-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.analyticsCard:hover {
    background-color: var(--bg-secondary);
    box-shadow: 0 0 8px rgba(93, 186, 255, 0.3);
}

.analyticsCardTitle {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    text-align: left;
}

.analyticsValue {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-bold);
    margin-bottom: 4px;
    text-align: left;
}

.analyticsDetail {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

/* ─── APP CARD ─── */
.app-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 24px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    box-shadow: 0 4px 15px var(--card-shadow);
    transform: translateY(-2px);
}

.app-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--sailing-color);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.app-card:hover::after {
    opacity: 1;
}
/* ────────────────── */

/* ─── MAP TRACK TOOLTIP ─── */
.map-track-tooltip {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: black;
}

.map-track-tooltip .tooltip-time {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.map-track-tooltip .tooltip-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-track-tooltip .tooltip-value {
    font-weight: 500;
}

/* Toggle switch (shared between pages) */
.tracking-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.tracking-toggle-container:hover {
    opacity: 0.8;
}

.toggle-switch {
    display: inline-block;
    width: 30px;
    height: 18px;
    background-color: #999;
    border-radius: 9px;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background-color: var(--sailing-color);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s ease;
}

.toggle-switch.active::after {
    left: 14px;
}

/* Shared styled select */
.styled-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.styled-select:hover {
    border-color: var(--sailing-color);
}
/* ─────────────────────────── */