/* Sailing Monitor 2025 - Styles */

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a8e8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a3e;
    --accent-glow: rgba(0, 168, 232, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 20px;
    padding: 0;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

.features-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.features-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}

.market-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    background: rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(39, 174, 96, 0.5);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.market-link:hover {
    background: rgba(39, 174, 96, 0.4);
    border-color: #27ae60;
    transform: translateY(-2px);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.status-indicator {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    color: var(--success-color);
}

.status-indicator.offline {
    color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timestamp {
    color: var(--text-secondary);
    margin-left: auto;
}

/* Main Content */
main {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Panel */
.panel {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    box-sizing: border-box;
}

.panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
    padding: 0;
}

/* Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.data-card {
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 168, 232, 0.2);
}

.data-icon {
    font-size: 2.5rem;
}

.data-content {
    flex: 1;
}

.data-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 0.2rem 0;
}

.data-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Anchor Watch Card - Safe State (Green) */
.ai-anchor-card.anchored.safe {
    border: 2px solid var(--success-color) !important;
    box-shadow: 0 0 20px var(--success-color), 0 0 40px rgba(0, 255, 136, 0.3) !important;
    animation: anchorPulseSafe 2s ease-in-out infinite;
}

.ai-anchor-card.anchored.safe .data-value {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-color);
    font-weight: bold;
}

.ai-anchor-card.anchored.safe .data-icon {
    filter: drop-shadow(0 0 10px var(--success-color));
    animation: anchorSway 3s ease-in-out infinite;
}

/* Anchor Watch Card - Warning State (Orange) */
.ai-anchor-card.anchored.warning {
    border: 2px solid var(--warning-color) !important;
    box-shadow: 0 0 25px var(--warning-color), 0 0 50px rgba(255, 136, 0, 0.4) !important;
    animation: anchorPulseWarning 1.5s ease-in-out infinite;
}

.ai-anchor-card.anchored.warning .data-value {
    color: var(--warning-color);
    text-shadow: 0 0 10px var(--warning-color);
    font-weight: bold;
}

.ai-anchor-card.anchored.warning .data-icon {
    filter: drop-shadow(0 0 10px var(--warning-color));
    animation: anchorShake 0.5s ease-in-out infinite;
}

/* Anchor Watch Card - Alarm State (Red) - INTENSIVE BLINKING */
.ai-anchor-card.anchored.alarm {
    border: 3px solid var(--danger-color) !important;
    box-shadow: 0 0 30px var(--danger-color), 0 0 60px rgba(255, 34, 34, 0.6) !important;
    animation: anchorPulseAlarm 0.5s ease-in-out infinite;
}

.ai-anchor-card.anchored.alarm .data-value {
    color: var(--danger-color);
    text-shadow: 0 0 15px var(--danger-color);
    font-weight: bold;
    animation: textBlink 0.8s ease-in-out infinite;
}

.ai-anchor-card.anchored.alarm .data-icon {
    filter: drop-shadow(0 0 15px var(--danger-color));
    animation: anchorAlarmShake 0.3s ease-in-out infinite;
}

/* Autopilot Card - Active State (Green) */
.autopilot-card.active {
    border: 2px solid var(--success-color) !important;
    box-shadow: 0 0 20px var(--success-color), 0 0 40px rgba(0, 255, 136, 0.3) !important;
    animation: anchorPulseSafe 2s ease-in-out infinite;
}

.autopilot-card.active .data-value {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-color);
}

.autopilot-card.active .data-icon {
    filter: drop-shadow(0 0 10px var(--success-color));
}

/* Animations */
@keyframes anchorPulseSafe {
    0%, 100% {
        box-shadow: 0 0 20px var(--success-color), 0 0 40px rgba(0, 255, 136, 0.3) !important;
        border-color: var(--success-color) !important;
    }
    50% {
        box-shadow: 0 0 30px var(--success-color), 0 0 60px rgba(0, 255, 136, 0.5) !important;
        border-color: var(--success-color) !important;
    }
}

@keyframes anchorPulseWarning {
    0%, 100% {
        box-shadow: 0 0 25px var(--warning-color), 0 0 50px rgba(255, 136, 0, 0.4) !important;
        border-color: var(--warning-color) !important;
    }
    50% {
        box-shadow: 0 0 35px var(--warning-color), 0 0 70px rgba(255, 136, 0, 0.6) !important;
        border-color: var(--warning-color) !important;
    }
}

@keyframes anchorPulseAlarm {
    0%, 100% {
        box-shadow: 0 0 40px var(--danger-color), 0 0 80px rgba(255, 34, 34, 0.8) !important;
        border-color: var(--danger-color) !important;
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 60px var(--danger-color), 0 0 120px rgba(255, 34, 34, 1) !important;
        border-color: #ff0000 !important;
        opacity: 0.95;
    }
}

@keyframes anchorSway {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@keyframes anchorShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-2px) rotate(-3deg);
    }
    75% {
        transform: translateX(2px) rotate(3deg);
    }
}

@keyframes anchorAlarmShake {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    25% {
        transform: translateX(-3px) translateY(-2px) scale(1.05);
    }
    50% {
        transform: translateX(3px) translateY(2px) scale(1.1);
    }
    75% {
        transform: translateX(-2px) translateY(1px) scale(1.05);
    }
}

@keyframes textBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Alarm Dismiss Button */
.alarm-dismiss-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 15px var(--danger-color);
    animation: dismissButtonPulse 1s ease-in-out infinite;
    transition: all 0.2s;
}

.alarm-dismiss-btn:hover {
    background: #ff5555;
    transform: scale(1.05);
}

.alarm-dismiss-btn:active {
    transform: scale(0.95);
}

@keyframes dismissButtonPulse {
    0%, 100% {
        box-shadow: 0 0 15px var(--danger-color);
    }
    50% {
        box-shadow: 0 0 25px var(--danger-color);
    }
}

/* Map */
.map-panel {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

#map {
    height: 600px;
    border-radius: 8px;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Responsive map controls */
@media (max-width: 768px) {
    .map-controls {
        gap: 0.4rem;
    }

    .map-controls button,
    .map-controls select {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

.map-controls button,
.map-controls select {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.map-controls button:hover {
    background: var(--secondary-color);
}

.map-controls select {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
}

/* Fullscreen map styles */
.map-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--dark-bg);
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.map-panel.fullscreen #map {
    height: 100vh;
    border-radius: 0;
}

.map-panel.fullscreen h2 {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10000;
    background: rgba(22, 33, 62, 0.95);
    padding: 8px 16px;
    border-radius: 8px;
    margin: 0;
    border: 1px solid var(--primary-color);
}

.map-panel.fullscreen .map-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Export Panel */
.export-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, background 0.2s;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--card-bg);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .header-top {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }

    .header-top > div {
        width: 100%;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .features-link,
    .market-link,
    .theme-selector-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .theme-icon {
        font-size: 1rem;
    }

    main {
        padding: 1rem;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #map {
        height: 300px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--text-secondary);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert/Warning */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border-left: 4px solid var(--danger-color);
}

/* Wind Card Click Hint */
.wind-card {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.wind-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 168, 232, 0.4);
}

.card-hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.wind-card:hover .card-hint {
    opacity: 1;
}

/* ========================================
   FULLSCREEN WIND DISPLAY - GARMIN STYLE
   ======================================== */

.wind-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    animation: fadeIn 0.3s ease;
}

.wind-modal.active {
    display: block;
}

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

