/**
 * Fuel Price Monitor - Stylesheet
 * Extracted from inline styles + enhancements
 * Font sizes reduced for better information density
 */

/* =====================================================
   BASE STYLES
   ===================================================== */

:root {
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --sidebar-width: 300px;
    --right-sidebar-width: 280px;
    --topbar-height: 48px;
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
    --font-size-xs: 10px;
}
html {
   height: 100%; 
}

html, body {
    margin: 0;
    font-size: var(--font-size-base);
}

body.page-map {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* =====================================================
   TOPBAR
   ===================================================== */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
}

.topbar-brand {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.topbar-brand:hover {
    color: inherit;
    opacity: 0.9;
}
.topbar-brand-logo {
    height: 30px;
    width: auto;
    margin-right: 8px;
    flex-shrink: 0;
    object-fit: contain;
}

.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-right: 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.topbar-menu-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* =====================================================
   LAYOUT - MAIN CONTAINER
   ===================================================== */

.main-container {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    height: calc(100dvh - var(--topbar-height));
    margin-top: var(--topbar-height);
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    height: calc(100dvh - var(--topbar-height));
    overflow: hidden;
    position: relative;
}

/* =====================================================
   LEFT SIDEBAR
   ===================================================== */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    height: calc(100dvh - var(--topbar-height));
    overflow-y: auto;
}

.sidebar-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.25rem;
}

.sidebar-header small {
    font-size: var(--font-size-sm);
}

.sidebar-body {
    padding: 1rem;
    flex: 1;
}

.sidebar .form-label {
    color: rgba(255,255,255,0.9);
    font-size: var(--font-size-sm);
    margin-bottom: 0.3rem;
}

.sidebar .form-text {
    color: rgba(255,255,255,0.6);
    font-size: 10px;
}

.sidebar .form-control,
.sidebar .form-select {
    background-color: rgba(255,255,255,0.95);
    border: none;
    font-size: var(--font-size-base);
    padding: 0.4rem 0.6rem;
}

.sidebar .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.sidebar .btn-light {
    font-size: var(--font-size-base);
    padding: 0.5rem 1rem;
}

/* =====================================================
   AUTOCOMPLETE
   ===================================================== */

.search-container {
    position: relative;
}

/* Input with clear button */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-clear .form-control {
    padding-right: 4rem;
}

.btn-clear-input {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(0,0,0,0.5);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: all 0.2s;
}

.btn-clear-input:hover {
    background: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.8);
}

.btn-clear-input i {
    font-size: 12px;
}

/* GPS locate button */
.btn-gps-locate {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--primary-gradient-start);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    transition: all 0.2s;
    z-index: 2;
}

.btn-gps-locate:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-gradient-end);
}

.btn-gps-locate.loading {
    pointer-events: none;
    animation: gps-pulse 1s ease-in-out infinite;
}

@keyframes gps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.btn-gps-locate i {
    font-size: 16px;
}

.gps-link {
    color: var(--bg-light);
    text-decoration: none;
    font-weight: 500;
    cursor: default;
}

