/* Route Planner Specific Styles */

.planner-main {
    padding-top: 80px;
    min-height: 100vh;
    background: #0a0a0a;
    position: relative;
    overflow: visible; /* Changed from hidden to show fixed CTA banner */
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(210, 129, 23, 0.95) 0%, rgba(180, 100, 20, 0.95) 100%);
    border-bottom: 2px solid rgba(255, 107, 53, 0.6);
    padding: 10px 20px;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(210, 129, 23, 0.3);
    animation: ctaSlideIn 0.5s ease-out;
}

@keyframes ctaSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cta-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.cta-text {
    color: #0a0a0a;
    font-size: 0.95rem;
    font-family: 'IM Fell English', serif;
}

.cta-text strong {
    font-weight: bold;
    color: #000;
}

.cta-btn {
    background: #0a0a0a;
    color: #D28117;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'IM Fell English', serif;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid #0a0a0a;
    white-space: nowrap;
}

.cta-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.cta-close {
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.7);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    z-index: 10;
    position: relative;
    pointer-events: auto;
}

.cta-close:hover {
    color: #000;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.cta-banner.hidden {
    display: none;
}

/* Mystical Background Effect */
.planner-main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(210, 129, 23, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(210, 129, 23, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: mysticalGlow 8s ease-in-out infinite alternate;
}

@keyframes mysticalGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Header Section */
.planner-header {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(20, 15, 10, 0.95) 100%);
    border-bottom: 2px solid rgba(210, 129, 23, 0.4);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.planner-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(210, 129, 23, 0.1) 0%, transparent 70%);
    animation: headerPulse 3s ease-in-out infinite;
}

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

.header-content {
    position: relative;
    z-index: 1;
}

.planner-header h1 {
    font-family: 'Uncial Antiqua', serif;
    font-size: 2.5rem;
    color: #D28117;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(210, 129, 23, 0.5);
}

.planner-header p {
    font-size: 1.2rem;
    color: #e8e3d3;
    font-style: italic;
}

/* Main Planner Container */
.planner-container {
    display: flex;
    height: calc(100vh - 80px - 42px); /* Header + CTA only, no stats bar */
    position: relative;
    z-index: 1;
}

.cta-banner.hidden + .planner-container {
    height: calc(100vh - 80px); /* Full height when CTA is hidden */
}

/* Side Panel - Hidden (replaced by floating controls) */
.side-panel {
    display: none;
}

.side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(210, 129, 23, 0.5) 50%, 
        transparent 100%);
    animation: panelGlow 3s ease-in-out infinite;
}

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

.side-panel::-webkit-scrollbar {
    width: 6px;
}

.side-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.side-panel::-webkit-scrollbar-thumb {
    background: rgba(210, 129, 23, 0.5);
    border-radius: 3px;
}

.panel-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(210, 129, 23, 0.2);
}

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

.panel-section h3 {
    font-family: 'Uncial Antiqua', serif;
    font-size: 1.1rem;
    color: #D28117;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(210, 129, 23, 0.3);
}

/* Section Label */
.section-label {
    display: block;
    font-size: 0.9rem;
    color: #D28117;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Map Select Dropdown */
.map-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(210, 129, 23, 0.4);
    color: #e8e3d3;
    padding: 10px;
    border-radius: 6px;
    font-family: 'IM Fell English', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-select:hover {
    border-color: rgba(210, 129, 23, 0.6);
    background: rgba(0, 0, 0, 0.5);
}

.map-select:focus {
    outline: none;
    border-color: #D28117;
    box-shadow: 0 0 10px rgba(210, 129, 23, 0.3);
}

/* Horizontal Route Mode Toggle at Top */
.route-mode-horizontal {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.route-mode-horizontal label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.route-mode-horizontal label:hover {
    background: rgba(210, 129, 23, 0.1);
    color: #e8e3d3;
}

.route-mode-horizontal input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    accent-color: #D28117;
}

.route-mode-horizontal input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

.route-mode-horizontal label:has(input:checked) {
    background: rgba(210, 129, 23, 0.2);
    border: 1px solid rgba(210, 129, 23, 0.4);
}

/* Journey Stats - Horizontal at Bottom */
.journey-bottom {
    margin-top: auto;
    padding-top: 15px !important;
    border-top: 2px solid rgba(210, 129, 23, 0.4) !important;
    border-bottom: none !important;
}

.journey-stats-horizontal {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-item-horizontal {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 8px;
    padding: 10px 5px;
}

.stat-item-horizontal .stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #D28117;
    text-shadow: 0 0 10px rgba(210, 129, 23, 0.4);
    margin-bottom: 4px;
}

.stat-item-horizontal .stat-label {
    font-size: 0.75rem;
    color: #b8b3a3;
}

.unit-toggle-horizontal {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.unit-toggle-horizontal label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.85rem;
}

.unit-toggle-horizontal input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
    accent-color: #D28117;
}

