/* Where Is Al - Stylesheet */

/* CSS Variables for Color Palette - Light Theme */
:root {
    /* Forest Greens */
    --forest-green-dark: #1e3a0f;
    --forest-green: #3d6b2a;
    --forest-green-light: #5a8a47;
    /* Earth Browns & Wood Tones */
    --earth-brown-dark: #5a3a1f;
    --earth-brown: #8b6f47;
    --earth-brown-light: #a6896b;
    
    /* Accent Colors */
    --trail-orange: #ff6b35;
    --campfire-orange: #ff8c5a;
    --trail-orange-dark: #e55a2b;
    
    /* Sky & Nature */
    --sky-blue: #87ceeb;
    --sky-blue-light: #e0f2f1;
    --sky-blue-dark: #5a9fc9;
    --forest-shadow: rgba(30, 58, 15, 0.1);
    
    /* Neutrals */
    --white: #ffffff;
    --off-white: #faf9f6;
    --cream: #f5f1e8;
    --text-dark: #2c2c2c;
    --text-light: #666666;
    
    /* Backgrounds */
    --bg-primary: var(--off-white);
    --bg-secondary: var(--white);
    --bg-gradient-start: var(--sky-blue-light);
    --bg-gradient-end: var(--cream);
    
    /* Shadows */
    --shadow-color: rgba(30, 58, 15, 0.15);
    --shadow-color-light: rgba(30, 58, 15, 0.08);
    --shadow-color-medium: rgba(30, 58, 15, 0.25);
    --shadow-color-heavy: rgba(30, 58, 15, 0.35);
    
    /* Gradients */
    --gradient-card: linear-gradient(135deg, var(--bg-secondary) 0%, var(--cream) 100%);
    --gradient-header-footer: linear-gradient(135deg, var(--forest-green-dark) 0%, var(--forest-green) 100%);
    --gradient-button: linear-gradient(135deg, var(--trail-orange) 0%, var(--trail-orange-dark) 100%);
    --gradient-button-hover: linear-gradient(135deg, var(--campfire-orange) 0%, var(--trail-orange) 100%);
    --gradient-input: linear-gradient(135deg, var(--cream) 0%, var(--off-white) 100%);
    --gradient-input-focus: linear-gradient(135deg, var(--white) 0%, var(--cream) 100%);
    
    /* Card texture pattern */
    --card-texture-light: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 4px), repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(0, 0, 0, 0.04) 1px, rgba(0, 0, 0, 0.04) 3px);
    /* Button shadows */
    --button-shadow: 0 4px 12px rgba(255, 107, 53, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --button-shadow-hover: 0 6px 16px rgba(255, 107, 53, 0.4), 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    --button-shadow-active: 0 2px 6px rgba(255, 107, 53, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    --button-shadow-focus: 0 4px 12px rgba(255, 107, 53, 0.3), 0 0 0 4px rgba(255, 107, 53, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}


/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Cabin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-primary);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(139, 111, 71, 0.02) 2px,
            rgba(139, 111, 71, 0.02) 4px
        ),
        radial-gradient(circle at 20% 20%, rgba(74, 107, 58, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(74, 107, 58, 0.03) 0%, transparent 30%),
        linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


/* Typography */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

h1 {
    font-size: 3rem;
    color: var(--cream);
    letter-spacing: 0.05em;
    text-shadow: 
        2px 2px 16px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    color: var(--forest-green-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.6),
        0 2px 3px rgba(30, 58, 15, 0.12);
    padding-bottom: 0.5rem;
}


h3 {
    font-size: 1.25rem;
    color: var(--earth-brown-dark);
    letter-spacing: 0.02em;
    line-height: 1.4;
}

p {
    line-height: 1.7;
    margin-bottom: 1rem;
}



/* Base Card Styles - Shared by all cards */
.password-card,
.stat-card,
.map-container {
    background: var(--gradient-card);
    border-radius: 14px;
    box-shadow:
        0 8px 24px var(--shadow-color),
        0 2px 6px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.map-container {
    transition: none;
}

.password-card::before,
.stat-card::before,
.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    background-image: var(--card-texture-light);
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.7;
}


.password-card > *,
.stat-card > *,
.map-container > * {
    position: relative;
    z-index: 1;
}

/* Password Page Styles */
.password-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
        url('/assets/full_topo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    position: relative;
    overflow: hidden;
}


.password-container {
    width: 100%;
    max-width: 500px;
}

.password-card {
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 12px 32px var(--shadow-color),
        0 4px 8px var(--shadow-color-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.password-card h1 {
    margin-bottom: 2rem;
}

.password-card::before {
    display: none;
}

.copyright-notice {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.875rem;
    text-align: center;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.9);
    padding: 0 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 10;
}

.password-label {
    font-size: 1.25rem;
    color: var(--off-white);
    margin-bottom: 1rem;
    font-weight: 500;
    text-shadow: 
        2px 2px 16px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(0, 0, 0, 0.3);
    display: block;
}


.password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.password-input-wrapper {
    display: flex;
    position: relative;
    align-items: stretch;
}

.password-input {
    padding: 1rem 1.25rem;
    padding-right: 3.5rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px 0 0 10px;
    border-right: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--white);
    transition: all 0.3s ease-in-out;
    font-family: inherit;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    flex: 1;
}

.password-input::placeholder {
    color: var(--white);
    opacity: 0.7;
}


.password-input:focus {
    outline: none;
    border-color: rgba(255, 107, 53, 0.6);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 16px rgba(255, 107, 53, 0.2),
        0 0 0 3px rgba(255, 107, 53, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.password-input:focus + .password-button {
    border-color: rgba(255, 107, 53, 0.6);
}

/* Base button styles - shared by all buttons */
.base-button {
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.base-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease-in-out;
}

.base-button:hover::before {
    left: 100%;
}

.base-button:active {
    transform: translateY(0) scale(0.98);
}

.base-button:focus {
    outline: none;
}

/* Password button specific styles */
.password-button {
    padding: 1rem 1.5rem;
    color: #ffffff;
    background: var(--forest-green);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-width: 60px;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

.password-button svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    fill: none;
}

.password-button:hover {
    background: var(--forest-green-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 6px 16px rgba(30, 58, 15, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.password-button:active {
    box-shadow: 
        0 2px 6px rgba(30, 58, 15, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.password-button:focus {
    box-shadow: 
        0 4px 12px rgba(30, 58, 15, 0.3),
        0 0 0 4px rgba(61, 107, 42, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Map retry button specific styles */
.map-retry-button {
    padding: 0.75rem 2rem;
    color: var(--white);
    background: var(--gradient-button);
    border: 3px solid var(--earth-brown);
    border-radius: 10px;
    box-shadow: var(--button-shadow);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    -webkit-tap-highlight-color: rgba(255, 107, 53, 0.3);
}

.map-retry-button::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.map-retry-button:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--button-shadow-hover);
    border-color: var(--trail-orange-dark);
}

.map-retry-button:active {
    box-shadow: var(--button-shadow-active);
}

.map-retry-button:focus {
    box-shadow: var(--button-shadow-focus);
}

.error-message {
    color: var(--campfire-orange);
    font-size: 0.95rem;
    min-height: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.error-message.show {
    opacity: 1;
}

/* Main Page Styles */
.site-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(245, 241, 232, 0.6) 100%);
    position: sticky;
    top: 8px;
    z-index: 1000;
    max-width: 1200px;
    margin: 8px auto 0;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 12px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--card-texture-light);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.5;
}

.site-header > * {
    position: relative;
    z-index: 1;
}

.site-header-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    padding-top: calc(1.1rem + env(safe-area-inset-top));
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
    transition: padding 0.25s ease;
}

.site-header .site-header-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.75rem;
    margin-bottom: 0;
    letter-spacing: 0.04em;
    transition: font-size 0.25s ease;
    line-height: 1.2;
    color: var(--forest-green-dark);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.site-header-logo {
    height: 1.6em;
    width: 1.6em;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.site-header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--forest-green-dark);
    letter-spacing: 0.02em;
    transition: font-size 0.25s ease;
}

.site-header-status-divider {
    opacity: 0.4;
    font-size: 1rem;
}

.site-header-updated {
    color: var(--forest-green-dark);
}

/* Shrunk state (applied by scroll JS) */
.site-header.scrolled .site-header-inner {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    padding-bottom: 0.5rem;
}

.site-header.scrolled .site-header-title {
    font-size: 1.2rem;
}

.site-header.scrolled .site-header-status {
    font-size: 0.85rem;
}

.site-header.scrolled {
    box-shadow:
        0 2px 8px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}


main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

main > p:first-of-type {
    text-align: center;
    font-size: 1.5rem;
    font-style: italic;
    color: #4a4a4a;
    margin-bottom: 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--trail-orange), transparent);
    border-radius: 2px;
    max-width: 150px;
}

.section-title::before {
    background: linear-gradient(to right, transparent, var(--trail-orange));
}

.section-title::after {
    background: linear-gradient(to left, transparent, var(--trail-orange));
}


/* Map Section */
.map-section,
.weather-section,
.stats-section,
.log-section,
.about-section {
    margin-bottom: 5rem;
}

/* Map Legend */
.map-legend {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid var(--earth-brown-light);
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-trail {
    background: #1e40af;
}

.legend-on-trail {
    background: #06b6d4;
}

.legend-off-trail {
    background: #facc15;
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.legend-current {
    border: 2px solid #1a1a1a;
    width: 14px;
    height: 14px;
    overflow: hidden;
}

.legend-current.legend-current-on {
    background: #22c55e;
    animation: pulse-green-marker 2s ease-in-out infinite;
}

.legend-current.legend-current-off {
    background: #ef4444;
    animation: pulse-red-marker 2s ease-in-out infinite;
}

.current-marker-on {
    animation: pulse-green-marker 2s ease-in-out infinite;
}

.current-marker-off {
    animation: pulse-red-marker 2s ease-in-out infinite;
}

@keyframes pulse-green-marker {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { box-shadow: 0 0 10px 5px rgba(34, 197, 94, 0.4); }
}

@keyframes pulse-red-marker {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 10px 5px rgba(239, 68, 68, 0.4); }
}

.legend-route {
    background: #06b6d4;
    height: 3px;
    background-image: repeating-linear-gradient(
        90deg,
        #06b6d4 0px,
        #06b6d4 6px,
        transparent 6px,
        transparent 10px
    );
    background-color: transparent;
}

.legend-milestone-icon {
    color: #f59e0b;
    font-size: 1rem;
}

.legend-chicken-icon {
    color: #c2410c;
    font-size: 1rem;
}

.legend-divider {
    width: 1px;
    height: 1.2rem;
    background: var(--earth-brown-light);
    flex-shrink: 0;
}

.tracker-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #888;
}

.tracker-status-dot.tracker-on {
    background: #22c55e;
    animation: pulse-green 2s ease-in-out infinite;
}

.tracker-status-dot.tracker-off {
    background: #ef4444;
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 8px 4px rgba(34, 197, 94, 0.3); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 8px 4px rgba(239, 68, 68, 0.3); }
}

.map-container {
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--earth-brown);
}

