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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

h1 {
    font-family: alternate-gothic-no-2-d, sans-serif;
    font-weight: normal;
    font-size: 42px;
}

h2 {
    margin-bottom: 20px;
}

/* Header */
.header {
    padding: 0.5rem 1rem;
    z-index: 1100; /* Higher than help panel (1000) to ensure it's above */
    position: relative;
    background-color: white;
}

.header-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 100%;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: none;
    border-radius: 10px;
    font-size: 15px;
}

/* Main Layout */
.main {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Sidebar Container - flexbox container */
.sidebar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    max-width: calc(100% - 160px);
    max-height: calc(100dvh - 65px); /* Match legend panel height */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0; /* No gap initially, instruction panel will add its own margin */
    transition: transform 0.2s ease;
}

/* Hidden state for sidebar container */
.sidebar-container.hidden {
    transform: translateX(calc(-100% + 60px)); /* Slide left by width minus button space (40px button + 20px margin) */
}

/* Adjust toggle button position when hidden to stay at 20px from left edge */
.sidebar-container.hidden .sidebar-toggle-btn {
    right: auto;
    left: calc(100% - 60px); /* Position button so it ends up at 20px from screen edge */
}

/* Hide sidebar and instruction panel content when hidden */
.sidebar-container.hidden .sidebar,
.sidebar-container.hidden .instruction-panel,
.sidebar-container.hidden .logo-panel {
    opacity: 0;
    pointer-events: none;
}

/* Logo Panel */
.logo-panel {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    padding: 1rem;
    padding-top: 12px;
    padding-bottom: 12px;
    transition: opacity 0.2s ease;
}

.logo-panel-text {
    font-family: alternate-gothic-no-2-d, sans-serif;
    font-weight: normal;
    font-size: 36px;
    margin: 0;
}

.beta-tag {
    background-color: #a4a4a4;
    color: white;
    padding: 3px 7px;
    font-size: 16px;
    border-radius: 5px;
    vertical-align: middle;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@media (max-width: 500px) {
    .logo-panel-text {
        font-size: 26px;
    }
    .beta-tag {
        padding: 2px 5px;
        font-size: 12px;
    }
}

/* Instruction Panel */
.instruction-panel {
    flex: 0 0 auto; /* Don't grow or shrink, take natural height */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease-out 0.1s, transform 0.2s ease-out 0.1s, max-height 0.2s ease-out 0.1s, margin-bottom 0.2s ease-out 0.1s;
    pointer-events: none;
}

.instruction-panel.visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px; /* Large enough for any content */
    margin-bottom: 20px; /* Add spacing only when visible */
    pointer-events: auto;
}

.instruction-content {
    padding: 1.5rem;
    text-align: left;
}

.instruction-content h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #444;
}

.instruction-content p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Sidebar */
.sidebar {
    flex: 0 1 auto; /* Don't force growth, but allow shrinking */
    background-color: white;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 0; /* Allow flexbox to shrink below content size */
    max-height: calc(100% - 40px);
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: absolute;
    top: 0;
    right: -60px; /* 20px margin from panel + 40px button width */
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    user-select: none;
    padding: 0;
    z-index: 1001; /* Above sidebar content */
    box-sizing: content-box;
}

.sidebar-toggle-btn:hover {
    background-color: #f5f5f5;
}

.sidebar-toggle-btn .control-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
    transition: transform 0.2s ease;
}

.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

/* Prevent sidebar sections from flashing during initialization */
#route-info,
#elevation-profile-container,
#surface-info-container,
#options-container {
    opacity: 0;
    transition: opacity 0.2s ease-out 0.1s;
}

/* Show sections after initialization */
.sidebar.initialized #route-info,
.sidebar.initialized #elevation-profile-container,
.sidebar.initialized #surface-info-container,
.sidebar.initialized #options-container {
    opacity: 1;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #444;
}

/* Search */
.search-container {
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem; /* Add right padding for clear button */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.search-clear-btn .control-icon {
    width: 16px;
    height: 16px;
}

.search-results {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    z-index: 1200;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 318px; /* Match search input width: 350px sidebar - 2rem padding */
}

.search-result {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result:hover {
    background-color: #f5f5f5;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 500;
    color: #333;
}

.search-result-address {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.25rem;
}

/* Route Controls */
.route-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-controls label {
    font-weight: 500;
    color: #555;
}

.route-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Route Stats */
.route-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 700;
    color: #151515;
}

/* Route Actions */
.route-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #000;
    color: white;
}

.btn-primary:hover {
    background-color: #444;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

#clear-route-btn:hover {
    background-color: #ff0000;
}

.btn-danger {
    background-color: #ff0000;
    color: white;
}

.btn-danger:hover {
    background-color: #ff0000;
}

.btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon-sm:hover {
    opacity: 1;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    cursor: crosshair;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

#map * {
    cursor: crosshair;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 400;
}

/* Zoom button group */
.zoom-group {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #ccc;
    background: white;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    user-select: none;
    padding: 0;
    box-sizing: content-box;
}

