/* ============================================
   RV Route Planner - Main Stylesheet
   Google Maps-inspired UI
   ============================================ */

/* CSS Variables */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4285f4;
    --secondary: #34a853;
    --secondary-dark: #2d8a47;
    --accent: #ea4335;
    --accent-dark: #c5221f;
    --warning: #fbbc04;
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-dark: #e8eaed;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-disabled: #9aa0a6;
    --border: #dadce0;
    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.1);
    --shadow-md: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);
    --shadow-lg: 0 4px 8px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.1);
    --shadow-xl: 0 8px 16px rgba(60, 64, 67, 0.15), 0 2px 4px rgba(60, 64, 67, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s ease;
    --header-height: 64px;
    --panel-width: 360px;
}

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

html, body {
    height: 100%;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--background);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.header-left {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 24px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 48px 0 16px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--surface);
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    background: var(--background);
    box-shadow: var(--shadow-lg);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.search-btn:hover {
    background: var(--surface-dark);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--surface);
}

.search-result-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-result-item span {
    color: var(--text-primary);
}

.header-right {
    flex-shrink: 0;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.header-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.header-btn:hover {
    background: var(--surface);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

/* ============================================
   Side Panel
   ============================================ */
.side-panel {
    position: relative;
    width: var(--panel-width);
    height: 100%;
    background: var(--background);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.side-panel.collapsed {
    transform: translateX(calc(-1 * var(--panel-width) + 24px));
}

.panel-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--background);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.side-panel.collapsed .panel-toggle {
    right: -24px;
}

.panel-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.side-panel.collapsed .panel-toggle svg {
    transform: rotate(180deg);
}

.panel-toggle:hover {
    background: var(--surface);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Panel Sections */
.panel-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Route Points */
.route-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.point-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: white;
    flex-shrink: 0;
}

.point-marker.start {
    background: var(--secondary);
}

.point-marker.end {
    background: var(--accent);
}

.point-marker.waypoint {
    background: var(--warning);
    color: var(--text-primary);
}

.point-info {
    flex: 1;
    position: relative;
}

.point-info label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.point-info input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--background);
    transition: var(--transition);
}

.point-info input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.clear-btn {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.point-info input:not(:placeholder-shown) + .clear-btn,
.point-info input.has-value + .clear-btn {
    display: flex;
}

.clear-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* Waypoints Container */
.waypoints-container {
    margin-left: 40px;
    padding-left: 12px;
    border-left: 2px dashed var(--border);
}

.waypoints-container:empty {
    display: none;
}

.waypoint-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
}

.waypoint-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
}

.waypoint-item input {
    flex: 1;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--background);
}

.waypoint-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.waypoint-remove:hover {
    background: var(--accent);
    color: white;
}

/* Add Stop Button */
.add-stop-btn {
    width: 100%;
    padding: 10px 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    margin-top: 8px;
}

.add-stop-btn svg {
    width: 18px;
    height: 18px;
}

.add-stop-btn:hover {
    background: rgba(26, 115, 232, 0.05);
    border-color: var(--primary);
}

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

/* Route Stats */
.route-stats {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
}

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