#leaflet-map {
    width: 100%;
    height: 600px;
    border-radius: 11px;
    z-index: 1;
}

.map-container::before {
    opacity: 0.4;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    z-index: 0;
}

.map-container iframe,
.map-container .map-placeholder,
.map-container .map-loading,
.map-container .map-error {
    position: relative;
    z-index: 1;
}

/* Leaflet popup font override */
.leaflet-popup-content {
    font-family: 'Cabin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-dark);
}

.leaflet-popup-content strong {
    color: var(--forest-green-dark);
}

.leaflet-popup-content .popup-state {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

.leaflet-popup-content .popup-time {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.milestone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chicken-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Leaflet zoom control sizing */
.leaflet-control-zoom a {
    width: 42px !important;
    height: 42px !important;
    line-height: 42px !important;
    font-size: 20px !important;
}

/* Fullscreen map button */
.map-fullscreen-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
    color: #333;
    text-decoration: none;
    background: #fff;
}

.map-fullscreen-button:hover {
    background: #f0f0f0;
    color: #000;
}

/* Fullscreen map mode */
.map-fullscreen {
    position: fixed !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    margin: 0 !important;
    padding: 0 !important;
    background: #333;
    overflow: hidden;
}

.map-fullscreen .section-title {
    display: none;
}

.map-fullscreen .map-legend {
    border-radius: 0;
    background: rgba(255, 255, 255, 0.6);
}

.map-container .leaflet-top {
    top: 50px;
}

.map-fullscreen .leaflet-top {
    top: 55px;
}

.map-fullscreen .map-container {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    background: none;
    overflow: hidden;
}

.map-fullscreen .map-container::before {
    display: none;
}

.map-fullscreen #leaflet-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

.map-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    width: 100%;
}