.gps-link:hover {
    text-decoration: underline;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-results .list-group-item {
    font-size: var(--font-size-sm);
    padding: 0.5rem 0.75rem;
    color: #333;
}

.autocomplete-results .list-group-item-action:hover,
.autocomplete-results .list-group-item-action.active {
    background-color: #e9ecef;
}

/* =====================================================
   SELECTED LOCATION
   ===================================================== */

.selected-location {
    background-color: rgba(255,255,255,0.15);
    border-left: 4px solid var(--success-color);
    border-radius: 0.375rem;
    padding: 0.75rem !important;
    font-size: var(--font-size-sm);
}

.selected-location strong {
    font-size: var(--font-size-base);
}

/* =====================================================
   FUEL TYPE SWITCHES (Multi-select)
   ===================================================== */

.fuel-switches {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fuel-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.1);
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.fuel-switch:hover {
    background: rgba(255,255,255,0.15);
}

.fuel-switch .form-check-label {
    font-size: var(--font-size-sm);
    cursor: pointer;
    flex: 1;
    margin-left: 0.5rem;
}

.fuel-switch .form-check-input {
    width: 2rem;
    height: 1rem;
}

.fuel-switch .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

/* =====================================================
   MAP AREA
   ===================================================== */

#map-wrapper {
    flex: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

.station-marker-icon {
    background: white;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-marker-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.locality-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* =====================================================
   RIGHT SIDEBAR - STATION LIST (Desktop only)
   ===================================================== */

.right-sidebar {
    width: var(--right-sidebar-width);
    min-width: var(--right-sidebar-width);
    background: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.right-sidebar.hidden {
    display: none;
}

.right-sidebar-header {
    padding: 0.75rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.right-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.station-list-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid var(--border-color);
}

.station-list-item:hover {
    background: #f0f4ff;
    transform: translateX(-2px);
}

.station-list-item.active {
    background: #e8f0fe;
    border-color: var(--primary-gradient-start);
}

.station-list-item-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: contain;
    margin-right: 0.5rem;
    background: #f8f9fa;
    padding: 2px;
}

.station-list-item-info {
    flex: 1;
    min-width: 0;
}

.station-list-item-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.station-list-item-address {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-list-item-price {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

.station-list-item-fuel {
    font-size: 9px;
    color: var(--text-muted);
}

/* Multi-fuel price display (sidebar/bottom sheet) */
.station-list-item-prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex-shrink: 0;
}

.station-list-item-prices .price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.station-list-item-prices .fuel-label {
    font-size: 9px;
    color: var(--text-muted);
}

.station-list-item-prices .fuel-price {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

/* Route cost card (collapsible) */
.route-cost-card {
    background: rgb(108 105 204);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.route-cost-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    user-select: none;
}
.route-cost-header:hover {
    background: rgba(255,255,255,0.05);
}
.route-cost-chevron {
    transition: transform 0.25s ease;
}
.route-cost-chevron.open {
    transform: rotate(180deg);
}
.route-cost-body {
    padding: 6px 14px 14px;
}
.route-cost-distance {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}
.route-cost-slider label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}
.route-cost-slider-input {
    width: 100%;
}
.route-cost-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.route-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}
.route-cost-fuel {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}
.route-cost-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: #75ed90;
}
.route-cost-liters {
    text-align: center;
    margin-top: 4px;
    color: #ffffff;
    font-weight: bold;
}

/* Fuel badges (card list view) */
.fuel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fuel-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    background: #edf7ed;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: var(--font-size-sm);
}

.fuel-badge-label {
    color: var(--text-muted);
    font-size: 10px;
}

.fuel-badge-price {
    font-weight: 700;
    color: var(--success-color);
}

/* =====================================================
   MOBILE BOTTOM SHEET (Station List)
   ===================================================== */

.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    transition: height 0.3s ease, transform 0.3s ease;
    /* Previne Chrome Android să interpreteze swipe-ul ca pull-to-refresh / nav. */
    overscroll-behavior: contain;
    touch-action: pan-y;
    /* Respectă bara de navigație (butoane always-on) / home indicator (gestures) */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-sheet.visible {
    display: flex;
}

.bottom-sheet.collapsed {
    height: 52px;
}

.bottom-sheet.collapsed .bottom-sheet-body {
    display: none;
}

.bottom-sheet.collapsed .station-filter-panel {
    display: none;
}

.bottom-sheet.dragging {
    transition: none !important;
    will-change: height;
    user-select: none;
    -webkit-user-select: none;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 8px auto;
    cursor: grab;
    touch-action: none;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

.bottom-sheet-header {
    touch-action: none;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bottom-sheet-toggle-icon {
    transition: transform 0.3s;
    margin-left: auto;
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    /* Scroll-ul listei nu se propagă la pagină → nu declanșează închiderea sheet-ului */
    overscroll-behavior: contain;
}

/* =====================================================
   STATION FILTERS (Sidebar + Bottom Sheet)
   ===================================================== */

.station-filter-toggle {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.station-filter-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.station-filter-toggle:hover {
    color: var(--primary-gradient-start);
    background: rgba(102, 126, 234, 0.08);
}

.station-filter-toggle.active {
    color: var(--primary-gradient-start);
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.25);
}

.station-filter-active-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient-start);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.station-filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    background: linear-gradient(to bottom, #f7f8fc, #fff);
    border-bottom: 1px solid transparent;
    padding: 0 0.65rem;
}

.station-filter-panel.open {
    max-height: 260px;
    padding: 0.5rem 0.65rem;
    border-bottom-color: var(--border-color);
    overflow-y: auto;
}

.station-filter-group {
    margin-bottom: 0.4rem;
}

.station-filter-group:last-of-type {
    margin-bottom: 0;
}

.station-filter-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.station-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.station-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: white;
    color: #555;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    line-height: 1.3;
}

.station-filter-chip:hover {
    border-color: var(--primary-gradient-start);
    color: var(--primary-gradient-start);
    background: rgba(102, 126, 234, 0.04);
}