.unit-toggle-horizontal input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

/* Highlight Section for Key Features */
.highlight-section {
    background: rgba(210, 129, 23, 0.08);
    border: 2px solid rgba(210, 129, 23, 0.4);
    border-radius: 10px;
    padding: 15px !important;
    margin-bottom: 20px !important;
}

.highlight-section h3 {
    font-size: 1.2rem !important;
    margin-bottom: 15px !important;
}

/* Compact Sections */
.compact-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.compact-instructions p {
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Control Buttons */
.routing-engine-toggle {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(210, 129, 23, 0.1);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 8px;
}

.engine-label {
    font-size: 0.85rem;
    color: #D28117;
    font-weight: bold;
    margin-bottom: 5px;
}

.routing-engine-toggle label:not(.engine-label) {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.routing-engine-toggle label:hover {
    color: #e8e3d3;
}

.routing-engine-toggle input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #D28117;
}

.routing-engine-toggle input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

.route-mode-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(210, 129, 23, 0.2);
    border-radius: 8px;
}

.route-mode-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.route-mode-toggle label:hover {
    color: #e8e3d3;
}

.route-mode-toggle input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #D28117;
}

.route-mode-toggle input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.control-buttons button:first-child {
    grid-column: 1 / -1; /* Share button spans full width */
}

.control-btn {
    background: linear-gradient(135deg, rgba(210, 129, 23, 0.15) 0%, rgba(210, 129, 23, 0.05) 100%);
    border: 1px solid rgba(210, 129, 23, 0.4);
    color: #e8e3d3;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-family: 'IM Fell English', serif;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(210, 129, 23, 0.25) 0%, rgba(210, 129, 23, 0.15) 100%);
    border-color: rgba(210, 129, 23, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(210, 129, 23, 0.2);
}

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

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

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

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

/* Distance Display */
.distance-display {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.stat-label {
    font-size: 0.95rem;
    color: #b8b3a3;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #D28117;
    text-shadow: 0 0 10px rgba(210, 129, 23, 0.4);
}

/* Unit Toggle */
.unit-toggle {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.unit-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.95rem;
}

.unit-toggle input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

.unit-toggle input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

/* Overlay Controls */
.overlay-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(100, 100, 100, 0.3);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid rgba(210, 129, 23, 0.3);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #e8e3d3;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(210, 129, 23, 0.5);
    border-color: rgba(210, 129, 23, 0.7);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #D28117;
    box-shadow: 0 0 10px rgba(210, 129, 23, 0.5);
}

.toggle-label {
    color: #e8e3d3;
    font-size: 1rem;
}

/* Opacity Control */
.opacity-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opacity-control label {
    color: #b8b3a3;
    font-size: 0.9rem;
}

.opacity-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(100, 100, 100, 0.3);
    outline: none;
    cursor: pointer;
}

.opacity-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D28117;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(210, 129, 23, 0.5);
}

.opacity-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D28117;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(210, 129, 23, 0.5);
    border: none;
}