.map-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.map-placeholder-subtitle {
    font-size: 0.95rem;
    font-style: italic;
}

/* Map Loading State */
.map-loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.map-loading p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0;
    position: relative;
    padding-left: 2rem;
}

.map-loading p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--earth-brown);
    border-top-color: var(--trail-orange);
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
}

@keyframes map-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Map Error State */
.map-error {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1.5rem;
}

.map-error p {
    font-size: 1.1rem;
    color: var(--trail-orange);
    margin: 0;
    font-weight: 500;
}

/* Map retry button uses base button styles above */

/* Stats Section */

.stat-group {
    margin-bottom: 3rem;
}

.stat-group:last-of-type {
    margin-bottom: 0;
}

.stat-group-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--trail-orange);
    font-family: 'Cabin', sans-serif;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.stat-card:nth-child(1),
.stat-card:nth-child(5) {
    background: var(--gradient-card);
}

.stat-card:nth-child(2),
.stat-card:nth-child(6) {
    background: linear-gradient(135deg, var(--cream) 0%, var(--bg-secondary) 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--off-white) 100%);
}

.stat-card:nth-child(4),
.stat-card:nth-child(7) {
    background: linear-gradient(135deg, var(--off-white) 0%, var(--bg-secondary) 100%);
}

.stat-card:hover {
    transform: scale(1.02);
    box-shadow: 
        0 12px 32px var(--shadow-color),
        0 4px 10px var(--shadow-color-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    animation: none;
}

.stat-icon {
    display: block;
    text-align: center;
    color: var(--text-light);
    font-size: 2rem;
    margin-bottom: 1rem;
}


.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--forest-green-dark);
    margin-bottom: 0.5rem;
    line-height: 1;
}


