/* ============================================
   MODERN SHADCN-INSPIRED DESIGN
   ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-light: #dcfce7;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f5f9;
    overflow: hidden;
    height: 100vh;
}

/* Full-screen map as canvas */
#map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Top Toolbar */
.top-toolbar {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 452px; /* Ends before POI panel (420px width + 16px right margin + 16px gap) */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

/* Expand toolbar and timeline when POI panel is collapsed */
.poi-panel.collapsed ~ .top-toolbar,
.poi-panel.collapsed ~ .timeline-panel {
    right: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.toolbar-center:empty,
.toolbar-center:not(:has(*:not(:empty))) {
    display: none;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 18px;
}

.logo-text {
    white-space: nowrap;
}

/* Toolbar button styles */
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: var(--bg-muted);
    border-color: var(--border-hover);
}

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

.toolbar-btn.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.toolbar-btn-icon {
    padding: 8px;
    min-width: 34px;
    justify-content: center;
}

.toolbar-btn-icon:hover {
    background: var(--bg-muted);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-muted);
    border-color: var(--border-hover);
}

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

.btn-icon {
    padding: 10px;
    min-width: 40px;
    justify-content: center;
}

.btn-icon.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* File input styling */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-wrapper label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--accent);
    color: white;
    white-space: nowrap;
}

.file-input-wrapper label:hover {
    background: var(--accent-hover);
}

/* Toolbar drop zone state */
.top-toolbar.drop-zone-active {
    background: var(--accent-light);
    border-color: var(--accent);
    border-style: dashed;
    border-width: 2px;
}

.top-toolbar.drop-zone-active::before {
    content: 'Drop GPX file here';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 252, 231, 0.95);
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-lg);
    z-index: 10;
}

.top-toolbar.drop-zone-active > * {
    opacity: 0.3;
}

.filename-badge {
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent-hover);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-text {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.status-text:empty {
    display: none;
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

/* Floating POI Panel */
.poi-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 420px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.poi-panel.collapsed {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

.poi-panel-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.poi-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.poi-count-badge {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.poi-panel-close,
.panel-close-btn,
.timeline-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.poi-panel-close:hover,
.panel-close-btn:hover,
.timeline-close:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.poi-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Empty State */
.poi-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.poi-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.poi-empty p {
    font-size: 14px;
    line-height: 1.5;
}

/* POI Table */
#poi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

#poi-table th,
#poi-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#poi-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

/* Prevent distance/deviation columns from wrapping */
#poi-table td:nth-child(1),
#poi-table td:nth-child(2) {
    white-space: nowrap;
}

#poi-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#poi-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

#poi-table tbody tr.starred {
    background-color: #fefce8;
}

#poi-table tbody tr.starred:hover {
    background-color: #fef9c3;
}

#poi-table tbody tr.highlighted {
    animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
    0% {
        background-color: #93c5fd;
    }
    100% {
        background-color: transparent;
    }
}

#poi-table a {
    color: var(--accent);
    text-decoration: none;
}

#poi-table a:hover {
    text-decoration: underline;
}

/* Combined POI cell */
.poi-cell-type {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.poi-cell-name {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 1px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toggle Panel Button */
.toggle-panel-btn {
    position: fixed;
    right: 16px;
    top: 86px; /* Below the toolbar with gap */
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.15s;
    display: none;
    color: var(--text-secondary);
    align-items: center;
    gap: 6px;
}

.toggle-panel-btn:hover {
    background: var(--bg-secondary);
}

.toggle-panel-btn::after {
    content: 'POIs';
    font-size: 13px;
    font-weight: 500;
}

.poi-panel.collapsed ~ .toggle-panel-btn {
    display: flex;
}

/* Timeline Panel */
.timeline-panel {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 452px; /* Account for POI panel */
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 16px 20px;
    display: none;
}

.timeline-panel.visible {
    display: block;
}

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

.timeline-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-input-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-input-group input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.timeline-input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.timeline-input-group .input-unit {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-visualization {
    min-height: 140px;
}

.timeline-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-muted);
    text-align: center;
}

.timeline-empty-state i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.timeline-empty-state p {
    font-size: 13px;
    margin: 0;
}

/* Timeline Chart */
.timeline-chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.elevation-container {
    position: relative;
    height: 100px;
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-muted) 100%);
    overflow: hidden;
    cursor: crosshair;
}

.elevation-profile {
    width: 100%;
    height: 100%;
    display: block;
}

.elevation-profile .elevation-area {
    fill: rgba(34, 197, 94, 0.3);
}

.elevation-profile .elevation-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.elevation-labels {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 0;
    pointer-events: none;
}

.elevation-labels span {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.8);
    padding: 1px 4px;
    border-radius: 2px;
}

