/* ============================================
   Lake Champlain & Hudson River Boater's Guide
   Touch-Friendly Responsive Styles
   ============================================ */

/* CSS Variables for Theming - 1800s Maritime Theme */
:root {
    /* Primary nautical colors - deeper 1800s palette */
    --primary-color: #0d2840;      /* Deep indigo-navy */
    --primary-dark: #061420;       /* Near-black maritime blue */
    --primary-light: #1a4d7a;      /* Faded naval blue */
    --secondary-color: #a67c3a;    /* Aged brass/bronze */
    --accent-color: #6b2632;       /* Faded ship paint red */
    --danger-color: #8b1e2f;       /* Deep maritime red */

    /* Text colors - aged ink */
    --text-color: #1a1410;         /* Dark brown-black (old ink) */
    --text-light: #4a3d2f;         /* Faded sepia */

    /* Background colors - aged parchment/canvas */
    --bg-color: #e8dcc5;           /* Weathered parchment */
    --panel-bg: #f2e9d8;           /* Aged canvas */
    --panel-bg-texture: linear-gradient(135deg,
        #f5ede0 0%,
        #ebe0ca 25%,
        #e3d4b8 50%,
        #d9c9a8 75%,
        #d0bf98 100%);              /* Multi-toned aged paper */

    /* Brass/Bronze accents - oxidized metal */
    --brass-color: #9d7434;        /* Oxidized brass */
    --brass-light: #b88d46;        /* Polished brass highlight */
    --brass-dark: #7a5a28;         /* Tarnished brass shadow */

    /* Wood tones - ship timber */
    --wood-dark: #2d1810;          /* Dark mahogany */
    --wood-medium: #4a2f1a;        /* Oak/teak */
    --wood-light: #6b4423;         /* Weathered pine */

    /* Borders and shadows */
    --border-color: #a89060;       /* Aged rope/hemp */
    --rope-color: #8b7550;         /* Manila rope */
    --shadow: 0 3px 12px rgba(13, 40, 64, 0.25);
    --shadow-lg: 0 6px 24px rgba(13, 40, 64, 0.35);
    --shadow-inset: inset 0 2px 8px rgba(77, 61, 47, 0.15);

    /* Dimensions */
    --radius: 2px;                 /* Minimal rounding (period-appropriate) */
    --radius-lg: 4px;
    --radius-md: 3px;
    --radius-sm: 1px;
    --touch-target: 48px;
    --transition: all 0.4s ease;   /* Slower, more deliberate */

    /* Marker Colors - 1800s maritime palette */
    --marina-color: #0d2840;       /* Deep naval blue */
    --restaurant-color: #6b2632;   /* Faded burgundy */
    --historic-color: #5a4230;     /* Aged brown */
    --bay-color: #2d5555;          /* Dark teal */
    --fuel-color: #9d7434;         /* Brass */
    --anchorage-color: #3a5a40;    /* Deep sea green */
    --lock-color: #4a3a5a;         /* Iron purple */
    --bridge-color: #4a4a4a;       /* Iron grey */
    --bridge-movable-color: #7a5230; /* Rust brown */
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
    background-color: var(--bg-color);
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(139, 117, 80, 0.03) 2px,
            rgba(139, 117, 80, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 117, 80, 0.03) 2px,
            rgba(139, 117, 80, 0.03) 4px
        );
    color: var(--text-color);
    line-height: 1.7;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-size: 16px;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Header Styles - Wood Plank with Brass
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background:
        linear-gradient(180deg,
            rgba(45, 28, 16, 0.98) 0%,
            rgba(35, 20, 12, 1) 50%,
            rgba(29, 17, 10, 1) 100%
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 100px,
            rgba(0,0,0,0.15) 100px,
            rgba(0,0,0,0.15) 102px
        );
    background-color: var(--wood-dark);
    color: #f2e9d8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 3px solid var(--brass-dark);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    border-bottom: 3px solid var(--brass-color);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--brass-dark) 0%,
        var(--brass-light) 50%,
        var(--brass-dark) 100%
    );
}