.stat-placeholder {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

.stat-note {
    font-size: 0.8rem;
    color: var(--trail-orange);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Elevation Profile Card */
.elevation-profile-card {
    grid-column: 1 / -1;
    padding: 2.5rem;
    margin-top: 1.5rem;
    background: var(--gradient-card) !important;
}

.elevation-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.elevation-header .stat-icon {
    margin-bottom: 0.5rem;
}

.elevation-header .stat-label {
    margin-bottom: 0;
}

.day-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.day-nav-button {
    padding: 0.5rem 0.75rem;
    font-family: 'Cabin', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--gradient-card);
    border: 2px solid var(--earth-brown-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 6px var(--shadow-color-light);
    -webkit-tap-highlight-color: rgba(61, 107, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.day-nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--earth-brown);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--cream) 100%);
}

.day-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--off-white);
}

.day-nav-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow-color-light);
}

.day-nav-button i {
    font-size: 1rem;
}

.day-display {
    font-family: 'Cabin', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest-green-dark);
    min-width: 120px;
    text-align: center;
    padding: 0.5rem 1rem;
}

.elevation-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 2px solid var(--earth-brown-light);
    flex-wrap: wrap;
}

.elevation-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.elevation-stat-icon {
    font-size: 1.5rem;
    color: var(--forest-green);
    margin-bottom: 0.25rem;
}