/* Zoom buttons in group styling */
.zoom-group .map-control-btn {
    box-shadow: none;
    border: none;
    border-radius: 10px;
}

/* Add larger gap after menu button */
.menu-btn-separator {
    margin-bottom: 20px;
}

.control-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
}

.map-control-btn:hover {
    background-color: #f5f5f5;
}

.map-control-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background-color: #f9f9f9;
}

.map-control-btn:disabled:hover {
    background-color: #f9f9f9;
}

/* Info button positioned at bottom of map */
.info-btn-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 400;
}



/* Elevation Chart */
#elevation-chart {
    width: 100%;
    max-width: 100%;
    background: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Checkbox styling for form labels */
.form-group label input[type="checkbox"] {
    width: auto;
    margin: 0 0.5rem 0 0;
    padding: 0;
    vertical-align: middle;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 2px rgba(44, 85, 48, 0.1);
}

.form-link {
    text-align: center;
    margin-top: 1rem;
    color: #555;
}

.form-link a {
    color: black;
}

/* Login Error Display */
.login-error {
    background-color: #fecaca;
    color: #dc2626;
    padding: 20px;
    border-radius: 0;
    font-weight: 500;
    text-align: left;
    border: none;
    font-size: 0.9rem;
}

/* Routes List */
.routes-list {
    display: grid;
    gap: 1rem;
}

.route-item {
    background: white;
    font-size: 1.2em;
    display: flex;
    gap: 25px;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 20px;
}

.route-thumbnail {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
}

.route-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease;
}

.route-thumbnail:hover img {
    filter: brightness(0.9);
}

.route-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.route-item-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.route-item-title {
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    gap: 25px;
}

.route-item-title a {
    color: #000000;
    text-decoration: none;
    font-size: 1.4em;
}

.route-item-buttons {
    display: flex;
    gap: 20px;
}

.route-item-date {
    color: #555;
}

.public-badge {
    background-color: green;
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    display: inline-block;
    align-self: flex-start;
    font-size: 0.9em;
}

.route-item-stats {
    display: flex;
    gap: 0.8rem;
    color: #555;
}

.route-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 20px;
}

.route-item-actions .btn {
    padding: 0.5rem 1rem;
}


@media (max-width: 500px) {
    .route-item-title {
        flex-direction: column;
        gap: 20px;
    }
    .route-item-title a {
        font-size: 1.2em;
    }
    .route-item-buttons {
        gap: 30px;
    }
    .route-item-stats {
        font-size: 1em;
        gap: 0.5rem;
    }
}


/* Responsive Design */
@media (max-width: 768px) {
    /* .sidebar-container {
        left: -350px;
        transition: left 0.2s ease;
        z-index: 1500;
    }

    .sidebar-container.open {
        left: 20px;
    }

    .instruction-panel {
        border-radius: 0 10px 10px 0;
    }

    .sidebar {
        border-radius: 0 10px 10px 0;
    } */

    /* Make thumbnail smaller on mobile */
    .route-thumbnail {
        width: 100px;
        height: 100px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5530;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Surface Information Styles */
.surface-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.surface-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 2px solid transparent;
    border-left: 4px solid #dee2e6;
    border-left-color: #a6a6a6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.surface-item:hover {
    background-color: #e9ecef;
}

.surface-item.selected {
    border-color: #ff00007d;
}

.surface-item.steps {
    background-color: #ffe0e0;
    border-left-color: #e74c3c;
}

.surface-item.ferry {
    background-color: #ffe0e0;
    border-left-color: #e74c3c;
}

.surface-item.unknown {
    border-left-color: #e3e3e3;
}

.surface-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.surface-name {
    font-weight: 500;
    text-transform: capitalize;
}

.surface-distance {
    font-size: 0.8rem;
    color: #555;
}

.surface-percentage {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Options Section */
.options-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.option-item {
    display: flex;
    align-items: center;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    user-select: none;
}

.option-item input[type="checkbox"] {
    margin: 0;
}

/* Average speed input styling */
.option-item #average-speed-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.option-item #average-speed-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Update average speed option item to be full width */
.option-item:has(#average-speed-input) {
    flex-direction: column;
    align-items: flex-start;
}

.option-item:has(#average-speed-input) label {
    margin-bottom: 0;
}

/* Waypoint Surface Popover */
.waypoint-popover {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 10000;
    font-size: 14px;
    min-width: 140px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.waypoint-popover.visible {
    opacity: 1;
    transform: translateY(0);
}

.waypoint-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: white;
}

.waypoint-popover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -9px;
    border: 9px solid transparent;
    border-top-color: #ddd;
}

.waypoint-number-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 13px;
}

.popover-title {
    font-weight: 600;
    color: #2c5530;
    margin-bottom: 8px;
    font-size: 13px;
}

.surface-toggle-group {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 10px;
}

.surface-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #555;
}

.surface-toggle-btn:hover {
    background: rgba(44, 85, 48, 0.1);
}