.station-filter-chip.selected {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    border-color: transparent;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

.station-filter-chip input[type="checkbox"] {
    display: none;
}

.station-filter-chip .chip-logo {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
}

.station-filter-chip.selected .chip-logo {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
}

.station-filter-chip .chip-count {
    font-size: 9px;
    opacity: 0.7;
    font-weight: 400;
}

.station-filter-chip.selected .chip-count {
    opacity: 0.85;
}

.station-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.station-filter-clear {
    background: none;
    border: none;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.station-filter-clear:hover {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.06);
}

/* =====================================================
   RESULTS LIST VIEW
   ===================================================== */

#results-wrapper {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-light);
    padding: 1rem;
}

.list-filter-bar {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.list-filter-bar .station-filter-panel {
    border-radius: 0 0 8px 8px;
}

.list-filter-bar-count {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #555;
}

.list-filter-bar > .d-flex {
    padding-bottom: 0.5rem;
}

.station-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.station-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.station-card .card-title {
    font-size: var(--font-size-base);
}

.station-card .card-text {
    font-size: var(--font-size-sm);
}

/* Products list - no border on last item */
.products-list > div:last-child {
    border-bottom: none !important;
}

/* Info collapsible on mobile */
.info-collapsible {
    cursor: pointer;
}

.info-collapsible .info-short {
    display: none;
}

.info-collapsible .info-full {
    display: inline;
    font-size: var(--font-size-xs);
}

@media (max-width: 992px) {
    .info-collapsible .info-short {
        display: inline;
    }
    
    .info-collapsible .info-full {
        display: none;
    }
    
    .info-collapsible.expanded .info-short {
        display: none;
    }
    
    .info-collapsible.expanded .info-full {
        display: inline;
    }
}

/* =====================================================
   MODAL - Station Details
   ===================================================== */

.modal-station-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    padding: 1rem;
}

.modal-station-header img {
    height: 36px;
    width: auto;
    background: white;
    padding: 4px;
    border-radius: 6px;
}

.modal-station-header .modal-title {
    font-size: var(--font-size-lg);
}

.modal-body {
    font-size: var(--font-size-base);
    padding: 1rem;
}

.modal-body h6 {
    font-size: var(--font-size-sm);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
}

.price-eur {
    font-size: 0.85em;
    font-weight: 500;
}

.product-card {
    font-size: var(--font-size-sm);
}

.product-card .card-title {
    font-size: var(--font-size-base);
}

/* Services badges */
.service-badge {
    font-size: 10px;
    padding: 0.25rem 0.5rem;
}

/* Update info */
.update-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

/* Modal footer buttons */
.modal-footer {
    padding: 0.75rem;
    gap: 0.5rem;
}

.modal-footer .btn {
    font-size: var(--font-size-sm);
    padding: 0.4rem 0.75rem;
}

.btn-waze {
    background-color: #33ccff;
    border-color: #33ccff;
    color: white;
}

.btn-waze:hover {
    background-color: #2bb8e8;
    border-color: #2bb8e8;
    color: white;
}

/* Nav button icons (Waze, Google Maps) - white overlay */
.btn-waze img,
.btn-success img,
.btn-dark img {
    filter: brightness(0) invert(1);
}

/* History button */
.btn-history {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

.btn-history:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
}

/* =====================================================
   PRICE HISTORY CHART MODAL
   ===================================================== */

.chart-container {
    width: 100%;
    height: 300px;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
}

.price-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.price-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 0.375rem;
}

.price-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.price-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.price-stat-value.min { color: var(--success-color); }
.price-stat-value.avg { color: var(--info-color); }
.price-stat-value.max { color: var(--danger-color); }


.sidebar-tab {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: #fff;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    z-index: 1025;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.25s ease;
}

.sidebar-close-wrap {
    display: none;
}

.btn-sidebar-results {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: var(--font-size-base);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.35);
    transition: all 0.2s ease;
}

/* ===== Sidebar Tabs ===== */
.sidebar-tabs {
    border-bottom: 2px solid #e9ecef;
}

.sidebar-tabs .nav-link {
    color: #d3d3d3;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.sidebar-tabs .nav-link.active {
    color: #ffffff;
    border-bottom-color: #1c9946;
    background: transparent;
}

.sidebar-tabs .nav-link:hover:not(.active) {
    color: #ffffff91;
    border-bottom-color: #dee2e6;
}

/* ===== Route Form ===== */
.via-point-row {
    position: relative;
    padding-left: 0;
}

.via-point-row .form-label {
    font-size: 0.82rem;
}

/* =====================================================
   TOPBAR NAV (Contact link)
   ===================================================== */

.topbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.topbar-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Layout simplu — topbar overrides */
.topbar-home-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.topbar-home-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.topbar-brand-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.topbar-brand-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* =====================================================
   SIDEBAR FOOTER LINKS
   ===================================================== */

