:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glass Header */
.glass-header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.header-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    outline: none;
    width: 250px;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse-amber 2s infinite;
}

.status-indicator.api .pulse {
    background: var(--accent-green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

.status-indicator.db .pulse {
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: pulse-blue 2s infinite;
}

.status-indicator.error .pulse {
    background: var(--accent-red);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 2s infinite;
}

/* Main Content Area */
main {
    min-height: 50vh;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

/* Error Container */
.error-container {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
}

.error-container h2 {
    color: var(--accent-red);
    margin-bottom: 0.5rem;
}

.error-container p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.station-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

.station-header h3 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.25rem;
}

.station-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.station-brand {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.prices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-amount {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-up {
    color: var(--accent-red);
    font-size: 0.75rem;
    font-weight: 600;
}

.price-down {
    color: var(--accent-green);
    font-size: 0.75rem;
    font-weight: 600;
}

.fuel-type {
    font-weight: 500;
    color: var(--text-main);
}

.fuel-price {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-green);
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 3rem;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-amber {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(30, 41, 59, 0.8);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--accent-red);
}

.modal-body {
    flex-grow: 1;
    background: #e2e8f0;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .glass-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .controls {
        width: 100%;
        align-items: stretch;
    }
    
    .search-bar input {
        flex-grow: 1;
        width: auto;
    }
}

/* Navigation */
.header-nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
}

.header-nav a:hover, .header-nav a.active {
    color: var(--text-main);
    border-bottom-color: var(--primary);
}

/* Charts */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.chart-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.chart-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}