.surface-toggle-btn.active {
    background: #2c5530;
    color: white;
}

.waypoint-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.search-location-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-location-buttons .surface-toggle-btn {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
}

.search-location-buttons .surface-toggle-btn:hover {
    background: rgba(44, 85, 48, 0.1);
}

#search-finish-btn.hidden,
#search-start-btn.hidden {
    display: none;
}

#search-cancel-btn {
    border: none;
    background: none;
    color: #555;
    font-size: 12px;
    padding: 4px 0;
    margin-top: 2px;
    text-decoration: none;
    cursor: pointer;
}

#search-cancel-btn:hover {
    background: none;
    color: #333;
}

.waypoint-action-btn {
    padding: 6px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waypoint-action-btn:hover {
    opacity: 0.7;
}

.waypoint-delete-btn:hover {
    filter: invert(23%) sepia(77%) saturate(3427%) hue-rotate(344deg) brightness(93%) contrast(85%);
}

.waypoint-streetview-btn:hover {
    filter: invert(42%) sepia(93%) saturate(5000%) hue-rotate(194deg) brightness(101%) contrast(101%);
}

.waypoint-action-btn img {
    width: 22px;
    height: 22px;
}

/* Routes Page Styles */
.routes-page-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

@media (max-width: 500px) {
    .routes-page-container {
        padding: 20px;
    }
}

.routes-page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.routes-page-header h1 {
    font-size: 2.5rem;
    color: #444;
    margin-bottom: 0.5rem;
}

.routes-page-header p {
    color: #555;
    font-size: 1.1rem;
}

.routes-filter-container {
    margin-bottom: 3rem;
    position: relative;
}

@media (max-width: 500px) {
    .routes-page-header {
        margin-bottom: 1rem;
    }
    .routes-filter-container {
        margin-bottom: 2rem;
    }
}

.routes-filter-container input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.routes-filter-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.routes-filter-clear-btn .control-icon {
    width: 16px;
    height: 16px;
}

/* Override body overflow for routes page */
body.routes-page {
    overflow: auto;
}

/* Adjust routes list for full page layout */
.routes-page-container .routes-list {
    width: 100%;
    max-width: none;
}

/* Profile Page Styles */
.profile-page-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.profile-page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.profile-page-header h1 {
    font-size: 2.5rem;
    color: #444;
    margin-bottom: 0.5rem;
}

.profile-page-header p {
    color: #555;
    font-size: 1.1rem;
}

/* Override body overflow for profile page */
body.profile-page {
    overflow: auto;
}

.profile-content {
    display: grid;
    gap: 2rem;
}

.profile-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 16px;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.profile-value {
    color: #555;
    text-align: right;
}

.profile-role {
    background: #000;
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-stats {
    display: grid;
    gap: 1rem;
}

.coming-soon {
    color: #555;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 0;
}

/* Responsive adjustments for profile page */
@media (max-width: 768px) {
    .profile-page-container {
        padding: 1rem;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .profile-field label {
        min-width: auto;
    }

    .profile-value {
        text-align: left;
    }
}

/* Help Panel */
.help-panel {
    position: fixed;
    top: 20px; /* Align with map controls */
    right: 80px; /* Leave space for map controls (20px margin + 40px button + 20px spacing) */
    width: 350px;
    max-height: calc(100dvh - 40px);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: none; /* Start hidden */
    flex-direction: column;
}

.help-panel.show {
    transform: translateX(0);
    opacity: 1;
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.help-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #444;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-panel-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.help-panel-body {
    padding: 25px;
    flex: 1;
    overflow-y: scroll;
}

/* Webkit scrollbar styling for better appearance */
.help-panel-body::-webkit-scrollbar {
    width: 6px;
}

.help-panel-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.help-panel-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.help-panel-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.help-panel-body p {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

/* Responsive adjustments for help panel */
@media (max-width: 768px) {
    .help-panel {
        right: 20px; /* Position at normal right position for mobile */
        z-index: 1500;
        transform: translateX(100%); /* Start off-screen (right) */
    }

    .help-panel.show {
        transform: translateX(0); /* Slide in from right */
    }
}

/* Menu Panel */
.menu-panel {
    position: fixed;
    top: 20px; /* Align with map controls */
    right: 80px; /* Leave space for map controls (20px margin + 40px button + 20px spacing) */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: none; /* Start hidden */
}

.menu-panel.show {
    transform: translateX(0);
    opacity: 1;
}

.menu-panel-content {
    display: flex;
    flex-direction: column;
}

.menu-panel-btn {
    padding: 15px 20px;
    border: none;
    background-color: white;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.menu-panel-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

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

.menu-panel-btn:hover {
    background-color: #f8f9fa;
}

/* Responsive adjustments for menu panel */
@media (max-width: 768px) {
    .menu-panel {
        right: 20px;
        z-index: 1500;
        transform: translateX(100%); /* Start off-screen (right) */
    }

    .menu-panel.show {
        transform: translateX(0); /* Slide in from right */
    }
}