.opacity-value {
    text-align: right;
    color: #D28117;
    font-size: 0.95rem;
    font-weight: bold;
}

/* Map Selector */
.map-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-selector label {
    color: #b8b3a3;
    font-size: 0.9rem;
}

.map-selector select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(210, 129, 23, 0.4);
    color: #e8e3d3;
    padding: 10px;
    border-radius: 6px;
    font-family: 'IM Fell English', serif;
    font-size: 0.95rem;
    cursor: pointer;
}

.map-selector select:hover {
    border-color: rgba(210, 129, 23, 0.6);
}

.map-selector select:focus {
    outline: none;
    border-color: #D28117;
    box-shadow: 0 0 10px rgba(210, 129, 23, 0.3);
}

/* Map Info */
.map-info {
    background: rgba(210, 129, 23, 0.1);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 8px;
    padding: 12px;
}

.info-text {
    font-size: 0.9rem;
    color: #e8e3d3;
    line-height: 1.5;
    margin: 0;
}

.info-text strong {
    color: #D28117;
}

/* Instructions */
.instructions p {
    font-size: 0.95rem;
    color: #b8b3a3;
    margin-bottom: 10px;
    line-height: 1.6;
}

.instructions p:last-child {
    margin-bottom: 0;
}

.instructions strong {
    color: #e8e3d3;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    padding-bottom: 0; /* No padding, map fills container */
}

/* Floating Map Controls (Top Left) */
.floating-map-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(210, 129, 23, 0.5);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    max-width: 220px;
    transition: all 0.3s ease;
}

.floating-map-controls .panel-collapse-btn {
    display: none; /* Hidden on desktop */
}

.floating-map-controls .panel-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-map-controls .control-label {
    font-size: 0.7rem;
    color: rgba(220, 200, 180, 0.6);
    font-family: 'IM Fell English', serif;
    margin-bottom: 4px;
    display: block;
}

.floating-map-controls .control-label-special {
    font-size: 0.85rem;
    color: #FF6B35;
    font-family: 'IM Fell English', serif;
    margin-bottom: 6px;
    display: block;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 107, 53, 0.4);
}

.floating-map-controls .control-label-small {
    font-size: 0.65rem;
    color: rgba(220, 200, 180, 0.5);
    font-family: 'IM Fell English', serif;
    margin-top: 6px;
    margin-bottom: 3px;
    display: block;
}

.floating-map-controls .map-select-compact {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 6px;
    color: #b8b3a3;
    font-family: 'IM Fell English', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.floating-map-controls .map-select-compact:hover {
    border-color: rgba(210, 129, 23, 0.5);
    background: rgba(210, 129, 23, 0.1);
}

.floating-map-controls .map-select-compact:focus {
    outline: none;
    border-color: rgba(210, 129, 23, 0.6);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

.floating-map-controls .historical-group {
    background: rgba(210, 129, 23, 0.08);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(210, 129, 23, 0.2);
}

.floating-map-controls .checkbox-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.85rem;
    font-family: 'IM Fell English', serif;
    padding: 6px 0;
}

.floating-map-controls .checkbox-compact input[type="checkbox"] {
    cursor: pointer;
    accent-color: #D28117;
    width: 16px;
    height: 16px;
}

.floating-map-controls .checkbox-compact:has(input:checked) span {
    color: #D28117;
    font-weight: bold;
}

.floating-map-controls .range-compact {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(210, 129, 23, 0.2);
    outline: none;
    cursor: pointer;
}

.floating-map-controls .range-compact::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FF6B35;
    cursor: pointer;
    border: 2px solid #FFE5B4;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
}

.floating-map-controls .range-compact::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FF6B35;
    cursor: pointer;
    border: 2px solid #FFE5B4;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
}

.floating-map-controls .opacity-value-compact {
    font-size: 0.75rem;
    color: #D28117;
    font-family: 'IM Fell English', serif;
    margin-left: 4px;
    display: inline-block;
    margin-top: 2px;
}

