:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(6, 182, 212, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.3);
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.3);
    --violet: #8b5cf6;
    --violet-glow: rgba(139, 92, 246, 0.3);
    --amber: #f59e0b;
    --red: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Sidebar Styles */
#sidebar {
    width: 420px;
    min-width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid var(--glass-border);
}

/* App Header */
.app-header {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--glass-border);
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
}

.user-pill-badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 0 15px var(--cyan-glow);
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text h1 .badge {
    font-size: 0.7rem;
    background: var(--cyan);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Status Indicator Button */
.status-indicator-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-indicator-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;

}

.status-dot.green {
    background-color: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.status-dot.amber {
    background-color: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    padding: 0.75rem 1.25rem 0 1.25rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.tab-btn:hover:not(:disabled) {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

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

/* Tab Content Areas */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;

}

.tab-content.active {
    display: block;
}

/* Cards & Layout */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hint-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Waypoints Container & Inputs */
.waypoints-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.waypoint-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.waypoint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.waypoint-item.active-target {
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
    background: rgba(6, 182, 212, 0.08);
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    z-index: 1500;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.suggestion-item {
    padding: 8px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(6, 182, 212, 0.25);
    color: #fff;
}

.waypoint-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.waypoint-badge.start { background-color: var(--emerald); }
.waypoint-badge.end { background-color: var(--red); }
.waypoint-badge.checkpoint { background-color: var(--violet); }

.waypoint-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
}

.waypoint-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--cyan-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, var(--emerald), #059669);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 0 15px var(--emerald-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.glow-btn {
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

/* Info Cards */
.info-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.info-item i {
    font-size: 1.1rem;
    margin-top: 2px;
}

.info-item div {
    display: flex;
    flex-direction: column;
}

.info-item strong {
    color: var(--text-primary);
}

.info-item span {
    color: var(--text-secondary);
}

/* Metric Boxes & Stats */
.stats-overview-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 1.25rem 0.5rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(6, 182, 212, 0.2);
}

.metric-box {
    text-align: center;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--cyan);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.metric-divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

.stats-detail-card h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.breakdown-header span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
}

.tag-badge {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--cyan);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--cyan);
    background: rgba(6, 182, 212, 0.05);
}

.history-info h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Map Canvas & Overlay */
#map-wrapper {
    flex: 1;
    height: 100%;
    position: relative;
}

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

.map-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 900;
    padding: 0.6rem 1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.summary-metric {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Custom Leaflet Layer Control at Bottom Left */
.leaflet-bottom.leaflet-left .leaflet-control-layers {
    margin-bottom: 24px;
    margin-left: 24px;
    border: 1px solid var(--glass-border) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    color: #fff !important;
    overflow: hidden;
}

.leaflet-control-layers-toggle {
    width: auto !important;
    height: auto !important;
    padding: 8px 14px !important;
    background-image: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--text-primary) !important;
    font-family: var(--font-heading) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.leaflet-control-layers-toggle::before {
    content: "\f5fd"; /* FontAwesome fa-layer-group */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--cyan);
    font-size: 0.95rem;
}

.leaflet-control-layers-toggle::after {
    content: "Vrstvy mapy";
    color: #ffffff;
}

.leaflet-control-layers-expanded {
    padding: 10px 14px !important;
    color: #ffffff !important;
    background: rgba(15, 23, 42, 0.95) !important;
}

.leaflet-control-layers-expanded label {
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal Overlay & Wizard */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-card {
    width: 100%;
    max-width: 650px;
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.wizard-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.option-card:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.option-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.option-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.option-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 0.75rem;
}

.option-time {
    font-size: 0.72rem;
    color: var(--amber);
    margin-bottom: 0.5rem;
}

.progress-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.progress-status-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill.animated {
    background: linear-gradient(90deg, var(--cyan), var(--emerald), var(--violet));
    background-size: 200% 100%;
    animation: gradientShift 2s infinite linear;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.progress-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Utilities */
.hidden { display: none !important; }
.text-cyan { color: var(--cyan); }
.text-emerald { color: var(--emerald); }
.text-violet { color: var(--violet); }
.mt-3 { margin-top: 0.75rem; }

/* Mobile Responsive Styling */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column-reverse;
        height: 100vh;
        overflow: hidden;
    }

    #sidebar {
        width: 100% !important;
        min-width: 100% !important;
        height: 52vh !important;
        max-height: 52vh !important;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    }

    #map-container {
        height: 48vh !important;
        width: 100% !important;
    }

    .app-header {
        padding: 0.5rem 0.75rem;
    }

    .logo-text h1 {
        font-size: 1.05rem;
    }

    .sidebar-content {
        padding: 0.65rem;
        gap: 0.65rem;
    }

    .metric-value {
        font-size: 1.3rem;
    }

    .stats-overview-card {
        padding: 0.75rem 0.25rem;
    }

    .planner-mode-toggle button {
        padding: 0.45rem 0.35rem !important;
        font-size: 0.72rem !important;
    }

    .btn {
        min-height: 44px;
    }
}