.elevation-stat-icon-flipped {
    transform: rotate(180deg);
}

.elevation-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.elevation-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    line-height: 1;
}

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

.elevation-chart-container {
    position: relative;
    width: 100%;
    margin-top: 1rem;
    display: none;
}

#elevation-chart {
    width: 100% !important;
    max-width: 100%;
    display: block;
    background-color: var(--off-white) !important;
}

.elevation-placeholder {
    text-align: center;
    padding: 0.5rem 2rem;
    color: var(--text-light);
}

/* Responsive adjustments for elevation card */
@media (max-width: 768px) {
    .elevation-profile-card {
        padding: 1.5rem 1.5rem 0 1.5rem;
    }

    .elevation-header {
        gap: 0.75rem;
    }

    .day-selector {
        gap: 0.75rem;
    }

    .day-nav-button {
        padding: 0.4rem 0.6rem;
        min-width: 40px;
        min-height: 40px;
    }

    .day-display {
        font-size: 0.9rem;
        min-width: 100px;
        padding: 0.4rem 0.75rem;
    }

    .elevation-stats {
        gap: 2rem;
        padding: 1rem;
        flex-wrap: wrap;
    }

    .elevation-stat-value {
        font-size: 2rem;
    }

}

@media (max-width: 480px) {
    .elevation-profile-card {
        padding: 1.25rem 1.25rem 0 1.25rem;
    }

    .elevation-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .elevation-stat {
        min-width: 0;
    }

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

    .elevation-stat-icon {
        font-size: 1.25rem;
    }

    .elevation-stat-label {
        font-size: 0.75rem;
    }

    .elevation-stat-unit {
        font-size: 0.8rem;
    }

}

/* Weather Section */
.weather-container {
    max-width: 1000px;
    margin: 0 auto;
    margin-top: 2rem;
}

.weather-card {
    background: var(--off-white);
    border-radius: 14px;
    padding: 2rem;
    box-shadow:
        0 8px 24px var(--shadow-color),
        0 2px 6px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    border: 3px solid var(--earth-brown);
    position: relative;
    overflow: hidden;
}

.weather-card > * {
    position: relative;
    z-index: 1;
}

.weather-current {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--earth-brown-light);
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.weather-icon {
    font-size: 4rem;
    color: var(--sky-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-icon i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.weather-temp-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.weather-temp {
    font-size: 4rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.weather-condition {
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 500;
}

.weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.weather-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
    font-size: 1rem;
}

.weather-detail-item i {
    color: var(--sky-blue-dark);
    font-size: 1.1rem;
}

.weather-forecast {
    margin-top: 2rem;
    position: relative;
    height: 350px;
    min-height: 350px;
}

#weather-chart {
    width: 100% !important;
    max-width: 100%;
    display: block;
    background-color: var(--off-white) !important;
}

.forecast-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--cream) 100%);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px solid var(--earth-brown-light);
    box-shadow: 
        0 4px 12px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px var(--shadow-color),
        0 2px 4px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.forecast-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--earth-brown-dark);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-icon {
    font-size: 2rem;
    color: var(--sky-blue-dark);
    margin-bottom: 0.75rem;
}

.forecast-icon i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.forecast-condition {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    align-items: baseline;
}

.forecast-high {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.forecast-low {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
}

.weather-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

/* Responsive adjustments for weather */
@media (max-width: 768px) {
    .weather-main {
        flex-direction: column;
        gap: 1rem;
    }

    .weather-temp {
        font-size: 3rem;
    }

    .weather-icon {
        font-size: 3rem;
    }

    .weather-details {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .weather-forecast {
        height: 300px;
        min-height: 300px;
    }

    #weather-chart {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .weather-card {
        padding: 1.5rem;
    }

    .weather-temp {
        font-size: 2.5rem;
    }

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

    .weather-forecast {
        height: 220px;
        min-height: 220px;
    }

    #weather-chart {
        max-height: 300px;
    }
}