.wind-modal-content {
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--card-bg) 100%);
}

/* Close Button */
.wind-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50%;
    z-index: 10001;
    transition: background 0.2s;
}

.wind-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Header */
.wind-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wind-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    letter-spacing: 0.3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--accent-glow);
}

.wind-mode {
    font-size: 1.2rem;
    color: var(--success-color);
    letter-spacing: 0.2rem;
    font-weight: 300;
}

/* Main Wind Display */
.wind-main-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex: 1;
    gap: 3rem;
    margin-bottom: 2rem;
}

/* Wind Speed Display */
.wind-speed-display {
    text-align: center;
    flex: 1;
}

.wind-speed-value {
    font-size: 12rem;
    font-weight: bold;
    color: var(--success-color);
    line-height: 1;
    text-shadow: 0 0 30px var(--accent-glow);
    font-family: 'Courier New', monospace;
    letter-spacing: -0.5rem;
}

.wind-speed-unit {
    font-size: 2rem;
    color: var(--secondary-color);
    letter-spacing: 0.5rem;
    margin-top: 1rem;
}

/* Wind Compass */
.wind-compass-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.wind-compass {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 168, 232, 0.3));
}

.wind-angle-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.wind-angle-value {
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 168, 232, 0.8);
    font-family: 'Courier New', monospace;
}

.wind-angle-unit {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Secondary Data Grid */
.wind-data-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(42, 42, 62, 0.3);
    border-radius: 15px;
    border: 2px solid #2a2a3e;
}

.wind-data-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 10px;
    border: 1px solid var(--secondary-color);
}

.wind-data-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    letter-spacing: 0.15rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.wind-data-value {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.trend-arrow {
    font-size: 2.5rem;
    color: var(--success-color);
}

.trend-arrow.up {
    color: var(--danger-color);
}

.trend-arrow.down {
    color: var(--success-color);
}

/* Wind History Graph */
.wind-history {
    height: 200px;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 15px;
    padding: 1rem;
    border: 2px solid #2a2a3e;
}

.wind-history canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   SWIPE CONTAINER & INDICATORS
   ======================================== */

.wind-displays-container {
    display: flex;
    width: 300%; /* 3 displays */
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wind-display-page {
    width: 33.333%; /* 100% / 3 displays */
    height: 100%;
    flex-shrink: 0;
}

/* Display Indicators (Dots) */
.display-indicator {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 10002;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
    transition: all 0.3s;
    cursor: pointer;
}

.indicator-dot.active {
    background: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
    transform: scale(1.2);
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Swipe Hint - hidden for cleaner look */
.swipe-hint {
    display: none;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ========================================
   RACING/REGATTA DISPLAY - DISPLAY 2
   ======================================== */

.racing-display {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
}

.racing-main-display {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
    flex: 1;
    padding: 1rem 2rem;
}

/* Racing Columns */
.racing-left-column,
.racing-right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: space-around;
}

.racing-center-display {
    flex: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Racing Data Items */
.racing-data-item {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid #333;
    border-left: 3px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: left;
}

.racing-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.racing-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.racing-unit {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-top: 0.3rem;
}

/* Racing Compass */
.racing-compass {
    width: 100%;
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 168, 232, 0.2));
}

/* ========================================
   NEMESIS DISPLAY - DISPLAY 3 (B&G Style)
   ======================================== */

.nemesis-display {
    background: #000;
}

.nemesis-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* Corner Data Displays */
.nemesis-corner {
    position: absolute;
    padding: 1.5rem 2rem;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #222;
    border-radius: 10px;
}

.nemesis-top-left {
    top: 8rem;
    left: 3rem;
}

.nemesis-top-right {
    top: 8rem;
    right: 3rem;
}

.nemesis-bottom-left {
    bottom: 3rem;
    left: 3rem;
    padding: 1rem 1.5rem;
}

.nemesis-bottom-right {
    bottom: 3rem;
    right: 3rem;
}

.nemesis-corner-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.nemesis-corner-value {
    font-size: 4rem;
    font-weight: bold;
    color: #00aaff; /* Cyan for boat speed */
    line-height: 1;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
}

.nemesis-corner-unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* Specific Colors for Different Values */
.nemesis-depth {
    color: #ffaa00; /* Orange for depth */
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
}

.nemesis-tws {
    color: var(--danger-color); /* Red for wind speed */
    text-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
    font-size: 3rem;
}

.nemesis-twa {
    color: var(--success-color); /* Green for wind angle */
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

/* B&G Logo */
.nemesis-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    letter-spacing: 0.2rem;
    writing-mode: vertical-rl;
    text-orientation: upright;
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.nemesis-tws-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-left: 2rem;
    margin-bottom: 0.5rem;
}

.nemesis-tws-unit {
    font-size: 1rem;
}

/* Wind Speed Graph (Mini Sparkline) */
#nemesis-wind-graph {
    display: block;
    margin-left: 2rem;
    opacity: 0.7;
}

/* Center Compass Ring */
.nemesis-center {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nemesis-compass-ring {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(0, 168, 232, 0.3));
}

/* Responsive Design for Wind Display */
@media (max-width: 1400px) {
    .wind-speed-value {
        font-size: 8rem;
    }

    .wind-main-display {
        flex-direction: column;
    }

    .racing-main-display {
        flex-direction: column;
    }

    .racing-value {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .wind-modal-content {
        padding: 1rem;
    }

    .wind-header h1 {
        font-size: 1.8rem;
    }

    .wind-speed-value {
        font-size: 6rem;
    }

    .wind-angle-value {
        font-size: 2.5rem;
    }

    .wind-data-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .wind-data-value {
        font-size: 1.5rem;
    }

    .wind-close-btn {
        font-size: 2rem;
        width: 40px;
        height: 40px;
        line-height: 40px;
        top: 0.5rem;
        right: 1rem;
    }

    .racing-main-display {
        padding: 0.5rem;
        gap: 1rem;
    }

    .racing-data-item {
        padding: 0.8rem 1rem;
    }

    .racing-value {
        font-size: 1.8rem;
    }

    .racing-label {
        font-size: 0.65rem;
    }

    /* Nemesis responsive */
    .nemesis-container {
        padding: 1rem;
    }

    .nemesis-corner {
        padding: 0.8rem 1rem;
    }

    .nemesis-corner-value {
        font-size: 2.5rem;
    }

    .nemesis-tws {
        font-size: 2rem;
    }

    .nemesis-top-left, .nemesis-top-right {
        top: 5rem;
    }

    .nemesis-top-left {
        left: 1rem;
    }

    .nemesis-top-right {
        right: 1rem;
    }

    .nemesis-bottom-left {
        left: 1rem;
        bottom: 1rem;
    }

    .nemesis-bottom-right {
        right: 1rem;
        bottom: 1rem;
    }

    .nemesis-center {
        width: 350px;
        height: 350px;
    }

    .nemesis-logo {
        font-size: 1rem;
    }
}

/* ========================================
   SPEED DISPLAY STYLES
   ======================================== */

/* Speed Card Click Hint */
.speed-card {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.speed-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 168, 232, 0.4);
}

.speed-card:hover .card-hint {
    opacity: 1;
}

/* Speed Modal */
.speed-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    animation: fadeIn 0.3s ease;
}

.speed-modal.active {
    display: block;
}

.speed-modal-content {
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Close Button */
.speed-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50%;
    z-index: 10001;
    transition: background 0.2s;
}