.header-logo {
    height: 55px;
    width: auto;
    margin-right: 15px;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.header-content h1 {
    font-family: 'IM Fell English SC', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: var(--brass-light);
}

.header-content .tagline {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.85;
    margin-top: 2px;
    letter-spacing: 1px;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: var(--touch-target);
    height: var(--touch-target);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-right: 1rem;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--brass-light);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   Main Container & Layout
   ============================================ */
.app-container {
    position: relative;
    height: 100vh;
    width: 100vw;
    padding-top: 70px;
    display: flex;
}

.map-container {
    flex: 1;
    height: 100%;
    z-index: 1;
}

/* ============================================
   Side Panel Styles - Parchment with Rope Border
   ============================================ */
.side-panel {
    width: 380px;
    height: calc(100vh - 70px);
    background: var(--panel-bg-texture);
    background-color: var(--panel-bg);
    box-shadow:
        var(--shadow-lg),
        inset 0 0 50px rgba(139, 90, 43, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 500;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    order: -1;
    border-right: none;
    position: fixed;
    top: 70px;
    left: 0;
    transform: translateX(0);
}

.side-panel.hidden {
    transform: translateX(-100%);
}

/* ============================================
   Nautical Scrollbar - Rope & Brass Theme
   ============================================ */
/* WebKit browsers (Chrome, Safari, Edge) */
.side-panel::-webkit-scrollbar {
    width: 14px;
}

.side-panel::-webkit-scrollbar-track {
    background: linear-gradient(
        90deg,
        #2d1810 0%,
        #3a2416 50%,
        #2d1810 100%
    );
    border-left: 2px solid var(--brass-dark);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

.side-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--brass-light) 0%,
        var(--brass-color) 20%,
        var(--brass-dark) 40%,
        var(--brass-color) 60%,
        var(--brass-dark) 80%,
        var(--brass-light) 100%
    );
    border: 2px solid var(--wood-dark);
    border-radius: 2px;
    box-shadow:
        inset 0 0 6px rgba(255, 255, 255, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.side-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--brass-light) 0%,
        #c9a035 50%,
        var(--brass-dark) 100%
    );
    box-shadow:
        inset 0 0 8px rgba(255, 255, 255, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.4);
}

.side-panel::-webkit-scrollbar-thumb:active {
    background: linear-gradient(
        180deg,
        var(--brass-dark) 0%,
        var(--brass-color) 50%,
        var(--brass-dark) 100%
    );
}

/* Firefox */
.side-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--brass-color) var(--wood-dark);
}

/* Simple brass border trim */
.side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        180deg,
        var(--brass-dark) 0%,
        var(--brass-color) 25%,
        var(--brass-light) 50%,
        var(--brass-color) 75%,
        var(--brass-dark) 100%
    );
    z-index: 10;
    box-shadow:
        -1px 0 3px rgba(0,0,0,0.3),
        1px 0 2px rgba(0,0,0,0.2);
}


.panel-section {
    padding: 20px;
    border-bottom: 2px solid rgba(160, 128, 96, 0.3);
    position: relative;
}

/* Decorative corner flourish */
.panel-section::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    border-left: 2px solid var(--brass-color);
    border-top: 2px solid var(--brass-color);
    opacity: 0.5;
}

.panel-section h2 {
    font-family: 'IM Fell English SC', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--wood-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Form Elements (Touch Optimized)
   ============================================ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color);
}

.touch-select,
.touch-input {
    width: 100%;
    min-height: var(--touch-target);
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-color);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.touch-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.touch-select:focus,
.touch-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.2);
}

.speed-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-input-group .touch-input {
    width: 100px;
    text-align: center;
}

.unit-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.settings-row {
    display: flex;
    gap: 15px;
}

.settings-row .form-group {
    flex: 1;
}