.stat svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.stat span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Directions Section */
.directions-toggle {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.directions-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.directions-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.directions-toggle.expanded svg {
    transform: rotate(180deg);
}

.directions-toggle:hover {
    background: var(--surface-dark);
}

.directions-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.directions-list.expanded {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
}

.no-directions {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.direction-step {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.direction-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.step-info {
    flex: 1;
}

.step-instruction {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-distance {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Trip Actions */
.trip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.action-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn:hover {
    background: var(--surface);
}

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

/* ============================================
   Map Area
   ============================================ */
.map-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
}

/* Map Controls */
.map-controls {
    position: absolute;
    right: 16px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 500;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--background);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.map-control-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.map-control-btn:hover {
    background: var(--surface);
}

.map-control-btn:hover svg {
    color: var(--text-primary);
}

.map-control-btn.active {
    background: var(--primary);
}

.map-control-btn.active svg {
    color: white;
}

.control-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Layer Selector */
.layer-selector {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.layer-selector.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.layer-option {
    cursor: pointer;
    text-align: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.layer-option:hover {
    background: var(--surface);
}

.layer-option.active {
    background: rgba(26, 115, 232, 0.1);
}

.layer-preview {
    width: 60px;
    height: 40px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    background-size: cover;
    background-position: center;
}

.layer-preview.satellite {
    background: linear-gradient(135deg, #2d4a3e 0%, #1a2e28 100%);
}

.layer-preview.road {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaed 100%);
}

.layer-preview.hybrid {
    background: linear-gradient(135deg, #3d5a4e 0%, #e8eaed 100%);
}

.layer-option span {
    font-size: 11px;
    color: var(--text-secondary);
}

.layer-option.active span {
    color: var(--primary);
    font-weight: 500;
}

/* POI Legend */
.poi-legend {
    position: absolute;
    left: 16px;
    bottom: 16px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.poi-legend.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.poi-legend h4 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.legend-item span:last-child {
    font-size: 12px;
    color: var(--text-primary);
}

/* ============================================
   Modals
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    background: var(--background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: var(--transition);
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-btn.primary:hover {
    background: var(--primary-dark);
}

.modal-btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
}

.modal-btn.secondary:hover {
    background: var(--surface-dark);
}

.modal-btn.danger {
    background: var(--accent);
    color: white;
}

.modal-btn.danger:hover {
    background: var(--accent-dark);
}

/* Load Modal Specific */
.load-modal-content {
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.trips-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    margin-bottom: 16px;
}

.trip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.trip-item:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.trip-info {
    flex: 1;
}

.trip-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.trip-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.trip-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.trip-delete:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent);
}

.trip-delete svg {
    width: 18px;
    height: 18px;
}

.no-trips {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--secondary);
}

.toast.error {
    background: var(--accent);
}

.toast.warning {
    background: var(--warning);
    color: var(--text-primary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Custom Map Markers
   ============================================ */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-marker {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.start-marker {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.end-marker {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.waypoint-marker {
    width: 28px;
    height: 28px;
    background: var(--warning);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
}

.poi-marker {
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

/* Cluster styles */
.marker-cluster {
    background: rgba(26, 115, 232, 0.6);
    border-radius: 50%;
}

.marker-cluster div {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 500;
    font-size: 12px;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-family: 'Roboto', sans-serif;
}

.popup-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.popup-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.popup-actions {
    display: flex;
    gap: 8px;
}

.popup-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.popup-btn:hover {
    background: var(--surface);
}

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

.popup-btn.primary:hover {
    background: var(--primary-dark);
}

/* ============================================
   Loading States
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--surface-dark);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --panel-width: 100%;
    }
    
    .header-center {
        display: none;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .side-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: auto;
        max-height: 60vh;
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(calc(100% - 120px));
        transition: transform 0.3s ease;
    }
    
    .side-panel.expanded {
        transform: translateY(0);
    }
    
    .side-panel.collapsed {
        transform: translateY(calc(100% - 60px));
    }
    
    .panel-toggle {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: -12px;
        right: auto;
        width: 48px;
        height: 24px;
        border-radius: var(--radius-md);
    }
    
    .panel-toggle svg {
        transform: rotate(90deg);
    }
    
    .side-panel.expanded .panel-toggle svg {
        transform: rotate(-90deg);
    }
    
    .panel-content {
        padding: 24px 16px 16px;
    }
    
    .map-wrapper {
        height: calc(100vh - var(--header-height));
    }
    
    .map-controls {
        right: 8px;
        bottom: 180px;
    }
    
    .layer-selector {
        right: 8px;
        bottom: 140px;
    }
    
    .poi-legend {
        left: 8px;
        bottom: 140px;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .trip-actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .popup-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   Fullscreen Mode
   ============================================ */
.fullscreen .header {
    display: none;
}

.fullscreen .main-content {
    top: 0;
}

.fullscreen .side-panel {
    display: none;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .side-panel,
    .map-controls,
    .layer-selector,
    .poi-legend {
        display: none;
    }
    
    .map-wrapper {
        position: static;
        height: auto;
    }
}