.speed-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Speed Header */
.speed-header {
    text-align: center;
    margin-bottom: 2rem;
}

.speed-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    letter-spacing: 0.3rem;
    text-shadow: 0 0 20px rgba(0, 168, 232, 0.5);
}

/* Swipe Container for Speed Displays */
.speed-displays-container {
    display: flex;
    width: 300%; /* 3 displays */
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.speed-display-page {
    width: 33.333%; /* 100% / 3 displays */
    min-height: 100%;
    flex-shrink: 0;
}

/* ========================================
   DIGITAL SPEED DISPLAY - DISPLAY 1
   ======================================== */

.speed-digital-main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    min-height: min-content;
}

/* Primary Speed Display */
.speed-primary-display {
    text-align: center;
    padding: 2rem;
    background: rgba(26, 26, 46, 0.3);
    border-radius: 20px;
    border: 2px solid var(--secondary-color);
}

.speed-primary-label {
    font-size: 1.5rem;
    color: var(--secondary-color);
    letter-spacing: 0.3rem;
    margin-bottom: 1rem;
}

.speed-primary-value {
    font-size: 15rem;
    font-weight: bold;
    color: var(--success-color);
    line-height: 1;
    text-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: -0.8rem;
}

.speed-primary-unit {
    font-size: 2.5rem;
    color: var(--secondary-color);
    letter-spacing: 0.5rem;
    margin-top: 1rem;
}

/* Secondary Speed Data Grid */
.speed-data-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0 2rem;
}

.speed-data-item {
    background: rgba(26, 26, 46, 0.5);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.speed-data-item.highlight {
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.speed-data-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.speed-data-value {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.speed-data-value.cyan {
    color: #00aaff;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
}

.speed-data-value.orange {
    color: #ffaa00;
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
}

.speed-data-value.green {
    color: var(--success-color);
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

.speed-data-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Statistics Row */
.speed-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem;
    background: rgba(42, 42, 62, 0.3);
    border-radius: 15px;
    border: 2px solid #2a2a3e;
}

.speed-stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 10px;
    border: 1px solid #444;
}

.speed-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.speed-stat-value {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.speed-stat-unit {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-top: 0.3rem;
}

/* ========================================
   ANALOG GAUGES DISPLAY - DISPLAY 2
   ======================================== */

.speed-analog-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: min-content;
    justify-content: center;
}

/* Gauge Container */
.gauge-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-label {
    font-size: 1.5rem;
    color: var(--secondary-color);
    letter-spacing: 0.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* Gauge SVG Styling */
.speed-gauge,
.rpm-gauge {
    width: 100%;
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 168, 232, 0.3));
}

/* Gauge Bottom Data Row */
.gauge-data-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem;
    background: rgba(42, 42, 62, 0.3);
    border-radius: 15px;
    border: 2px solid #2a2a3e;
}

.gauge-data-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 10px;
    border: 1px solid #444;
}

.gauge-data-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.gauge-data-value {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* ========================================
   PERFORMANCE GAUGE DISPLAY - DISPLAY 3
   ======================================== */

.speed-gauge-main {
    display: flex;
    gap: 2rem;
    flex: 1;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Performance Gauge Container */
.performance-gauge-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.performance-speed-gauge {
    width: 100%;
    max-width: 600px;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 168, 232, 0.3));
}

/* Side Data Panels */
.performance-data-panels {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 0.8;
}