/* Captain's Log Section */
.log-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.log-empty-message {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
    margin: 0;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--gradient-card);
    border-radius: 14px;
    box-shadow: 
        0 8px 24px var(--shadow-color),
        0 2px 6px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    border: 2px solid var(--earth-brown);
    position: relative;
    overflow: hidden;
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    background-image: var(--card-texture-light);
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.7;
}


.about-content > * {
    position: relative;
    z-index: 1;
}

.about-content p {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-content p:last-of-type {
    margin-bottom: 1.5rem;
}

.about-image {
    margin: 2rem 0 0 0;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 
        0 4px 12px var(--shadow-color),
        0 2px 4px var(--shadow-color-light);
    border: 2px solid var(--earth-brown);
}

.about-image figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Footer */
.site-footer {
    background: var(--gradient-header-footer);
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 -4px 12px var(--shadow-color-heavy),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(74, 107, 58, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(74, 107, 58, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.site-footer > * {
    position: relative;
    z-index: 1;
}

.site-footer p {
    color: var(--sky-blue-light);
    font-size: 0.95rem;
}

.site-footer a {
    color: var(--sky-blue-light);
    text-decoration: none;
    transition: text-decoration 0.3s ease-in-out;
}

.site-footer a:hover {
    text-decoration: underline;
}


/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .password-card {
        padding: 2rem 1.5rem;
    }

    .password-input {
        max-width: 100%;
        font-size: 16px;
    }

    .password-page {
        background-attachment: scroll;
    }

    .password-button {
        min-height: 44px;
    }

    .map-retry-button {
        min-height: 44px;
    }

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

    .stat-group-heading {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .map-legend {
        gap: 0.75rem;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .map-container {
        min-height: 400px;
    }

    #leaflet-map {
        height: 400px;
    }

    .map-loading,
    .map-error {
        min-height: 300px;
        padding: 2rem 1.5rem;
    }

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

    .site-header {
        margin: 6px 8px 0;
        top: 6px;
    }

    .site-header-inner {
        padding-left: calc(0.75rem + env(safe-area-inset-left));
        padding-right: calc(0.75rem + env(safe-area-inset-right));
    }

    .site-header .site-header-title {
        font-size: 1.45rem;
    }

    .site-header.scrolled .site-header-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .password-card {
        padding: 1.5rem 1rem;
    }

    .password-input-wrapper {
        max-width: 100%;
    }

    .password-input {
        max-width: 100%;
        font-size: 16px;
        padding: 0.875rem 1rem;
        padding-right: 3rem;
    }

    main {
        padding: 2rem 1rem;
    }
    
    .map-section,
    .stats-section,
    .log-section,
    .about-section {
        margin-bottom: 6rem;
    }

    .about-content {
        padding: 1.5rem;
    }

    .stat-group {
        margin-bottom: 2.5rem;
    }

    .stat-group-heading {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

}

/* Accessibility - Focus Styles */
*:focus-visible {
    outline: 2px solid var(--trail-orange);
    outline-offset: 2px;
}



/* Log Entry Cards */
.log-entry {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--cream) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--earth-brown);
    box-shadow: 
        0 4px 12px var(--shadow-color),
        0 2px 4px var(--shadow-color-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.log-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.04) 2px,
            rgba(0, 0, 0, 0.04) 4px
        );
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.5;
}


.log-entry > * {
    position: relative;
    z-index: 1;
}

.log-entry:hover {
    transform: scale(1.02);
    box-shadow: 
        0 12px 32px var(--shadow-color),
        0 4px 10px var(--shadow-color-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    animation: none;
    transition: all 0.3s ease-in-out;
}

.log-entry-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--earth-brown-light);
}

.log-entry-title {
    font-size: 1.2rem;
    color: var(--forest-green-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}


.log-entry-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.log-entry-date {
    font-weight: 500;
    color: var(--earth-brown-dark);
}

.log-entry-location {
    font-style: italic;
    color: var(--text-light);
}

.log-entry-content {
    color: var(--text-dark);
    line-height: 1.7;
}

.log-entry-content p {
    margin: 0;
}

/* Password page theme toggle positioning */
.password-page {
    position: relative;
}

/* 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;
    }
}