/* Floating Route Controls (Top Right) */
.floating-route-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(210, 129, 23, 0.5);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
    transition: all 0.3s ease;
}

.floating-route-controls .panel-collapse-btn {
    display: none; /* Hidden on desktop */
}

.floating-route-controls .panel-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-route-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(210, 129, 23, 0.2);
}

.floating-route-controls .control-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.floating-route-controls .control-label {
    font-size: 0.7rem;
    color: rgba(220, 200, 180, 0.6);
    font-family: 'IM Fell English', serif;
    margin-top: 4px;
}

.floating-route-controls .route-mode-compact {
    display: flex;
    gap: 6px;
}

.floating-route-controls .route-mode-compact label {
    flex: 1;
    min-width: 70px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(210, 129, 23, 0.3);
    font-family: 'IM Fell English', serif;
}

.floating-route-controls .route-mode-compact input[type="radio"] {
    margin-right: 4px;
    cursor: pointer;
    accent-color: #D28117;
}

.floating-route-controls .route-mode-compact input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

.floating-route-controls .route-mode-compact label:has(input:checked) {
    background: rgba(210, 129, 23, 0.2);
    border: 1px solid rgba(210, 129, 23, 0.4);
}

.floating-route-controls .color-input-compact {
    width: 100%;
    height: 36px;
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.floating-route-controls .range-compact {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(210, 129, 23, 0.2);
    outline: none;
    cursor: pointer;
}

.floating-route-controls .range-compact::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FF6B35;
    cursor: pointer;
    border: 2px solid #FFE5B4;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
}

.floating-route-controls .range-compact::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FF6B35;
    cursor: pointer;
    border: 2px solid #FFE5B4;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
}