.sidebar-footer-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-legal-link {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 11px;
    padding: 3px 0;
    transition: color 0.2s;
}

.sidebar-legal-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-copyright {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    text-align: center;
}

/* =====================================================
   HERO BANNER (SEO vizibil, deasupra hărții)
   ===================================================== */

.hero-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    color: #ccc;
}
.hero-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    flex-wrap: wrap;
}
.hero-banner h1 {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
    white-space: nowrap;
}
.hero-main > p {
    font-size: 12px;
    color: #8a8a9a;
    margin: 0;
    flex: 1;
    min-width: 200px;
}
.hero-toggle {
    background: none;
    border: none;
    color: var(--primary-gradient-start);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: background 0.2s;
}
.hero-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}
.hero-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 10px;
}
.hero-toggle[aria-expanded="true"] .hero-toggle-icon {
    transform: rotate(180deg);
}
.hero-toggle[aria-expanded="true"] .hero-toggle-text::after {
    content: none;
}
.hero-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 16px;
}
.hero-details.open {
    max-height: 300px;
    padding: 4px 16px 10px;
}
.hero-details p {
    font-size: 12px;
    color: #8a8a9a;
    margin: 0 0 6px;
    line-height: 1.5;
}
.hero-details h2 {
    font-size: 12px;
    font-weight: 600;
    color: #b0b0c0;
    margin: 0 0 4px;
}
.hero-details ul {
    margin: 0;
    padding-left: 18px;
    columns: 2;
    column-gap: 24px;
}
.hero-details li {
    font-size: 11px;
    color: #7a7a8a;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .hero-main {
        padding: 5px 7px;
        gap: 6px;
    }
    .hero-banner h1 {
        font-size: 10px;
        white-space: normal;
    }
    .hero-main .hero-toggle
    {
        font-size: 10px;
    }
    .hero-main > p {
        display: none;
    }
    .hero-details ul {
        columns: 1;
    }
}

/* =====================================================
   SIMPLE PAGE LAYOUT (Contact, Terms, Cookies)
   ===================================================== */

.simple-page-container {
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height) - 80px);
    display: flex;
    justify-content: center;
    padding: 24px 16px 40px;
    background: #f5f6fa;
}

.simple-page-content {
    width: 100%;
    max-width: 800px;
}

/* ===== Simple Page Footer ===== */
.simple-page-footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 16px 24px;
    text-align: center;
}

.simple-footer-inner {
    max-width: 800px;
    margin: 0 auto;
}

.simple-footer-links {
    margin-bottom: 6px;
}

.simple-footer-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
}

.simple-footer-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.simple-footer-sep {
    margin: 0 8px;
    color: #ccc;
    font-size: 12px;
}

.simple-footer-copy {
    font-size: 11px;
    color: #999;
}

/* =====================================================
   CONTACT PAGE
   ===================================================== */

.contact-page {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.contact-header {
    text-align: center;
    margin-bottom: 28px;
}

.contact-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.contact-header .lead {
    font-size: 15px;
    color: #666;
    margin-bottom: 0;
}

.contact-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.contact-form .form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.contact-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 12px;
    font-size: 15px;
    transition: opacity 0.2s, transform 0.2s;
}

.contact-form .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.contact-info-card {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s;
}

.contact-info-card:hover {
    transform: translateY(-2px);
}

/* =====================================================
   ABOUT PAGE (Despre PecoRadar)
   ===================================================== */

.about-page {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.about-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}
.about-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}
.about-header .lead {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}
.about-hero-image {
    margin: 0 0 1.5rem;
}
.about-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.about-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}
.about-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
}
.about-fuel-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
}
.about-fuel-card i {
    font-size: 1.1rem;
}
.about-networks {
    font-size: 1rem;
    line-height: 2;
    color: #444;
}
.about-features {
    list-style: none;
    padding: 0;
}
.about-features li {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}
.about-features li:last-child {
    border-bottom: none;
}
.about-features li i {
    margin-top: 3px;
    flex-shrink: 0;
}
.about-faq {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--bg-light);
}
.about-faq > h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1rem;
}
.about-faq .accordion-button {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a2e;
}
.about-faq .accordion-button:not(.collapsed) {
    background: #f0f4ff;
    color: #1a1a2e;
}
.about-faq .accordion-body {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.7;
}
.about-cta {
    margin-top: 2rem;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}
.about-cta h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.about-cta p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}
.about-cta .btn {
    background: #fff;
    color: #667eea;
    border: none;
    font-weight: 600;
}
.about-cta .btn:hover {
    background: #f0f0ff;
}