/* ============================================
   Buttons (Nautical Brass Theme)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-target);
    padding: 12px 24px;
    font-family: 'IM Fell English SC', serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(180deg,
        var(--brass-light) 0%,
        var(--brass-color) 50%,
        var(--brass-dark) 100%
    );
    color: var(--wood-dark);
    border: 2px solid var(--brass-dark);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.btn-primary:hover,
.btn-primary:active {
    background: linear-gradient(180deg,
        var(--brass-color) 0%,
        var(--brass-dark) 50%,
        #8a6a1a 100%
    );
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: linear-gradient(180deg,
        var(--primary-light) 0%,
        var(--primary-color) 50%,
        var(--primary-dark) 100%
    );
    color: #f4e8d1;
    border: 2px solid var(--primary-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-secondary:hover,
.btn-secondary:active {
    background: linear-gradient(180deg,
        var(--primary-color) 0%,
        var(--primary-dark) 50%,
        #0a1c2e 100%
    );
}

.btn-outline {
    background: rgba(250, 246, 237, 0.8);
    border: 2px solid var(--rope-color);
    color: var(--wood-dark);
}

.btn-outline:hover,
.btn-outline:active {
    background: rgba(244, 232, 209, 1);
    border-color: var(--wood-medium);
}

.btn-small {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.swap-btn {
    width: 100%;
    margin-bottom: 15px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.swap-btn:hover {
    background: var(--border-color);
}

.calculate-btn {
    width: 100%;
    margin-top: 10px;
}

.clear-btn {
    width: 100%;
    margin-top: 10px;
}

/* ============================================
   Multi-Stop Routing Styles
   ============================================ */
.stops-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    overflow: hidden;
}

.stop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s, box-shadow 0.2s;
    min-width: 0;  /* Prevent flex children from overflowing */
    width: 100%;
    box-sizing: border-box;
}

.drag-handle {
    cursor: grab;
    padding: 8px;
    color: #6c757d;
    font-size: 16px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.stop-row.dragging {
    opacity: 0.5;
    background: #e9ecef;
}

.stop-row.drag-over {
    border-top: 2px solid #007bff;
    padding-top: 6px;
}

.stop-label {
    min-width: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-color);
    flex-shrink: 0;
}

.stop-select {
    flex: 1;
    min-width: 0;  /* Allow flex item to shrink below content size */
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-color);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.2);
}

.remove-stop-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.remove-stop-btn:hover {
    background: #c82333;
}

.remove-stop-btn.hidden {
    visibility: hidden;
}

.add-stop-btn {
    width: 100%;
    margin-bottom: 15px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px dashed var(--border-color);
    min-height: 40px;
}

.add-stop-btn:hover {
    background: var(--border-color);
    border-style: solid;
}

/* Intermediate stop marker style */
.custom-marker.intermediate {
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.6), 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================
   Itinerary Styles
   ============================================ */
.itinerary {
    margin-bottom: 15px;
}

.itinerary-leg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.itinerary-leg:last-child {
    border-bottom: none;
}

.leg-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary-color);
}

.leg-details {
    flex: 1;
    min-width: 0;
}

.leg-route {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.leg-route .from-to {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leg-route .arrow {
    color: var(--text-light);
    flex-shrink: 0;
}

.leg-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.leg-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.trip-totals {
    border-top: 2px solid var(--primary-color);
    padding-top: 12px;
    margin-top: 5px;
}

.trip-totals .result-item {
    padding: 6px 0;
}

.trip-totals .result-label {
    font-weight: 600;
}

.trip-totals .result-value {
    font-size: 1.2rem;
}

/* ============================================
   Trip Results - Nautical Card
   ============================================ */
.trip-results {
    background:
        linear-gradient(135deg, rgba(250, 246, 237, 0.95), rgba(244, 232, 209, 0.95)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 25 L30 20 L25 25 Z' fill='%23c9a227' opacity='0.1'/%3E%3C/svg%3E");
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 15px;
    border: 3px solid var(--brass-color);
    box-shadow:
        inset 0 0 20px rgba(139, 90, 43, 0.1),
        0 4px 8px rgba(0,0,0,0.15);
}

.trip-results.hidden {
    display: none;
}

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

.result-item:first-child {
    border-bottom: 2px solid rgba(201, 162, 39, 0.3);
}

.result-label {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.9rem;
    color: var(--text-light);
}

.result-value {
    font-family: 'IM Fell English SC', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--wood-dark);
}

/* ============================================
   Filter Buttons - Nautical Toggle Pills
   ============================================ */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 14px;
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(250, 246, 237, 0.9);
    border: 2px solid var(--rope-color);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--wood-dark);
}

.filter-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--brass-color);
}