.floating-route-controls .action-btn-compact {
    height: 36px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(210, 129, 23, 0.3);
    border-radius: 6px;
    color: #b8b3a3;
    font-family: 'IM Fell English', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.floating-route-controls .action-btn-compact:hover {
    background: rgba(210, 129, 23, 0.2);
    border-color: rgba(210, 129, 23, 0.5);
    color: #D28117;
    transform: translateY(-1px);
}

.floating-route-controls .action-btn-compact.primary {
    background: rgba(210, 129, 23, 0.3);
    border-color: rgba(210, 129, 23, 0.5);
    color: #D28117;
}

.floating-route-controls .action-btn-compact.primary:hover {
    background: rgba(210, 129, 23, 0.4);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

.floating-route-controls .action-btn-compact.small {
    flex: 1;
    padding: 6px;
    font-size: 1rem;
}

.floating-route-controls .button-row-compact {
    display: flex;
    gap: 6px;
}

.floating-route-controls .checkbox-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.85rem;
    font-family: 'IM Fell English', serif;
    padding: 6px 0;
}

.floating-route-controls .checkbox-compact input[type="checkbox"] {
    cursor: pointer;
    accent-color: #D28117;
    width: 16px;
    height: 16px;
}

.floating-route-controls .checkbox-compact:has(input:checked) span {
    color: #D28117;
    font-weight: bold;
}

.floating-route-controls .guide-text {
    color: rgba(220, 200, 180, 0.7);
    font-size: 0.8rem;
    font-family: 'IM Fell English', serif;
    text-align: center;
    font-style: italic;
    padding: 4px 0;
    border-bottom: none;
}

/* Panel Collapse Button Styling */
.panel-collapse-btn {
    background: rgba(210, 129, 23, 0.3);
    border: 1px solid rgba(210, 129, 23, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    padding: 0;
    margin: 0 auto;
}

.panel-collapse-btn:hover {
    background: rgba(210, 129, 23, 0.5);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.panel-collapse-btn .collapse-icon {
    display: block;
    transition: transform 0.3s ease;
}

/* Expanded State (Desktop default) */
.floating-map-controls.expanded .panel-content,
.floating-route-controls.expanded .panel-content {
    display: flex;
}

/* Collapsed State (Mobile default) */
.floating-map-controls:not(.expanded) .panel-content,
.floating-route-controls:not(.expanded) .panel-content {
    display: none;
}

.floating-map-controls:not(.expanded),
.floating-route-controls:not(.expanded) {
    min-width: auto;
    max-width: none;
    width: 56px;
    padding: 8px;
}

.floating-map-controls:not(.expanded) .panel-collapse-btn,
.floating-route-controls:not(.expanded) .panel-collapse-btn {
    opacity: 0.9;
}

/* Responsive: Mobile Optimization */
@media (max-width: 768px) {
    /* Show collapse buttons on mobile */
    .floating-map-controls .panel-collapse-btn,
    .floating-route-controls .panel-collapse-btn {
        display: flex;
    }
    
    /* Default to collapsed on mobile */
    .floating-map-controls,
    .floating-route-controls {
        width: 56px;
        min-width: auto;
        padding: 8px;
        top: 10px;
    }
    
    .floating-map-controls {
        left: 10px;
    }
    
    .floating-route-controls {
        right: 10px;
    }
    
    /* When expanded on mobile */
    .floating-map-controls.expanded {
        width: auto;
        min-width: 200px;
        max-width: calc(100vw - 80px);
        padding: 12px;
    }
    
    .floating-route-controls.expanded {
        width: auto;
        min-width: 180px;
        max-width: calc(100vw - 80px);
        padding: 12px;
    }
    
    .floating-map-controls.expanded .panel-content,
    .floating-route-controls.expanded .panel-content {
        display: flex;
    }
    
    /* Smaller fonts on mobile */
    .floating-map-controls .control-label-special {
        font-size: 0.75rem;
    }
    
    .floating-map-controls .map-select-compact {
        font-size: 0.75rem;
        padding: 6px;
    }
    
    .floating-route-controls .route-mode-compact label {
        min-width: 50px;
        height: 32px;
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .floating-route-controls .action-btn-compact {
        height: 32px;
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .floating-route-controls .guide-text {
        font-size: 0.7rem;
    }
    
    /* Hide CTA banner on mobile by default */
    .cta-banner {
        display: none;
    }
    
    /* Adjust planner container height for mobile */
    .planner-container {
        height: calc(100vh - 80px); /* Just header, no CTA */
    }
    
    /* Stack bottom stats vertically on very small screens */
    @media (max-width: 480px) {
        .bottom-stats-bar .stats-container {
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .bottom-stats-bar .stat-item {
            min-width: 80px;
            padding: 6px 12px;
            font-size: 0.8rem;
        }
        
        .bottom-stats-bar .stat-value {
            font-size: 0.85rem;
        }
        
        .bottom-stats-bar .stat-label {
            font-size: 0.6rem;
        }
        
        .bottom-stats-bar .unit-toggle {
            margin-left: 0;
        }
        
        .bottom-stats-bar .unit-toggle label {
            min-width: 60px;
            font-size: 0.8rem;
            padding: 6px 12px;
        }
    }
}

/* Compass Rose - Removed for cleaner map */

#map {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    /* Add padding at bottom for controls to not be hidden by stats bar */
}

/* Leaflet attribution positioning to avoid bottom bar overlap */
/* Waypoint Circle Markers - Static Glow */
.waypoint-marker-circle {
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.8));
}

.leaflet-bottom {
    bottom: 60px !important; /* Push Leaflet controls above bottom bar */
}

/* Map Overlay UI */
.map-overlay-ui {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-toggle-btn {
    background: rgba(15, 12, 10, 0.95);
    border: 2px solid rgba(210, 129, 23, 0.4);
    color: #D28117;
    font-size: 1.5rem;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.panel-toggle-btn:hover {
    background: rgba(210, 129, 23, 0.2);
    border-color: rgba(210, 129, 23, 0.7);
    box-shadow: 0 0 20px rgba(210, 129, 23, 0.3);
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 12, 10, 0.95);
    border: 2px solid rgba(210, 129, 23, 0.5);
    border-radius: 12px;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(210, 129, 23, 0.3);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(210, 129, 23, 0.3);
    border-top-color: #D28117;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-indicator span {
    color: #e8e3d3;
    font-size: 1rem;
}

/* Custom Leaflet Styles */
.leaflet-container {
    background: #0a0a0a;
    font-family: 'IM Fell English', serif;
}

/* Glowing Route Line - SVG Path Styling */
.leaflet-interactive {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Add glow filter to route paths */
.leaflet-overlay-pane svg {
    filter: drop-shadow(0 0 8px rgba(255, 69, 0, 0.8)) 
            drop-shadow(0 0 15px rgba(255, 69, 0, 0.6))
            drop-shadow(0 0 25px rgba(139, 0, 0, 0.4));
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 12, 10, 0.95);
    border: 1px solid rgba(210, 129, 23, 0.4);
    color: #e8e3d3;
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: 'IM Fell English', serif;
    color: #e8e3d3;
}

.leaflet-popup-tip {
    background: rgba(15, 12, 10, 0.95);
}

/* Waypoint Markers */
/* Waypoint markers now defined below in new features section */

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .planner-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .side-panel {
        width: 100%;
        max-height: 450px;
        border-right: none;
        border-bottom: 2px solid rgba(210, 129, 23, 0.3);
    }
    
    .side-panel::before {
        width: 100%;
        height: 2px;
        bottom: 0;
        top: auto;
        background: linear-gradient(to right, 
            transparent 0%, 
            rgba(210, 129, 23, 0.5) 50%, 
            transparent 100%);
    }

    .map-container {
        height: 60vh;
        min-height: 500px;
    }

    .panel-toggle-btn {
        display: none;
    }
    
    .map-container::before,
    .map-container::after {
        bottom: 70px;
    }
}

@media (max-width: 768px) {
    .planner-header h1 {
        font-size: 1.8rem;
    }

    .planner-header p {
        font-size: 1rem;
    }

    .side-panel {
        padding: 15px;
        max-height: 400px;
    }

    .control-buttons {
        grid-template-columns: 1fr;
    }

    .panel-section h3 {
        font-size: 1.1rem;
    }

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

    .distance-display {
        padding: 15px;
    }

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

    .instructions {
        font-size: 0.9rem;
    }
    
    .instructions p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    /* Enhance touch targets on mobile */
    .control-btn {
        padding: 15px;
        font-size: 1rem;
    }

    .btn-icon {
        font-size: 1.8rem;
    }

    .toggle-switch {
        width: 55px;
        height: 30px;
    }

    .toggle-slider:before {
        height: 22px;
        width: 22px;
    }

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(25px);
    }
    
    /* Hide compass on smaller screens to reduce clutter */
    .map-container::before,
    .map-container::after {
        display: none;
    }

    /* Side panel collapsible on very small screens */
    .side-panel.collapsed {
        transform: translateY(-100%);
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        z-index: 1001;
        height: auto;
        max-height: 80vh;
        border-bottom: 2px solid rgba(210, 129, 23, 0.5);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    }

    .panel-toggle-btn {
        display: block;
    }
}

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

    .planner-header h1 {
        font-size: 1.5rem;
    }

    .planner-header p {
        font-size: 0.9rem;
    }

    .side-panel {
        padding: 12px;
        max-height: 350px;
    }

    .panel-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .map-container {
        height: 50vh;
        min-height: 350px;
    }

    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .loading-indicator {
        padding: 20px 25px;
        font-size: 0.9rem;
    }

    .spinner {
        width: 25px;
        height: 25px;
    }
}

/* Smooth transitions */
* {
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

button, input[type="range"], select, .toggle-slider {
    transition: all 0.3s ease;
}

/* === NEW FEATURES - Route Customization & Bottom Stats Bar === */

/* Route Customization */
.route-customization {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.route-customization label {
    color: #e8e3d3;
    font-size: 0.9rem;
}

.route-customization input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid #D28117;
    border-radius: 4px;
    cursor: pointer;
    background: #1a1a1a;
}

.route-customization input[type="range"] {
    width: 100%;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e8e3d3;
    font-size: 0.95rem;
    margin-top: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Bottom Stats Bar */
.bottom-stats-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px; /* Keep height for spacing but transparent */
    background: transparent; /* Remove black background */
    backdrop-filter: none; /* Remove blur */
    border-top: none; /* Remove border */
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the stats */
    pointer-events: none; /* Allow map interaction */
}

.stats-container {
    display: flex;
    align-items: stretch;
    justify-content: center; /* Center the stats */
    gap: 15px; /* Tighter gap for centered look */
    max-width: 1200px;
    padding: 0 20px;
    pointer-events: auto; /* Re-enable interaction for stats boxes */
}

.bottom-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* gap: 2px; */
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.85); /* More opaque for floating on map */
    border: 1px solid rgba(210, 129, 23, 0.5);
    border-radius: 8px;
    min-width: 100px;
    height: 48px; /* Fixed height to match km/mi buttons */
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); /* Add shadow for floating effect */
}