@media (max-width: 768px) {
    .about-page {
        padding: 1.2rem;
    }
    .about-header h1 {
        font-size: 1.3rem;
    }
}

/* =====================================================
   LEGAL PAGES (Terms, Cookies)
   ===================================================== */

.legal-page {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.legal-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.legal-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.legal-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-top: 24px;
    margin-bottom: 12px;
}

.legal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-content p {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.legal-content ul {
    padding-left: 20px;
}

.legal-content ul li {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 4px;
}

.legal-content a {
    color: #667eea;
}

.legal-content a:hover {
    color: #764ba2;
}

.legal-section {
    margin-bottom: 20px;
}

.legal-content .table {
    font-size: 13px;
}

.legal-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #c7254e;
}

/* =====================================================
   RESPONSIVE — Topbar nav hide text on small screens
   ===================================================== */

@media (max-width: 576px) {
    .topbar-nav-text {
        display: none;
    }
    
    .topbar-nav-link {
        font-size: 16px;
        padding: 4px 6px;
    }

    .contact-page,
    .legal-page {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .contact-header h1,
    .legal-header h1 {
        font-size: 20px;
    }

    .topbar-brand {
        font-size: 14px;
    }
}

#route-form label[for^="route-from-"] > i {
   color: rgb(38 229 140) !important;
}
#route-form label[for^="route-to-"] > i {
   color: rgb(255 131 193) !important;
}

.btn-remove-via {
    color: #dc3545 !important;
}

.btn-remove-via:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

#add-via-btn {
    font-size: 0.82rem;
}

.route-nav-buttons {
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
}

.route-nav-buttons .btn {
    font-size: 0.82rem;
}

.btn-sidebar-results:hover,
.btn-sidebar-results:active {
    background: linear-gradient(135deg, #218838, #1baa80);
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.45);
    transform: translateY(-1px);
}

/* =====================================================
   ALERTS & NOTIFICATIONS
   ===================================================== */

.alert {
    font-size: var(--font-size-sm);
    padding: 0.5rem 0.75rem;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

@media (max-width: 992px) {
    .right-sidebar {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .topbar-menu-btn {
        display: block;
    }

    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        height: auto;
        max-height: none;
        z-index: 1035;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1030;
    }

    .sidebar-overlay.active {
        display: block;
    }
    
    .content-area {
        height: calc(100vh - var(--topbar-height));
        height: calc(100dvh - var(--topbar-height));
    }
    
    .right-sidebar {
        display: none !important;
    }
    
    .bottom-sheet.visible {
        display: flex;
    }
    
    :root {
        --font-size-base: 13px;
        --font-size-sm: 12px;
    }
    
    /* Fuel switches 2 per row on mobile */
    .fuel-switches {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
    }
    
    .fuel-switch {
        padding: 0.3rem 0.4rem;
    }
    
    .fuel-switch .form-check-label {
        font-size: 10px;
    }

    /* Sidebar edge tab */
    .sidebar-tab {
        display: flex;
    }

    /* Buton vezi rezultate pe mobil - apare doar când are clasa .visible */
    .sidebar-close-wrap.visible {
        display: block !important;
    }
}

/* =====================================================
   SIDEBAR EDGE TAB (mobile pull indicator)
   ===================================================== */

.sidebar-tab:active {
    opacity: 0.8;
}

.sidebar-tab.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.opacity-75 {
    opacity: 0.75;
}

.opacity-50 {
    opacity: 0.5;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

#route-station-select-wrap .form-check .form-check-label {
    font-size: 0.8rem;
    position: relative;
}

/* URL param not-found toast (above input) */
.url-param-toast {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 4px);
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.3;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    z-index: 1050;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.url-param-toast.visible {
    opacity: 1;
    transform: translateY(0);
}
.url-param-toast::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    border: 5px solid transparent;
    border-top-color: #ffe69c;
}
.search-container { position: relative; }

/* Share action toast (center-top brief confirmation) */
.share-action-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #198754;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    z-index: 11000;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.share-action-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Route station-stop selection ===== */
.station-stop-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    cursor: pointer;
    padding: 4px;
}
.station-stop-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #f59e0b;
}
.station-list-item.is-stop {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}
.station-list-item.is-stop::after {
    content: 'oprire';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(245, 158, 11, 0.18);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.station-list-item { position: relative; }

/* Marker halo when selected as stop */
.leaflet-marker-icon.station-stop-selected {
    filter: drop-shadow(0 0 0 #f59e0b) drop-shadow(0 0 6px #f59e0b);
    outline: 3px solid #f59e0b;
    outline-offset: -2px;
    border-radius: 50%;
}
