/* Tab Navigation Styling */
.tab-nav {
    margin-bottom: 0.5rem;
}
.tab-btn {
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--deep-indigo);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.tab-btn.active {
    border-bottom: 2px solid var(--deep-indigo);
    color: var(--deep-indigo);
}
/* Directions List Styling */
.directions-list {
    margin: 1rem 0 0 0;
    padding-left: 1.5rem;
    font-size: 0.98rem;
    color: var(--text-dark);
    line-height: 1.5;
}
.directions-list li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}
/* FuelMap - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    html, body {
        height: 100%;
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .container {
        height: 100%;
        flex: 1;
        display: flex;
    }

    #map {
        height: 100%;
        flex: 1;
        min-height: 300px;
    }
    --deep-indigo: #171d6d;
    --electric-indigo: #6052fb;
    --alt-green: #00ff7f;
    --soft-pink: #fbc1d4;
    --warm-grey: #f7f2eb;
    --motia-blue: #171d6d;
    --error-red: #ff0000;
    --error-bg: rgba(255, 0, 0, 0.05);
    /* Aliases for easier migration */
    --primary-color: var(--deep-indigo);
    --secondary-color: var(--electric-indigo);
    --accent-color: var(--alt-green);
    --success-color: var(--alt-green);
    --light-bg: var(--warm-grey);
    --white: #ffffff;
    --text-dark: var(--deep-indigo);
    --text-light: var(--electric-indigo);
    --border-color: var(--soft-pink);
    --shadow: 0 2px 10px rgba(23, 29, 109, 0.08);
}

html, body {
    height: 100%;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: var(--light-bg);
}

body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 0.9rem;
    color: var(--soft-pink);
}

/* Main Container */
.container {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
}

/* Sidebar - Search and Results */
.sidebar {
    width: 350px;
    height: 100%;
    flex-shrink: 0;
    overflow-y: auto;
    box-shadow: inset -2px 0 5px rgba(0, 0, 0, 0.05);
}

.search-box {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-box h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input-group input {
    flex: 1;
}

.search-input-group button {
    flex: 0 0 auto;
}

input[type="text"],
input[type="number"] {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.search-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-options input[type="radio"],
.search-options input[type="checkbox"] {
    cursor: pointer;
}

/* Buttons */
button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    font-family: inherit;
}

button:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: var(--text-light);
}

button.secondary:hover {
    background: var(--text-dark);
}

/* Results List */
.results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
    flex-shrink: 0;
}

.results-header h3 {
    font-size: 0.95rem;
    color: var(--text-light);
}

.station-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.station-item:hover {
    background: var(--light-bg);
}

.station-item.active {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.5rem - 4px);
}

.station-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.station-address {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.station-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.station-distance {
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.station-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
}

.price-label {
    color: var(--text-light);
}

.price-value {
    font-weight: 600;
    color: var(--success-color);
}

.price-value.unavailable {
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Map */
#map {
    flex: 1;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.leaflet-container {
    font-family: inherit;
}

.station-popup {
    min-width: 250px;
}

.station-popup-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.station-popup-address {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.station-popup-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.station-popup-distance {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Custom Map Marker */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: 3px solid var(--white);
    border-radius: 50%;
    font-weight: bold;
    color: var(--white);
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.custom-marker.active {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    font-size: 24px;
}

/* Footer */
footer {
    background: var(--light-bg);
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 40vh;
    }
    
    #map {
        min-height: 300px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .search-box {
        padding: 1rem;
    }
    
    .station-item {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    header p {
        display: none;
    }
    
    .sidebar {
        max-height: 35vh;
    }
    
    .search-box {
        padding: 0.75rem;
    }
    
    .search-options {
        grid-template-columns: 1fr;
    }
    
    button {
        width: 100%;
        padding: 0.6rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