.bottom-stats-bar .stat-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 0 0 5px rgba(255, 107, 53, 0.6);
    font-family: 'IM Fell English', serif;
    line-height: 1;
}

.bottom-stats-bar .stat-label {
    font-size: 0.65rem;
    color: rgba(220, 200, 180, 0.6);
    font-family: 'IM Fell English', serif;
    line-height: 1;
}

.bottom-stats-bar .unit-toggle {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.bottom-stats-bar .unit-toggle label {
    flex: 1;
    min-width: 80px;
    height: 48px; /* Fixed height to match stat boxes */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b8b3a3;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.85); /* More opaque for floating on map */
    border: 1px solid rgba(210, 129, 23, 0.5);
    font-family: 'IM Fell English', serif;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); /* Add shadow for floating effect */
}

.bottom-stats-bar .unit-toggle label:hover {
    background: rgba(210, 129, 23, 0.1);
    color: #e8e3d3;
}

.bottom-stats-bar .unit-toggle input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    accent-color: #D28117;
    flex-shrink: 0;
}

.bottom-stats-bar .unit-toggle input[type="radio"]:checked + span {
    color: #D28117;
    font-weight: bold;
}

.bottom-stats-bar .unit-toggle label:has(input:checked) {
    background: rgba(210, 129, 23, 0.2);
    border: 1px solid rgba(210, 129, 23, 0.4);
}