.filter-btn.active {
    background: linear-gradient(180deg,
        var(--primary-light) 0%,
        var(--primary-color) 100%
    );
    color: #f4e8d1;
    border-color: var(--primary-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.filter-btn .filter-icon {
    font-size: 1.1rem;
}

/* ============================================
   Location List
   ============================================ */
.location-list-section {
    display: flex;
    flex-direction: column;
}

.search-box {
    margin-bottom: 15px;
}

.search-box .touch-input {
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
}

.location-list {
    list-style: none;
    margin: 0 -20px;
    padding: 0 20px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    min-height: var(--touch-target);
}

.location-item:hover,
.location-item:active {
    background: var(--border-color);
    transform: translateX(4px);
}

.location-item.selected {
    background: var(--primary-color);
    color: white;
}

.location-item .poi-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.location-item .poi-info {
    flex: 1;
    min-width: 0;
}

.location-item .poi-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-item .poi-type-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* POI Type Colors */
.poi-marker.marina { background: var(--marina-color); color: white; }
.poi-marker.restaurant { background: var(--restaurant-color); color: white; }
.poi-marker.historic { background: var(--historic-color); color: white; }
.poi-marker.bay { background: var(--bay-color); color: white; }
.poi-marker.fuel { background: var(--fuel-color); color: white; }
.poi-marker.anchorage { background: var(--anchorage-color); color: white; }
/* ATON (Aids to Navigation) Types - USCG IALA Region B Compliant */
/* Generic ATON fallback */
.poi-marker.aton { background: #cc0000; color: white; }

/* Lighthouse - White/Yellow octagonal shape */
.poi-marker.aton-lighthouse {
    background: linear-gradient(135deg, #ffffff 0%, #f1c40f 100%);
    color: #333;
    border: 2px solid #333;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* Red Nun (Starboard) - Red conical/triangular pointing UP */
.poi-marker.aton-red-nun {
    background: #cc0000;
    color: white;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    width: 24px;
    height: 28px;
}

/* Green Can (Port) - Green square/cylindrical */
.poi-marker.aton-green-can {
    background: #006633;
    color: white;
    border: 2px solid #004422;
    border-radius: 4px;
}

/* Red Daybeacon - Red triangle pointing UP */
.poi-marker.aton-red-daybeacon {
    background: #cc0000;
    color: white;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

/* Green Daybeacon - Green square */
.poi-marker.aton-green-daybeacon {
    background: #006633;
    color: white;
    border: 2px solid #004422;
    border-radius: 2px;
}

/* Safe Water Mark - Red and white vertical stripes, circular */
.poi-marker.aton-safe-water {
    background: repeating-linear-gradient(
        90deg,
        #cc0000 0px,
        #cc0000 4px,
        #ffffff 4px,
        #ffffff 8px
    );
    border: 2px solid #990000;
    border-radius: 50%;
}

/* Isolated Danger Mark - Black with red horizontal band */
.poi-marker.aton-danger {
    background: linear-gradient(
        to bottom,
        #000000 0%,
        #000000 35%,
        #cc0000 35%,
        #cc0000 65%,
        #000000 65%,
        #000000 100%
    );
    border: 2px solid #333;
    border-radius: 50%;
}

/* Special Mark - Yellow X shape (diamond) */
.poi-marker.aton-special {
    background: #ffcc00;
    color: #333;
    border: 2px solid #cc9900;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* Generic buoy - defaults to red nun style */
.poi-marker.aton-buoy {
    background: #cc0000;
    color: white;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

/* Daymark fallback */
.poi-marker.aton-daymark {
    background: #006633;
    color: white;
    border: 2px solid #004422;
}

/* Light - Yellow star-like */
.poi-marker.aton-light {
    background: #f1c40f;
    color: #333;
    border: 2px solid #d4ac0d;
}

/* Beacon fallback */
.poi-marker.aton-beacon {
    background: var(--primary-light);
    color: white;
}
/* Lock Type */
.poi-marker.lock { background: var(--lock-color); color: white; }
/* Bridge Types */
.poi-marker.bridge { background: var(--bridge-color); color: white; }
.poi-marker.bridge-fixed { background: var(--bridge-color); color: white; }
.poi-marker.bridge-draw { background: var(--bridge-movable-color); color: white; }
.poi-marker.bridge-swing { background: var(--bridge-movable-color); color: white; }
.poi-marker.bridge-bascule { background: var(--bridge-movable-color); color: white; }
.poi-marker.bridge-lift { background: var(--bridge-movable-color); color: white; }
/* Additional POI Types */
.poi-marker.hotel { background: #9b59b6; color: white; }
.poi-marker.campground { background: #27ae60; color: white; }
.poi-marker.boat-launch { background: #3498db; color: white; }
.poi-marker.beach { background: #f1c40f; color: #333; }
.poi-marker.ferry { background: #1abc9c; color: white; }
.poi-marker.island { background: #2ecc71; color: white; }
.poi-marker.public-dock { background: #34495e; color: white; }

/* ============================================
   Quick Info Panel - Nautical Card
   ============================================ */
.quick-info {
    position: fixed;
    bottom: 20px;
    left: 400px;
    right: 20px;
    max-width: 500px;
    background: var(--panel-bg-texture);
    background-color: var(--panel-bg);
    border-radius: var(--radius-lg);
    box-shadow:
        0 4px 20px rgba(0,0,0,0.25),
        inset 0 0 30px rgba(139, 90, 43, 0.08);
    padding: 20px;
    z-index: 600;
    transition: var(--transition);
    border: 3px solid var(--brass-color);
}

.quick-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--brass-dark) 0%,
        var(--brass-light) 50%,
        var(--brass-dark) 100%
    );
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.quick-info.hidden {
    display: none;
}

.quick-info .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--rope-color);
    background: rgba(250, 246, 237, 0.9);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wood-dark);
    transition: var(--transition);
}

.quick-info .close-btn:hover {
    background: var(--brass-light);
    border-color: var(--brass-dark);
    color: var(--wood-dark);
}

.quick-info h3 {
    font-family: 'IM Fell English SC', serif;
    font-size: 1.2rem;
    margin-bottom: 5px;
    padding-right: 40px;
    color: var(--wood-dark);
}

.quick-info .poi-type {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.85rem;
    color: var(--brass-dark);
    font-weight: 500;
    margin-bottom: 8px;
    font-style: italic;
}

.quick-info .poi-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.quick-info-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   Map Legend - Nautical Compass Style
   ============================================ */
.map-legend {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
}

.legend-toggle {
    min-height: 44px;
    padding: 10px 16px;
    font-family: 'IM Fell English SC', serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(180deg,
        var(--brass-light) 0%,
        var(--brass-color) 50%,
        var(--brass-dark) 100%
    );
    color: var(--wood-dark);
    border: 2px solid var(--brass-dark);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: var(--transition);
}

.legend-toggle:hover {
    background: linear-gradient(180deg,
        var(--brass-color) 0%,
        var(--brass-dark) 100%
    );
}

.legend-content {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: var(--panel-bg-texture);
    background-color: var(--panel-bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    padding: 15px;
    min-width: 180px;
    border: 2px solid var(--brass-color);
}

.legend-content.hidden {
    display: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.8rem;
    color: var(--wood-dark);
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-marker.marina { background: var(--marina-color); }
.legend-marker.restaurant { background: var(--restaurant-color); }
.legend-marker.historic { background: var(--historic-color); }
.legend-marker.bay { background: var(--bay-color); }
.legend-marker.fuel { background: var(--fuel-color); }
.legend-marker.anchorage { background: var(--anchorage-color); }
.legend-marker.lock { background: var(--lock-color); }
.legend-marker.bridge { background: var(--bridge-color); }
/* ATON Legend Markers - USCG Compliant */
.legend-marker.aton-red-nun {
    background: #cc0000;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.legend-marker.aton-green-can {
    background: #006633;
    border-radius: 2px;
}
.legend-marker.aton-lighthouse {
    background: linear-gradient(135deg, #ffffff 0%, #f1c40f 100%);
    border: 1px solid #333;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    border-radius: 0;
}
/* Additional POI Legend Markers */
.legend-marker.boat-launch { background: #3498db; }
.legend-marker.campground { background: #27ae60; }
.legend-marker.hotel { background: #9b59b6; }
.legend-marker.beach { background: #f1c40f; }
.legend-marker.ferry { background: #1abc9c; }
.legend-marker.island { background: #2ecc71; }
.legend-marker.public-dock { background: #34495e; }

/* ============================================
   Loading Overlay - Nautical Compass Theme
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at center, rgba(250, 246, 237, 0.98) 0%, rgba(244, 232, 209, 0.98) 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 L55 45 L50 40 L45 45 Z' fill='%23c9a227' opacity='0.05'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Ship Wheel / Compass Spinner */
.loading-spinner {
    width: 70px;
    height: 70px;
    position: relative;
    animation: spin 2s linear infinite;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid var(--brass-color);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 8px transparent,
        inset 0 0 0 10px var(--brass-dark);
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--brass-color);
    border-radius: 50%;
    box-shadow:
        0 -25px 0 -6px var(--wood-dark),
        0 25px 0 -6px var(--wood-dark),
        25px 0 0 -6px var(--wood-dark),
        -25px 0 0 -6px var(--wood-dark),
        18px -18px 0 -6px var(--wood-dark),
        -18px 18px 0 -6px var(--wood-dark),
        18px 18px 0 -6px var(--wood-dark),
        -18px -18px 0 -6px var(--wood-dark);
}

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

.loading-overlay p {
    font-family: 'IM Fell English SC', serif;
    font-size: 1rem;
    color: var(--wood-dark);
    margin-top: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============================================
   Custom Leaflet Marker Styles
   ============================================ */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.custom-marker:hover {
    transform: scale(1.2);
}

.custom-marker.marina { background: var(--marina-color); }
.custom-marker.restaurant { background: var(--restaurant-color); }
.custom-marker.historic { background: var(--historic-color); }
.custom-marker.bay { background: var(--bay-color); }
.custom-marker.fuel { background: var(--fuel-color); }
.custom-marker.anchorage { background: var(--anchorage-color); }
/* ATON (Aids to Navigation) Types - USCG IALA Region B Compliant */
.custom-marker.aton { background: #cc0000; border-radius: 50%; }

/* Lighthouse - Octagonal white/yellow */
.custom-marker.aton-lighthouse {
    background: linear-gradient(135deg, #ffffff 0%, #f1c40f 100%);
    border: 2px solid #333;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    border-radius: 0;
}

/* Red Nun (Starboard) - Red triangle pointing UP */
.custom-marker.aton-red-nun {
    background: #cc0000;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0;
}

/* Green Can (Port) - Green square */
.custom-marker.aton-green-can {
    background: #006633;
    border: 2px solid #004422;
    border-radius: 4px;
}

/* Red Daybeacon - Red triangle */
.custom-marker.aton-red-daybeacon {
    background: #cc0000;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0;
}

/* Green Daybeacon - Green square */
.custom-marker.aton-green-daybeacon {
    background: #006633;
    border: 2px solid #004422;
    border-radius: 2px;
}

/* Safe Water Mark - Red/white vertical stripes */
.custom-marker.aton-safe-water {
    background: repeating-linear-gradient(90deg, #cc0000 0px, #cc0000 3px, #fff 3px, #fff 6px);
    border: 2px solid #990000;
    border-radius: 50%;
}

/* Isolated Danger - Black with red band */
.custom-marker.aton-danger {
    background: linear-gradient(to bottom, #000 0%, #000 35%, #cc0000 35%, #cc0000 65%, #000 65%, #000 100%);
    border: 2px solid #333;
    border-radius: 50%;
}

/* Special Mark - Yellow diamond */
.custom-marker.aton-special {
    background: #ffcc00;
    border: 2px solid #cc9900;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    border-radius: 0;
}

/* Generic buoy fallback - red nun style */
.custom-marker.aton-buoy {
    background: #cc0000;
    border: 2px solid #990000;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0;
}

/* Daymark fallback - green */
.custom-marker.aton-daymark {
    background: #006633;
    border: 2px solid #004422;
}

/* Light - Yellow */
.custom-marker.aton-light {
    background: #f1c40f;
    border: 2px solid #d4ac0d;
}

/* Beacon fallback */
.custom-marker.aton-beacon {
    background: var(--primary-light);
}
/* Lock Type */
.custom-marker.lock { background: var(--lock-color); }
/* Bridge Types */
.custom-marker.bridge { background: var(--bridge-color); }
.custom-marker.bridge-fixed { background: var(--bridge-color); }
.custom-marker.bridge-draw { background: var(--bridge-movable-color); }
.custom-marker.bridge-swing { background: var(--bridge-movable-color); }
.custom-marker.bridge-bascule { background: var(--bridge-movable-color); }
.custom-marker.bridge-lift { background: var(--bridge-movable-color); }
/* Additional POI Types */
.custom-marker.hotel { background: #9b59b6; }
.custom-marker.campground { background: #27ae60; }
.custom-marker.boat-launch { background: #3498db; }
.custom-marker.beach { background: #f1c40f; }
.custom-marker.ferry { background: #1abc9c; }
.custom-marker.island { background: #2ecc71; }
.custom-marker.public-dock { background: #34495e; }

.custom-marker.selected {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(26, 95, 122, 0.5), 0 2px 8px rgba(0,0,0,0.3);
}

.custom-marker.start {
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.6), 0 2px 8px rgba(0,0,0,0.3);
}

.custom-marker.end {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.6), 0 2px 8px rgba(0,0,0,0.3);
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    padding: 0;
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 0.9rem;
}

/* Leaflet Layer Control Customization */
.leaflet-control-layers {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: none;
}

.leaflet-control-layers-toggle {
    width: 40px;
    height: 40px;
    background-size: 24px 24px;
}

.leaflet-control-layers-expanded {
    padding: 10px 15px;
    background: white;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.leaflet-control-layers-separator {
    margin: 8px 0;
    border-top: 1px solid var(--border-color);
}

/* Route Line Style */
.route-line {
    stroke: var(--primary-color);
    stroke-width: 4;
    stroke-dasharray: 10, 10;
    stroke-linecap: round;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media screen and (max-width: 900px) {
    .side-panel {
        width: 100%;
        max-width: 400px;
    }

    /* On mobile, start hidden to show map first */
    .side-panel.mobile-hidden {
        transform: translateX(-100%);
    }

    /* Toggle menu button shows panel */
    .side-panel.mobile-hidden:not(.hidden) {
        transform: translateX(0);
    }

    .quick-info {
        width: calc(100% - 40px);
        left: 20px;
        transform: none;
        bottom: 80px;
    }

    .map-legend {
        right: 20px;
        bottom: 80px;
    }
}

@media screen and (max-width: 600px) {
    .app-header {
        padding: 0 15px;
    }

    .header-logo {
        height: 40px;
        margin-right: 10px;
    }

    .header-content h1 {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .header-content .tagline {
        display: none;
    }

    .panel-section {
        padding: 15px;
    }

    .settings-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-buttons {
        gap: 6px;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .quick-info-actions {
        flex-direction: column;
    }

    .quick-info-actions .btn {
        width: 100%;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .touch-select,
    .touch-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .location-item:active {
        background: var(--primary-color);
        color: white;
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* Large Touch Screens (Surface Hub, etc.) */
@media screen and (min-width: 1400px) {
    :root {
        --touch-target: 56px;
    }

    .app-header {
        height: 80px;
    }

    .app-container {
        padding-top: 80px;
    }

    .side-panel {
        width: 450px;
        height: calc(100vh - 80px);
    }

    .header-content h1 {
        font-size: 1.6rem;
    }

    .panel-section h2 {
        font-size: 1.25rem;
    }

    .touch-select,
    .touch-input {
        font-size: 1.1rem;
        padding: 14px 18px;
    }

    .btn {
        font-size: 1rem;
        padding: 14px 28px;
    }

    .custom-marker {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Landscape Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .app-header {
        height: 50px;
    }

    .app-container {
        padding-top: 50px;
    }

    .side-panel {
        height: calc(100vh - 50px);
    }

    .panel-section {
        padding: 10px 15px;
    }

    .panel-section h2 {
        margin-bottom: 10px;
    }
}

/* ============================================
   Focus States for Keyboard Navigation
   ============================================ */
.btn:focus-visible,
.filter-btn:focus-visible,
.touch-select:focus-visible,
.touch-input:focus-visible,
.stop-select:focus-visible,
.legend-toggle:focus-visible,
.menu-toggle:focus-visible,
.close-btn:focus-visible,
.remove-stop-btn:focus-visible,
.add-stop-btn:focus-visible,
.location-item:focus-visible {
    outline: 3px solid var(--brass-color);
    outline-offset: 2px;
}

/* Make location items focusable */
.location-item {
    cursor: pointer;
}

.location-item:focus {
    outline: none;
}

/* ============================================
   Toast Notification System - Nautical Style
   ============================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: var(--radius);
    color: #f4e8d1;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 90%;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.2);
}

.toast.visible {
    opacity: 1;
}

.toast.error {
    background: linear-gradient(180deg, #a82039 0%, #8b1a2f 100%);
    border-color: #6b1525;
}

.toast.success {
    background: linear-gradient(180deg, #3d6b4f 0%, #2d5a3f 100%);
    border-color: #1d4a2f;
}

.toast.info {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-color: var(--primary-dark);
}

.toast.warning {
    background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass-color) 100%);
    color: var(--wood-dark);
    border-color: var(--brass-dark);
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .loading-spinner {
        animation: none;
    }

    .custom-marker:hover {
        transform: none;
    }

    .location-item:hover,
    .location-item:active {
        transform: none;
    }

    .btn-primary:hover,
    .btn-primary:active {
        transform: none;
    }
}

/* ============================================
   Skip Link for Accessibility
   ============================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Print Styles */
@media print {
    .side-panel,
    .app-header,
    .map-legend,
    .quick-info,
    .loading-overlay,
    .toast {
        display: none !important;
    }

    .app-container {
        padding: 0;
    }

    .map-container {
        width: 100%;
        height: 100vh;
    }
}

/* ============================================
   WEATHER SECTION STYLES
   ============================================ */
.weather-section {
    margin-top: 2rem;
}

.section-toggle {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.section-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.weather-content {
    padding-top: 1rem;
}

.weather-content.hidden {
    display: none;
}

.weather-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.weather-current {
    background: var(--panel-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--secondary-color);
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.weather-period {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.weather-wind {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.weather-condition {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.forecast-day {
    background: var(--panel-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--secondary-color);
    text-align: center;
}

.forecast-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0.25rem 0;
}

.forecast-wind {
    font-size: 0.85rem;
    color: #555;
    margin: 0.25rem 0;
}

.forecast-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.weather-alerts {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.weather-alert {
    margin-bottom: 0.75rem;
}

.weather-alert:last-child {
    margin-bottom: 0;
}

.alert-event {
    font-weight: bold;
    color: #856404;
    margin-bottom: 0.25rem;
}

.alert-headline {
    color: #856404;
    font-size: 0.9rem;
}

.alert-extreme {
    background: #f8d7da;
    border-color: #dc3545;
}

.alert-severe {
    background: #fff3cd;
    border-color: #ffc107;
}

.weather-updated {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 1rem 0 0.5rem;
    text-align: center;
}

.weather-attribution {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    font-size: 0.85rem;
}

.weather-source {
    color: var(--text-light);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.weather-source strong {
    color: var(--text-color);
    font-weight: 600;
}

.weather-source a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-light);
    transition: var(--transition);
}

.weather-source a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.wind-arrow-icon {
    pointer-events: none;
}

/* Submit POI Button in Header */
.submit-poi-btn {
    margin-left: auto;
    margin-right: 1rem;
}

@media (max-width: 900px) {
    .weather-forecast {
        grid-template-columns: 1fr;
    }

    .submit-poi-btn {
        display: none; /* Hide on mobile, use menu instead */
    }
}

/* ============================================
   POI SUBMISSION MODAL STYLES
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 58, 92, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--panel-bg-texture);
    border: 3px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    background: var(--panel-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--secondary-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: var(--panel-bg);
    position: sticky;
    bottom: 0;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.form-help {
    color: #666;
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    border: 1px solid #ffc107;
    display: flex;
    align-items: center;
}

.warning.hidden {
    display: none;
}

#submitSuccess {
    text-align: center;
    padding: 3rem 1.5rem;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

#submitSuccess h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#submitSuccess p {
    color: #333;
    margin-bottom: 1rem;
}

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

#submitSuccess a:hover {
    text-decoration: none;
}

/* Coordinate picking mode */
.modal.picking-mode .modal-content {
    opacity: 0.95;
}

/* Mobile responsiveness for modal */
@media (max-width: 900px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }

    .form-section {
        margin-bottom: 1.5rem;
    }
}