.timeline-scales {
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.distance-scale {
    position: relative;
    height: 18px;
    border-bottom: 2px solid var(--text-primary);
}

.distance-scale .tick {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.distance-scale .tick.tick-start {
    transform: none;
    align-items: flex-start;
}

.distance-scale .tick.tick-end {
    transform: translateX(-100%);
    align-items: flex-end;
}

.distance-scale .tick::before {
    content: '';
    width: 1px;
    height: 5px;
    background: var(--text-primary);
}

.distance-scale .tick-label {
    font-size: 10px;
    color: var(--text-primary);
    margin-top: 2px;
    font-weight: 500;
}

.time-scale {
    position: relative;
    height: 16px;
    margin-top: 4px;
}

.time-scale .tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-muted);
}

.time-scale .tick.tick-start {
    transform: none;
}

.time-scale .tick.tick-end {
    transform: translateX(-100%);
}

.poi-markers {
    position: relative;
    height: 28px;
    border-top: 1px solid var(--border);
}

.poi-marker {
    position: absolute;
    bottom: 4px;
    transform: translateX(-50%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

.poi-marker:hover {
    transform: translateX(-50%) scale(1.15);
    z-index: 10;
}

.poi-marker i {
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.poi-marker .poi-marker-line {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 140px;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.poi-marker:hover .poi-marker-line {
    background: rgba(0, 0, 0, 0.4);
}

.timeline-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.poi-marker:hover .timeline-tooltip {
    opacity: 1;
}

.timeline-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
}

.timeline-hover-marker {
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.poi-hover-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #3b82f6;
    display: none;
    pointer-events: none;
    z-index: 10;
}

.poi-hover-indicator.visible {
    display: block;
}

/* Settings Panel (slide from right) */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 100%;
    background: var(--bg-primary);
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.settings-panel.active {
    transform: translateX(0);
}

.settings-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.settings-info {
    background: var(--bg-muted);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-info p {
    margin: 0;
}

.settings-info p + p {
    margin-top: 4px;
}

.settings-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.settings-columns-hint {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-columns-hint .hint-spacer {
    flex: 1;
}

.settings-columns-hint span:not(.hint-spacer) {
    width: 60px;
    text-align: center;
}

.poi-settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s;
}

.setting-item:hover {
    background: var(--bg-muted);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.setting-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.setting-name {
    font-size: 14px;
    color: var(--text-primary);
}

.setting-inputs {
    display: flex;
    gap: 6px;
}

.setting-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.settings-hint i {
    color: var(--accent);
    margin-top: 2px;
}

.settings-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.settings-footer .btn {
    width: 100%;
    justify-content: center;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    width: 90%;
    padding: 24px;
    position: relative;
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    text-align: center;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px 0;
    text-align: center;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* Download format specific */
.download-format-dialog {
    text-align: center;
}

/* Credits modal */
.credits-content {
    max-width: 420px;
    text-align: left;
}

.credits-content h2 {
    text-align: left;
    margin-bottom: 4px;
}

.credits-intro {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 20px;
}

.credits-section {
    margin-bottom: 16px;
}

.credits-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.credits-section p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
}

.credits-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credits-section li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.credits-section a {
    color: var(--accent);
    text-decoration: none;
}

.credits-section a:hover {
    text-decoration: underline;
}

.license-note {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.credits-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.credits-github {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.credits-github:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* POI Actions */
.poi-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: flex-end;
}

.poi-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 4px;
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.15s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.poi-action-btn:hover {
    transform: scale(1.1);
    background: var(--bg-muted);
}

.poi-star-btn {
    color: var(--text-muted);
}

.poi-star-btn.starred {
    color: #eab308;
}

.poi-star-btn:hover {
    color: #eab308;
}

.poi-delete-btn {
    color: #dc2626;
}

.poi-delete-btn:hover {
    color: #b91c1c;
}

.poi-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 4px;
    color: var(--accent);
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.15s ease;
    font-size: 12px;
}

.poi-link-btn:hover {
    background: var(--accent-light);
    text-decoration: none;
}

/* User location icon */
.user-location-icon {
    background: transparent !important;
    border: none !important;
}

.user-location-dot {
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.user-location-pulse {
    width: 30px;
    height: 30px;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: location-pulse 2s ease-out infinite;
}

@keyframes location-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Custom POI icon styling */
.custom-poi-icon {
    background: transparent;
    border: none;
    text-align: center;
    line-height: 24px;
}

.custom-poi-icon i {
    text-shadow:
        -1px -1px 0 rgba(255, 255, 255, 0.9),
        1px -1px 0 rgba(255, 255, 255, 0.9),
        -1px 1px 0 rgba(255, 255, 255, 0.9),
        1px 1px 0 rgba(255, 255, 255, 0.9),
        0 0 4px rgba(0, 0, 0, 0.7),
        0 0 8px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.6);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Leaflet control overrides */
.leaflet-bottom.leaflet-left {
    left: 16px;
    bottom: 16px;
}

.leaflet-left .leaflet-control {
    margin-left: 0;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 18px !important;
    font-weight: 400 !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-muted) !important;
    color: var(--text-primary) !important;
}

.leaflet-control-layers {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.leaflet-control-layers-toggle {
    width: 36px !important;
    height: 36px !important;
    background-size: 20px 20px !important;
}

.leaflet-control-layers-expanded {
    padding: 8px 12px !important;
}

.leaflet-control-layers label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
}

/* Location control */
.leaflet-control-location {
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
    overflow: hidden;
    border: none !important;
}

.leaflet-control-location-btn {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary) !important;
    border: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
}

.leaflet-control-location-btn:hover {
    background: var(--bg-muted) !important;
    color: var(--text-primary) !important;
}

.leaflet-control-location-btn.active {
    background: var(--accent-light) !important;
    color: var(--accent) !important;
}

/* Map type control */
.map-type-control {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.map-type-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 16px;
    transition: background-color 0.15s ease;
    padding: 0;
}

.map-type-btn:hover {
    background-color: var(--bg-muted);
}

.map-type-menu {
    position: absolute;
    bottom: 40px;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 180px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.map-type-menu.visible {
    display: flex;
}

.map-type-option {
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--border);
}

.map-type-option:last-child {
    border-bottom: none;
}

.map-type-option:hover {
    background-color: var(--bg-muted);
}

.map-type-option.active {
    background-color: var(--accent);
    color: white;
}

.map-type-option.active:hover {
    background-color: var(--accent-hover);
}

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

.leaflet-popup-content {
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

.leaflet-popup-content a {
    color: var(--accent);
    text-decoration: none;
}

.leaflet-popup-content a:hover {
    text-decoration: underline;
}

/* Scale control */
.leaflet-control-scale {
    margin-bottom: 16px !important;
    margin-right: 16px !important;
}

.leaflet-control-scale-line {
    border-color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 10px !important;
    padding: 2px 5px !important;
    border-radius: 2px !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Responsive */
@media (max-width: 1200px) {
    /* Move POI panel below toolbar on smaller laptops */
    .poi-panel {
        width: auto;
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 16px;
        max-height: 45vh;
    }

    .top-toolbar {
        right: 16px;
    }

    .timeline-panel {
        right: 16px;
        bottom: auto;
        top: 70px;
        max-height: 260px;
    }

    .toggle-panel-btn {
        top: auto;
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 900px) {
    /* Top toolbar mobile adjustments */
    .top-toolbar {
        left: 8px;
        right: 8px;
        top: 8px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .toolbar-left {
        order: 1;
    }

    .toolbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .toolbar-right {
        order: 2;
        gap: 6px;
    }

    .btn-label {
        display: none;
    }

    .toolbar-btn {
        padding: 8px 10px;
    }

    .toolbar-divider {
        display: none;
    }

    .file-input-wrapper label {
        padding: 8px 10px;
    }

    .logo-text {
        display: none;
    }

    .poi-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .toggle-panel-btn {
        bottom: 8px;
        right: 8px;
        top: auto;
        z-index: 1001;
        padding: 10px 14px;
    }

    .filename-badge {
        max-width: 150px;
    }

    .timeline-panel {
        left: 8px;
        right: 8px;
        top: 65px;
        padding: 12px 16px;
    }

    .timeline-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .timeline-title {
        font-size: 14px;
    }

    .timeline-visualization {
        min-height: 100px;
    }

    .elevation-container {
        height: 80px;
    }

    .timeline-empty-state {
        padding: 15px 10px;
    }

    .timeline-empty-state i {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .timeline-empty-state p {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .top-toolbar {
        padding: 6px 10px;
    }

    .toolbar-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .toolbar-btn-icon {
        padding: 6px;
        min-width: 30px;
    }

    .file-input-wrapper label {
        padding: 6px 8px;
        font-size: 12px;
    }

    .logo {
        font-size: 14px;
    }

    .logo-icon {
        font-size: 16px;
    }

    .settings-panel {
        width: 100%;
    }

    /* Larger modal on mobile */
    .modal-content {
        max-width: 90%;
        width: 320px;
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 16px;
    }

    .modal-actions {
        gap: 12px;
    }

    .modal-action-item .btn {
        min-width: 160px;
        padding: 12px 20px;
    }

    /* Timeline adjustments for small screens */
    .timeline-panel {
        top: 60px;
    }

    .timeline-input-group label {
        font-size: 11px;
    }

    .timeline-input-group input {
        width: 50px;
        padding: 4px 6px;
        font-size: 12px;
    }

    .poi-markers {
        height: 24px;
    }

    .poi-marker i {
        font-size: 12px;
    }

    .poi-panel {
        max-height: 40vh;
    }
}