/* Adjust planner container - removed duplicate, using above definition */

/* Ensure map doesn't overlap bottom stats */
/* Map container height managed by planner-container */

/* Waypoint Markers with Numbers */
.waypoint-marker {
    background: #FF6B35 !important;
    border: 3px solid #FFE5B4 !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.9), 0 0 30px rgba(255, 69, 0, 0.5) !important;
    animation: pulse-waypoint 1.5s infinite alternate !important;
    font-family: 'IM Fell English', serif !important;
}

@keyframes pulse-waypoint {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(255, 107, 53, 0.9), 0 0 30px rgba(255, 69, 0, 0.5);
    }
    100% { 
        transform: scale(1.08); 
        box-shadow: 0 0 20px rgba(255, 107, 53, 1), 0 0 40px rgba(255, 69, 0, 0.7);
    }
}

/* Mobile Adjustments for Bottom Stats Bar */
@media (max-width: 768px) {
    .stats-container {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bottom-stats-bar {
        height: 75px;
    }
    
    .bottom-stats-bar .stat-value {
        font-size: 1.1rem;
    }
    
    .bottom-stats-bar .stat-label {
        font-size: 0.7rem;
    }
    
    .bottom-stats-bar .unit-toggle {
        margin-left: 0;
    }
    
    .bottom-stats-bar .unit-toggle label {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .planner-container {
        height: calc(100vh - 80px - 75px);
    }
    
    .cta-banner + .planner-container {
        height: calc(100vh - 80px - 42px - 75px);
        margin-top: 42px;
    }
}