.perf-side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.perf-data-block {
    background: rgba(26, 26, 46, 0.6);
    border: 2px solid #333;
    border-left: 4px solid var(--secondary-color);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.perf-data-block:hover {
    border-left-color: var(--success-color);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.perf-data-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.perf-data-value {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: bold;
    font-family: 'Courier New', monospace;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.perf-data-value.green-glow {
    color: var(--success-color);
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

.perf-data-unit {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.3rem;
}

/* Performance Bar */
.performance-bar-container {
    padding: 2rem;
    background: rgba(42, 42, 62, 0.3);
    border-radius: 15px;
    border: 2px solid #2a2a3e;
}

.perf-bar-label {
    text-align: center;
    font-size: 1rem;
    color: var(--secondary-color);
    letter-spacing: 0.2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.perf-bar-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.perf-bar-bg {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #333;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.perf-bar-segment {
    flex: 1;
    transition: opacity 0.3s;
}

.perf-poor {
    background: linear-gradient(to right, #ff0000, #ff4444);
}

.perf-fair {
    background: linear-gradient(to right, #ff8800, #ffaa00);
}

.perf-good {
    background: linear-gradient(to right, #ffdd00, #88ff00);
}

.perf-excellent {
    background: linear-gradient(to right, #88ff00, #00ff00);
}

.perf-bar-indicator {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
}

.perf-arrow {
    font-size: 2rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 5px var(--secondary-color));
}

.perf-bar-labels-top {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.perf-bar-labels-bottom {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE DESIGN FOR SPEED DISPLAYS
   ======================================== */

@media (max-width: 1400px) {
    .speed-primary-value {
        font-size: 10rem;
        letter-spacing: -0.5rem;
    }

    .speed-data-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .speed-data-value {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .speed-modal-content {
        padding: 0.5rem;
        padding-top: 3rem;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .speed-header {
        margin-bottom: 1rem;
    }

    .speed-header h1 {
        font-size: 1.5rem;
        letter-spacing: 0.1rem;
    }

    .speed-digital-main {
        gap: 1rem;
        padding-bottom: 2rem;
    }

    .speed-primary-display {
        padding: 1rem;
        border-radius: 10px;
    }

    .speed-primary-label {
        font-size: 0.9rem;
        letter-spacing: 0.1rem;
        margin-bottom: 0.5rem;
    }

    .speed-primary-value {
        font-size: 4rem;
        letter-spacing: -0.2rem;
    }

    .speed-primary-unit {
        font-size: 1rem;
        letter-spacing: 0.2rem;
        margin-top: 0.5rem;
    }

    .speed-data-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0 0.5rem;
    }

    .speed-data-item {
        padding: 1rem 0.8rem;
    }

    .speed-data-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .speed-data-value {
        font-size: 2rem;
    }

    .speed-data-unit {
        font-size: 0.9rem;
    }

    .speed-stats-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem 0.5rem;
    }

    .speed-stat-item {
        padding: 1rem;
    }

    .speed-stat-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .speed-stat-value {
        font-size: 1.5rem;
    }

    .speed-stat-unit {
        font-size: 0.9rem;
    }

    /* Analog Gauges Mobile */
    .speed-analog-main {
        gap: 1rem;
        padding-bottom: 2rem;
        justify-content: flex-start;
    }

    .gauge-container {
        flex: none;
    }

    .gauge-label {
        font-size: 1rem;
        letter-spacing: 0.1rem;
        margin-bottom: 0.5rem;
    }

    .speed-gauge,
    .rpm-gauge {
        max-width: 100%;
    }

    .gauge-data-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem 0.5rem;
    }

    .gauge-data-item {
        padding: 1rem;
    }

    .gauge-data-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .gauge-data-value {
        font-size: 1.3rem;
    }

    .speed-close-btn {
        font-size: 2rem;
        width: 40px;
        height: 40px;
        line-height: 40px;
        top: 0.5rem;
        right: 1rem;
    }

    .display-indicator {
        top: 0.5rem;
    }

    .indicator-dot {
        width: 8px;
        height: 8px;
        gap: 0.5rem;
    }

    .swipe-hint {
        top: 2rem;
        font-size: 0.7rem;
    }

    /* Performance Gauge Mobile */
    .speed-gauge-main {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .performance-gauge-container {
        width: 100%;
    }

    .performance-speed-gauge {
        max-width: 100%;
    }

    .performance-data-panels {
        flex-direction: row;
        gap: 1rem;
        width: 100%;
    }

    .perf-side-panel {
        flex: 1;
        gap: 1rem;
    }

    .perf-data-block {
        padding: 0.8rem 1rem;
    }

    .perf-data-label {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .perf-data-value {
        font-size: 1.8rem;
    }

    .perf-data-unit {
        font-size: 0.8rem;
    }

    .performance-bar-container {
        padding: 1rem;
    }

    .perf-bar-label {
        font-size: 0.8rem;
        letter-spacing: 0.1rem;
        margin-bottom: 0.8rem;
    }

    .perf-bar-bg {
        height: 30px;
    }

    .perf-arrow {
        font-size: 1.5rem;
    }

    .perf-bar-labels-top {
        font-size: 0.65rem;
        padding: 0 0.5rem;
        margin-bottom: 0.3rem;
    }

    .perf-bar-labels-bottom {
        font-size: 0.55rem;
        padding: 0 0.3rem;
    }
}

/* ===== AUTOPILOT DISPLAY ===== */
.autopilot-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.autopilot-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.autopilot-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    width: 100%;
    max-width: 900px;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    box-shadow: 0 0 50px rgba(0, 168, 232, 0.3);
}

.autopilot-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autopilot-close-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: rotate(90deg);
}

/* Header */
.autopilot-header {
    text-align: center;
    margin-bottom: 2rem;
}

.autopilot-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 168, 232, 0.5);
}

.autopilot-status-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.autopilot-mode {
    padding: 0.5rem 2rem;
    background: linear-gradient(135deg, #2a2a3e, #1a1a2e);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 168, 232, 0.3);
}

.autopilot-mode.active {
    background: linear-gradient(135deg, var(--secondary-color), #0088cc);
    color: var(--text-primary);
    border-color: var(--success-color);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
}

/* Main Display */
.autopilot-main-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.autopilot-course-display {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    border-radius: 15px;
    border: 2px solid var(--secondary-color);
}

.ap-course-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.ap-course-value {
    font-size: 4rem;
    font-weight: bold;
    color: var(--success-color);
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    line-height: 1;
}

.ap-course-unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.autopilot-compass {
    width: 300px;
    height: 300px;
}

.autopilot-compass svg {
    filter: drop-shadow(0 0 10px rgba(0, 168, 232, 0.3));
}

.autopilot-heading-display {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    border: 2px solid #0088cc;
}

.ap-heading-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.ap-heading-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Controls */
.autopilot-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ap-mode-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ap-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #2a2a3e, #1a1a2e);
    color: var(--text-primary);
    border: 2px solid #444;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.ap-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 168, 232, 0.4);
}

.ap-btn:active {
    transform: translateY(0);
}

.ap-btn-standby {
    border-color: #ffc107;
    color: #ffc107;
}

.ap-btn-standby:hover {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    border-color: #ffc107;
}

.ap-btn-auto {
    border-color: var(--success-color);
    color: var(--success-color);
}

.ap-btn-auto:hover {
    background: linear-gradient(135deg, #00ff00, #00cc00);
    color: #000;
    border-color: var(--success-color);
}

.ap-btn-auto.active {
    background: linear-gradient(135deg, #00ff00, #00cc00);
    color: #000;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6);
}

.ap-course-controls {
    display: flex;
    justify-content: center;
}

.ap-control-row {
    display: flex;
    gap: 0.5rem;
}

.ap-btn-course {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    padding: 1.2rem 1.5rem;
}

.ap-btn-course:hover {
    background: linear-gradient(135deg, var(--secondary-color), #0088cc);
    color: var(--text-primary);
}

.ap-btn-large {
    padding: 1.2rem 2rem;
}

.ap-btn-icon {
    font-size: 1.5rem;
}

.ap-btn-label {
    font-size: 0.9rem;
}

.ap-tack-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ap-btn-tack {
    border-color: #ff8800;
    color: #ff8800;
    flex: 1;
    max-width: 200px;
}

.ap-btn-tack:hover {
    background: linear-gradient(135deg, #ff8800, #ff6600);
    color: var(--text-primary);
}

.ap-wind-mode {
    display: flex;
    justify-content: center;
}

.ap-btn-wind {
    border-color: #00ffcc;
    color: #00ffcc;
    min-width: 300px;
}

.ap-btn-wind:hover {
    background: linear-gradient(135deg, #00ffcc, #00ccaa);
    color: #000;
}

.ap-btn-wind.active {
    background: linear-gradient(135deg, #00ffcc, #00ccaa);
    color: #000;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.6);
}

/* Status Info */
.autopilot-status-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid #444;
}

.ap-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.ap-info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ap-info-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .autopilot-modal-content {
        padding: 1rem;
    }

    .autopilot-header h1 {
        font-size: 1.8rem;
    }

    .autopilot-mode {
        font-size: 1.2rem;
        padding: 0.4rem 1.5rem;
    }

    .ap-course-value {
        font-size: 3rem;
    }

    .autopilot-compass {
        width: 250px;
        height: 250px;
    }

    .ap-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .ap-control-row {
        flex-wrap: wrap;
    }

    .ap-btn-wind {
        min-width: auto;
        width: 100%;
    }

    .ap-info-item {
        min-width: 30%;
    }
}

/* ===== Weather Display Modal ===== */
.weather-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
}

.weather-modal.active {
    display: block;
}

.weather-modal-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--dark-bg);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.weather-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.weather-source {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.weather-close {
    background: var(--danger-color);
    border: none;
    color: white;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.weather-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.weather-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Current Weather */
.current-weather {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
}

.weather-icon-large {
    width: 100px;
    height: 100px;
}

.current-conditions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.weather-item {
    display: flex;
    flex-direction: column;
}

.weather-item-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.weather-item-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.weather-description {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

/* Weather Map */
#weather-map {
    height: 400px;
    border-radius: 8px;
    background: var(--dark-bg);
}

.wind-arrow {
    background: transparent !important;
    border: none !important;
}

/* Hourly Forecast */
.hourly-forecast-section {
    grid-column: 1 / -1;
}

#hourly-forecast {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.forecast-hour {
    min-width: 100px;
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.forecast-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.forecast-hour img {
    width: 50px;
    height: 50px;
    margin: 0.5rem 0;
}

.forecast-temp {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.forecast-wind {
    font-size: 1rem;
    color: var(--secondary-color);
}

.forecast-wind-dir {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Weather Charts */
.weather-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.chart-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.chart-container h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Leaflet overrides for theme compatibility */
.leaflet-container {
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: var(--dark-bg);
}

.leaflet-popup-content-wrapper {
    background: var(--card-bg);
    color: var(--text-primary);
}

.leaflet-popup-tip {
    background: var(--card-bg);
}

/* Weather Card Specific */
.weather-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

/* Responsive Weather */
@media (max-width: 1200px) {
    .weather-grid {
        grid-template-columns: 1fr;
    }

    .weather-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .weather-modal-content {
        margin: 1rem;
        padding: 1rem;
    }

    .weather-header h1 {
        font-size: 1.8rem;
    }

    .current-weather {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .current-conditions {
        grid-template-columns: 1fr;
    }

    #hourly-forecast {
        gap: 0.5rem;
    }

    .forecast-hour {
        min-width: 80px;
        padding: 0.8rem;
    }

    .chart-wrapper {
        height: 250px;
    }
}

/* ===== AIS Display Modal ===== */
.ais-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: auto;
}

.ais-modal.active {
    display: block;
}

.ais-modal-content {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--dark-bg);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ais-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.ais-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin: 0;
}

.ais-status {
    font-size: 1.2rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.ais-close {
    background: var(--danger-color);
    border: none;
    color: white;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ais-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

.ais-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.ais-map-section,
.ais-targets-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.ais-map-section h2,
.ais-targets-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

#ais-map {
    height: 500px;
    border-radius: 8px;
    background: var(--dark-bg);
    margin-bottom: 1rem;
}

.ais-range-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.ais-range-control label {
    color: var(--text-secondary);
    font-weight: 500;
}

.ais-range-control select {
    background: var(--dark-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.ais-range-control select:hover {
    border-color: var(--secondary-color);
}

/* Targets List */
#ais-targets-list {
    max-height: 500px;
    overflow-y: auto;
}

.ais-no-targets {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.ais-target-item {
    background: var(--dark-bg);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ais-target-item:hover {
    background: rgba(0, 168, 232, 0.1);
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.ais-target-item.ais-target-critical {
    border-left: 4px solid var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.ais-target-item.ais-target-warning {
    border-left: 4px solid var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

.ais-target-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.ais-target-icon {
    font-size: 1.5rem;
}

.ais-target-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.ais-target-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.ais-target-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Target Details Panel */
.ais-target-details {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    margin-top: 2rem;
}

.ais-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.ais-details-header h3 {
    color: var(--secondary-color);
    margin: 0;
    font-size: 1.5rem;
}

.ais-details-close {
    background: var(--danger-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ais-details-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

.ais-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ais-detail-item {
    display: flex;
    flex-direction: column;
}

.ais-detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.ais-detail-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* CPA Warning */
.ais-cpa-warning {
    display: none;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.ais-cpa-warning.ais-cpa-critical {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid var(--danger-color);
}

.ais-cpa-warning.ais-cpa-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid var(--warning-color);
}

.ais-cpa-warning.ais-cpa-caution {
    background: rgba(0, 168, 232, 0.1);
    border: 2px solid var(--secondary-color);
}

.ais-cpa-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.ais-cpa-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ais-cpa-item {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

.ais-cpa-item span:first-child {
    color: var(--text-secondary);
}

.ais-cpa-item span:last-child {
    font-weight: bold;
    color: var(--text-primary);
}

/* Map Markers */
.ais-ship-marker,
.own-ship-marker {
    background: transparent !important;
    border: none !important;
}

.ais-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* AIS Card Specific */
.ais-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.ais-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

/* Responsive AIS */
@media (max-width: 1200px) {
    .ais-main-grid {
        grid-template-columns: 1fr;
    }

    .ais-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ais-modal-content {
        margin: 1rem;
        padding: 1rem;
    }

    .ais-header h1 {
        font-size: 1.8rem;
    }

    .ais-details-grid {
        grid-template-columns: 1fr;
    }

    #ais-map {
        height: 350px;
    }

    #ais-targets-list {
        max-height: 350px;
    }

    .ais-cpa-info {
        grid-template-columns: 1fr;
    }
}

/* =================================
   RADAR DISPLAY STYLES
   ================================= */

/* Radar Card */
.radar-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.radar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);
}

/* Radar Modal */
.radar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow: auto;
}

.radar-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-modal-content {
    width: 95%;
    max-width: 1600px;
    height: 90vh;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 255, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Radar Header */
.radar-header {
    background: linear-gradient(135deg, #0a3622 0%, #0d5233 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--success-color);
}

.radar-header h1 {
    color: var(--success-color);
    font-size: 1.8em;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.radar-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.radar-mode-indicator {
    background: rgba(0, 255, 0, 0.2);
    color: var(--success-color);
    padding: 5px 15px;
    border-radius: 5px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid var(--success-color);
}

.radar-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2em;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.3s ease;
}

.radar-close:hover {
    color: var(--danger-color);
    transform: scale(1.2);
}

/* Radar Main Container */
.radar-main-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex: 1;
    overflow: hidden;
}

/* Radar PPI Container */
.radar-ppi-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0e14;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    padding: 10px;
    position: relative;
}

#radar-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    cursor: crosshair;
}

/* Radar Controls Panel */
.radar-controls-panel {
    width: 300px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.radar-control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.radar-control-section:last-child {
    border-bottom: none;
}

.radar-control-section h3 {
    color: var(--success-color);
    font-size: 0.9em;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: monospace;
}

/* Range Buttons */
.radar-range-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.radar-range-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    transition: all 0.2s ease;
}

.radar-range-btn:hover {
    background: var(--bg-hover);
    border-color: var(--success-color);
}

.radar-range-btn.active {
    background: var(--success-color);
    color: var(--bg-primary);
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.radar-range-unit {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-top: 8px;
    font-family: monospace;
}

/* Radar Sliders */
.radar-control-section input[type="range"] {
    width: 100%;
    margin: 10px 0;
    height: 6px;
    background: var(--bg-primary);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

.radar-control-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--success-color);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.radar-control-section input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--success-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.radar-slider-value {
    text-align: right;
    color: var(--success-color);
    font-family: monospace;
    font-weight: bold;
    font-size: 0.9em;
}

.radar-slider-value small {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.75em;
    display: block;
    margin-top: 2px;
}

/* Radar Option Buttons */
.radar-option-btn {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.2s ease;
}

.radar-option-btn:hover {
    background: var(--bg-hover);
    border-color: var(--success-color);
}

.radar-option-btn.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: var(--success-color);
    color: var(--success-color);
}

.radar-clear-btn {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.radar-clear-btn:hover {
    background: rgba(255, 193, 7, 0.2);
}

/* Radar Legend */
.radar-info-section {
    margin-top: 20px;
}

.radar-info-section h3 {
    color: var(--success-color);
    font-size: 0.9em;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: monospace;
}

.radar-legend {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.radar-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.radar-legend-item:last-child {
    margin-bottom: 0;
}

.radar-legend-symbol {
    font-size: 1.2em;
    width: 25px;
    text-align: center;
    font-family: monospace;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .radar-main-container {
        flex-direction: column;
    }

    .radar-controls-panel {
        width: 100%;
        max-height: 300px;
    }

    .radar-ppi-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .radar-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .radar-header h1 {
        font-size: 1.2em;
    }

    .radar-range-buttons {
        grid-template-columns: repeat(4, 1fr);
    }

    .radar-ppi-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .radar-header {
        padding: 15px;
    }

    .radar-header h1 {
        font-size: 1em;
    }

    .radar-main-container {
        padding: 10px;
    }

    .radar-controls-panel {
        padding: 15px;
    }

    .radar-ppi-container {
        height: 350px;
    }
}

/* =================================
   ENERGY MANAGEMENT STYLES
   ================================= */

/* Energy Card */
.energy-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.energy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);
}

/* Energy Modal */
.energy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2100;
    overflow: auto;
}

.energy-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.energy-modal-content {
    width: 95%;
    max-width: 1800px;
    height: 95vh;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(255, 193, 7, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Energy Header */
.energy-header {
    background: linear-gradient(135deg, #3a2a0d 0%, #5a4a2d 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--warning-color);
}

.energy-header h1 {
    color: var(--warning-color);
    font-size: 1.8em;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.energy-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.energy-mode-indicator {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    padding: 5px 15px;
    border-radius: 5px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid var(--warning-color);
}

.energy-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2em;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.3s ease;
}

.energy-close:hover {
    color: var(--danger-color);
    transform: scale(1.2);
}

/* Main Container */
.energy-main-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.energy-left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.energy-right-column {
    width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Energy Flow Section */
.energy-flow-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.energy-flow-section h2 {
    color: var(--warning-color);
    margin-top: 0;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#energy-flow-diagram {
    width: 100%;
    height: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

/* Battery Visual */
.energy-battery-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.energy-battery-section h2, .energy-battery-section h3 {
    color: var(--success-color);
    margin-top: 0;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.energy-battery-section h3 {
    font-size: 1em;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.battery-visual {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.battery-container {
    display: flex;
    align-items: flex-end;
}

.battery-body {
    width: 120px;
    height: 180px;
    border: 4px solid var(--success-color);
    border-radius: 8px;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.battery-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75%;
    background: linear-gradient(to top, #00ff00, #00cc00);
    transition: height 1s ease, background 1s ease;
}

.battery-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.battery-terminal {
    width: 60px;
    height: 15px;
    background: var(--success-color);
    border-radius: 3px 3px 0 0;
    margin-left: 30px;
}

.battery-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.battery-stats-compact {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.battery-stat-item {
    background: var(--bg-primary);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.battery-stat-full {
    grid-column: 1 / -1;
}

.battery-stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.battery-stat-value {
    color: var(--success-color);
    font-size: 1.2em;
    font-weight: bold;
    font-family: monospace;
}

.battery-time-remaining {
    color: var(--warning-color);
    font-size: 1.1em;
    font-weight: bold;
    display: block;
    text-align: center;
}

/* Power Sources */
.energy-sources-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.energy-sources-section h2 {
    color: var(--warning-color);
    margin-top: 0;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.source-item {
    background: var(--bg-primary);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.source-item.source-active {
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.source-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.source-icon {
    font-size: 24px;
}

.source-name {
    flex: 1;
    font-weight: bold;
    color: var(--text-primary);
}

.source-power {
    color: var(--warning-color);
    font-weight: bold;
    font-family: monospace;
}

.source-details {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.source-detail {
    color: var(--text-secondary);
}

.source-toggle-btn {
    width: 100%;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.2s ease;
}

.source-toggle-btn:hover {
    background: var(--success-color);
    color: var(--bg-primary);
}

/* Power Consumers */
.energy-consumers-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    flex: 1;
    overflow-y: auto;
}

.energy-consumers-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.consumers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.consumer-item {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.consumer-item.consumer-active {
    border-color: var(--success-color);
}

.consumer-item.consumer-inactive {
    opacity: 0.5;
}

.consumer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.consumer-icon {
    font-size: 20px;
}

.consumer-name {
    flex: 1;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.95em;
}

.consumer-power {
    color: var(--danger-color);
    font-weight: bold;
    font-family: monospace;
    font-size: 0.9em;
}

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

.consumer-toggle-btn {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.consumer-toggle-btn:hover {
    background: var(--warning-color);
    color: var(--bg-primary);
}

.consumer-essential {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    border: 1px solid var(--warning-color);
}

/* Chart Section */
.energy-chart-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    height: 300px;
}

.energy-chart-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.energy-chart-section .chart-container {
    height: calc(100% - 50px);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .energy-main-container {
        flex-direction: column;
    }

    .energy-right-column {
        width: 100%;
    }

    .battery-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .energy-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .energy-header h1 {
        font-size: 1.2em;
    }

    .battery-stats {
        grid-template-columns: 1fr;
    }

    .battery-body {
        width: 100px;
        height: 150px;
    }

    .energy-chart-section {
        height: 250px;
    }
}

/* ========================================
   WATER MANAGEMENT MODAL
   ======================================== */

.water-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.water-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.water-modal-content {
    background: var(--bg-primary);
    width: 95%;
    max-width: 1600px;
    max-height: 95vh;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.water-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
}

.water-header h1 {
    margin: 0;
    color: white;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.water-header h1::before {
    content: '💧';
    font-size: 1.2em;
}

.water-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.2s ease;
}

.water-close-btn:hover {
    background: white;
    color: #1976d2;
    transform: scale(1.05);
}

/* Main Container */
.water-main-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.water-right-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Tanks Section */
.water-tanks-section {
    grid-row: 1 / 3;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.water-tanks-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tanks-display {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Individual Tank */
.tank-container {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.tank-container:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.3);
}

.tank-name {
    color: var(--primary-color);
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tank-visual {
    width: 150px;
    height: 300px;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
    border: 4px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 2px 15px rgba(0, 0, 0, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.3);
}

.tank-level-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #2196f3, #64b5f6);
    transition: height 0.8s ease, background 0.3s ease;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 -2px 10px rgba(33, 150, 243, 0.5);
}

.tank-level-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.5) 50%,
        transparent 100%);
    animation: waterShimmer 3s ease-in-out infinite;
}

.tank-level-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(255,255,255,0.2) 0%,
        transparent 50%,
        rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

@keyframes waterShimmer {
    0%, 100% { transform: translateX(-150%); }
    50% { transform: translateX(150%); }
}

.tank-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    letter-spacing: 2px;
}

.tank-info {
    width: 100%;
    text-align: center;
}

.tank-liters {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.tank-capacity {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.tank-temp {
    font-size: 0.85em;
    color: var(--info-color);
    margin-top: 8px;
    font-family: monospace;
}

.tank-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tank-btn {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.tank-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Bilge Tank Special Styling */
.tank-bilge {
    border-color: var(--warning-color);
}

.tank-bilge .tank-name {
    color: var(--warning-color);
}

.bilge-stats {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bilge-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-hover);
    border-radius: 4px;
    font-size: 0.85em;
}

.bilge-stat-label {
    color: var(--text-secondary);
}

.bilge-stat-value {
    color: var(--primary-color);
    font-weight: bold;
    font-family: monospace;
}

.bilge-alarm {
    background: var(--danger-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    animation: bilgeAlarmPulse 1s ease-in-out infinite;
}

@keyframes bilgeAlarmPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Pumps Section */
.water-pumps-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.water-pumps-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pump-item {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.pump-item:last-child {
    margin-bottom: 0;
}

.pump-item:hover {
    border-color: var(--primary-color);
}

.pump-running {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.pump-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pump-icon {
    font-size: 1.3em;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.pump-running .pump-icon {
    background: var(--success-color);
    border-color: var(--success-color);
    animation: pumpPulse 1s ease-in-out infinite;
}

@keyframes pumpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.pump-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.95em;
    flex: 1;
}

.pump-status {
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: bold;
}

.pump-running .pump-status {
    background: var(--success-color);
    color: white;
}

.pump-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pump-info span {
    font-family: monospace;
}

.pump-toggle-btn {
    width: 100%;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    font-weight: bold;
}

.pump-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
}

.pump-running .pump-toggle-btn {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* Alerts Section */
.water-alerts-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.water-alerts-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.water-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.water-alert {
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid;
    font-size: 0.95em;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.water-alert-ok {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
}

.water-alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.water-alert-critical {
    background: rgba(244, 67, 54, 0.15);
    border-color: var(--danger-color);
    color: var(--danger-color);
    animation: alertPulse 1.5s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.alert-icon {
    font-size: 1.3em;
}

.alert-message {
    flex: 1;
    font-weight: 500;
}

/* Stats Section */
.water-stats-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.water-stats-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.water-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.water-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.water-stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.water-stat-value {
    color: var(--primary-color);
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1em;
}

/* Chart Section */
.water-chart-section {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--border-color);
    height: 350px;
}

.water-chart-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.water-chart-section .chart-container {
    height: calc(100% - 50px);
    position: relative;
}

/* Responsive Design */
@media (max-width: 1600px) {
    .tanks-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1400px) {
    .water-main-container {
        grid-template-columns: 1fr;
    }

    .water-tanks-section {
        grid-row: auto;
    }
}

@media (max-width: 1000px) {
    .tanks-display {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .water-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .water-header h1 {
        font-size: 1.2em;
    }

    .water-main-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .water-tanks-section {
        grid-row: auto;
    }

    .tanks-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tank-visual {
        width: 120px;
        height: 240px;
    }

    .water-chart-section {
        height: 250px;
    }
}

/* ========================================
   FISHFINDER & SONAR MODAL
   ======================================== */

.fishfinder-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.fishfinder-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.fishfinder-modal-content {
    background: var(--bg-primary);
    width: 98%;
    max-width: 1800px;
    height: 95vh;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.fishfinder-header {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
}

.fishfinder-header h1 {
    margin: 0;
    color: white;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.fishfinder-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.2s ease;
}

.fishfinder-close-btn:hover {
    background: white;
    color: #1a237e;
    transform: scale(1.05);
}

/* Main Container */
.fishfinder-main-container {
    flex: 1;
    overflow: hidden;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 350px;
    grid-template-rows: auto 1fr;
    gap: 15px;
}

/* Mode Selector */
.fishfinder-mode-selector {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mode-btn {
    flex: 1;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 20px rgba(0, 168, 232, 0.5);
}

/* Display Area */
.fishfinder-display-area {
    position: relative;
    background: #000814;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.sonar-display-container,
.realview-display-container {
    width: 100%;
    height: 100%;
}

#sonar-canvas,
#realview-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Info Panel */
.fishfinder-info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.fishfinder-readings,
.fishfinder-settings,
.fishfinder-alarms-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
}

.fishfinder-readings h3,
.fishfinder-settings h3,
.fishfinder-alarms-section h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Readings */
.reading-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reading-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.reading-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 4px;
}

.reading-value {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: bold;
    font-family: monospace;
}

.reading-value-sub {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-left: 8px;
}

/* Settings */
.setting-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: bold;
}

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

.range-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.2s ease;
}

.range-btn:hover {
    background: var(--primary-color);
    color: white;
}

#range-value {
    flex: 1;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.2em;
    font-weight: bold;
    font-family: monospace;
}

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

#gain-slider {
    flex: 1;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

#gain-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

#gain-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#gain-value {
    min-width: 50px;
    text-align: right;
    color: var(--primary-color);
    font-weight: bold;
    font-family: monospace;
}

/* Alarms */
#fishfinder-alarms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sonar-alert {
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
    font-size: 0.9em;
    animation: slideIn 0.3s ease;
}

.sonar-alert-ok {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
}

.sonar-alert-info {
    background: rgba(33, 150, 243, 0.15);
    border-color: var(--info-color);
    color: var(--info-color);
}

.sonar-alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.sonar-alert-critical {
    background: rgba(244, 67, 54, 0.15);
    border-color: var(--danger-color);
    color: var(--danger-color);
    animation: alertPulse 1.5s ease-in-out infinite;
}

.alarm-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alarm-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.alarm-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .fishfinder-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    .fishfinder-info-panel {
        flex-direction: row;
        overflow-x: auto;
    }

    .fishfinder-readings,
    .fishfinder-settings,
    .fishfinder-alarms-section {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .fishfinder-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .fishfinder-header h1 {
        font-size: 1.2em;
    }

    .fishfinder-main-container {
        padding: 10px;
        gap: 10px;
    }

    .fishfinder-mode-selector {
        flex-direction: column;
    }

    .reading-value {
        font-size: 1.2em;
    }
}

/* ========================================
   AI FEATURES MODALS
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    max-width: 1200px;
}

.large-modal {
    max-width: 1400px;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.8em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 25px;
}

/* AI Sections */
.ai-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-section h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.3em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

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

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
}

.status-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.status-value {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.1em;
}

/* AI Buttons */
.ai-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.ai-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.ai-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 232, 0.4);
}

.ai-btn.danger {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
}

.ai-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

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

.ai-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Alerts */
.alerts-container {
    max-height: 300px;
    overflow-y: auto;
}

.alert-ok {
    background: rgba(0, 255, 0, 0.1);
    border-left: 4px solid #00ff00;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    color: #00ff00;
}

.alert-critical {
    background: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #ff0000;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    color: #ff0000;
    animation: pulse 1s infinite;
}

.alert-warning {
    background: rgba(255, 136, 0, 0.1);
    border-left: 4px solid #ff8800;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    color: #ff8800;
}

.alert-info {
    background: rgba(0, 168, 232, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    color: var(--primary-color);
}

/* AI Analysis */
.ai-quality {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.ai-recommendation {
    padding: 15px;
    background: rgba(0, 168, 232, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.5;
}

/* Collision Summary */
.collision-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.summary-item {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-item.danger {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
}

.summary-item.warning {
    background: rgba(255, 136, 0, 0.1);
    border: 2px solid #ff8800;
}

.summary-item.caution {
    background: rgba(255, 255, 0, 0.1);
    border: 2px solid #ffff00;
}

.summary-item.safe {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
}

.summary-label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

/* Targets List */
.targets-list {
    max-height: 400px;
    overflow-y: auto;
}

.target-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid;
}

.target-item.risk-danger {
    border-color: #ff0000;
}

.target-item.risk-warning {
    border-color: #ff8800;
}

.target-item.risk-caution {
    border-color: #ffff00;
}

.target-item.risk-safe {
    border-color: #00ff00;
}

.target-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.target-icon {
    font-size: 1.5em;
}

.target-name {
    font-weight: bold;
    flex: 1;
}

.target-source {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.target-details, .target-cpa {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.target-detail, .cpa-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.detail-value {
    font-weight: bold;
    color: var(--text-primary);
}

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

.segments-list {
    max-height: 400px;
    overflow-y: auto;
}

.segment-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid var(--text-secondary);
}

.segment-item.active {
    border-left-color: var(--primary-color);
    background: rgba(0, 168, 232, 0.05);
}

.segment-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.segment-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.segment-route {
    flex: 1;
    font-weight: bold;
    font-size: 1.1em;
}

.segment-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.segment-details, .segment-weather {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.segment-detail, .weather-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

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

.recommendation-item {
    padding: 12px;
    background: rgba(0, 168, 232, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    line-height: 1.5;
}

.no-targets, .no-route {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.anchor-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.route-creator {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.route-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-input-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.coordinate-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.coordinate-inputs input[type="number"] {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.95em;
}

.coordinate-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

.planning-status {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    margin-top: 10px;
}

.planning-status.active {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.planning-status.success {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    border: 1px solid #00ff00;
}

.planning-status.error {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.route-statistics {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.route-statistics h4 {
    margin: 0 0 15px 0;
    color: var(--accent-color);
    font-size: 1.1em;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--accent-color);
}

/* Route markers on map */
.route-marker {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 6px;
    padding: 5px 10px;
    font-weight: bold;
    color: white;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.route-marker.start-marker {
    border-color: #00a8e8;
}

.route-marker.end-marker {
    border-color: #00ff00;
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 10px;
}

.map-hint {
    color: var(--text-secondary);
    font-size: 0.85em;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* AI Routing Map */
.routing-map {
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Leaflet styling for routing map */
.routing-map .leaflet-tile-pane {
    opacity: 0.9;
}

.routing-map .leaflet-control-zoom a {
    background-color: rgba(22, 33, 62, 0.95);
    color: #ffffff;
    border: 1px solid var(--border-color);
}

.routing-map .leaflet-control-zoom a:hover {
    background-color: var(--primary-color);
}

.routing-map .leaflet-popup-content-wrapper {
    background: rgba(22, 33, 62, 0.98);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
}

.routing-map .leaflet-popup-tip {
    background: rgba(22, 33, 62, 0.98);
}

/* Wind arrow markers */
.wind-arrow-marker {
    background: transparent !important;
    border: none !important;
}

/* Weather layer legend (for routing map) */
.weather-legend {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px;
    z-index: 1000;
    font-size: 0.85em;
}

/* Track map wind legend */
.track-map-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px;
    z-index: 10001;
    font-size: 0.85em;
    min-width: 140px;
}

/* In fullscreen mode, move legend to avoid overlap with title */
.map-panel.fullscreen .track-map-legend {
    top: 60px;
}

.weather-legend h4,
.track-map-legend h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 0.95em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ffffff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Nautical Charts Modal Styles
   ============================================ */

.fullscreen-modal {
    width: 98%;
    height: 95vh;
    max-width: none;
}

.charts-modal-body {
    padding: 0;
    height: calc(95vh - 70px);
    overflow: hidden;
}

.charts-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.nautical-map {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 1;
}

/* Leaflet custom styles for dark theme */
.nautical-map .leaflet-tile-pane {
    opacity: 0.9;
}

.nautical-map .leaflet-control-zoom a {
    background-color: rgba(22, 33, 62, 0.95);
    color: #ffffff;
    border: 1px solid var(--border-color);
}

.nautical-map .leaflet-control-zoom a:hover {
    background-color: var(--primary-color);
}

.nautical-map .leaflet-popup-content-wrapper {
    background: rgba(22, 33, 62, 0.98);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
}

.nautical-map .leaflet-popup-tip {
    background: rgba(22, 33, 62, 0.98);
}

/* Boat marker custom styling */
.boat-marker {
    background: transparent !important;
    border: none !important;
}

/* Charts controls overlay */
.charts-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.charts-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.charts-info .info-item {
    margin-bottom: 8px;
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.charts-info .info-item strong {
    color: var(--primary-color);
    margin-right: 10px;
}

.charts-info .info-item span {
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.charts-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.chart-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 168, 232, 0.3);
    text-align: left;
}

.chart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.5);
}

.chart-btn:active {
    transform: translateY(0);
}

.charts-warning {
    padding: 12px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    color: var(--warning-color);
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charts-controls {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 15px;
    }

    .charts-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .chart-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px;
        font-size: 0.9em;
    }

    .fullscreen-modal {
        width: 100%;
        height: 100vh;
    }

    .charts-modal-body {
        height: calc(100vh - 60px);
    }
}

/* ============================================================================
   AI Routing Tabs
   ============================================================================ */

.ai-routing-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.ai-routing-tab {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
}

.ai-routing-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.ai-routing-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(2px);
}

.tab-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== COMPASS DISPLAY MODAL ==================== */

/* Compass Modal - Same structure as Wind Display */
.compass-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 3000;
    overflow: hidden;
}

.compass-modal.active {
    display: block;
}

/* Container for all displays */
.compass-displays-container {
    display: flex;
    width: 500%; /* 5 displays */
    height: 100%;
    transition: transform 0.3s ease;
}

/* Each display page */
.compass-display-page {
    width: 20%; /* 100% / 5 */
    height: 100%;
    flex-shrink: 0;
}

.compass-page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

/* Close button */
.compass-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50%;
    z-index: 100;
}

.compass-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Indicator dots */
.compass-modal .display-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.compass-modal .indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.compass-modal .indicator-dot.active {
    background: #00ff88;
    transform: scale(1.3);
}

.compass-modal .indicator-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Legacy support for old structure */
.compass-view {
    width: 20%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.compass-title {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

/* Minimal dots */
.compass-dots-minimal {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
}

.compass-dot-mini {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.compass-dot-mini.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.compass-dot-mini:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Classic Marine Compass */
.classic-compass-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.classic-compass-svg {
    width: 100%;
    height: 100%;
}

.classic-digital-readout {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    font-family: 'Courier New', monospace;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.compass-data-row {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.compass-data-item {
    text-align: center;
}

.compass-data-item .label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.compass-data-item .value {
    font-size: 20px;
    color: #fff;
    font-family: monospace;
}

/* Digital Precision */
.digital-compass-container {
    width: 100%;
    max-width: 500px;
}

.digital-main-display {
    text-align: center;
    margin-bottom: 30px;
}

.digital-heading-large {
    font-size: 120px;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.digital-heading-unit {
    font-size: 24px;
    color: #00aa00;
}

.digital-bar-container {
    margin: 20px 0;
}

.digital-bar {
    position: relative;
    height: 40px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    overflow: hidden;
}

.digital-bar-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    transition: left 0.1s;
}

.digital-bar-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    line-height: 40px;
    color: #666;
    font-size: 14px;
}

.digital-secondary {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.digital-item {
    text-align: center;
}

.digital-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.digital-value {
    font-size: 24px;
    font-family: monospace;
    color: #00ff00;
}

.digital-nmea-info {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.nmea-label {
    color: #666;
    margin-right: 10px;
}

.nmea-status {
    color: #00ff00;
}

/* Minimal Compass */
.minimal-compass-container {
    width: 400px;
    height: 400px;
}

.minimal-compass-svg {
    width: 100%;
    height: 100%;
}

/* Combo Compass */
.combo-compass-container {
    display: flex;
    gap: 40px;
    align-items: center;
}

.combo-analog {
    width: 300px;
    height: 300px;
}

.combo-compass-svg {
    width: 100%;
    height: 100%;
}

.combo-digital {
    width: 200px;
}

.combo-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #111;
    border-radius: 10px;
    border: 1px solid #333;
}

.combo-main {
    font-size: 48px;
    font-family: monospace;
    color: #fff;
}

.combo-sub {
    font-size: 12px;
    color: #888;
}

.combo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.combo-item {
    background: #111;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.combo-label {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 5px;
}

.combo-value {
    font-size: 16px;
    font-family: monospace;
    color: #00ff88;
}

/* Futuristic Compass */
.futuristic-compass-container {
    position: relative;
    width: 400px;
}

.futuristic-compass-svg {
    width: 100%;
    height: 400px;
}

.futuristic-data-panels {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.futuristic-panel {
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid #0066ff;
    border-radius: 5px;
    padding: 10px 15px;
}

.fp-item {
    margin: 5px 0;
}

.fp-label {
    font-size: 10px;
    color: #0088ff;
    margin-right: 10px;
}

.fp-value {
    font-size: 14px;
    font-family: monospace;
    color: #00ffff;
}

/* Animations */
@keyframes scan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#futuristic-scan {
    animation: scan 4s linear infinite;
}
