:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #38bdf8;
    --text: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.03);
}

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

body {
    background: var(--bg-dark);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* TOP SECTION: MAP */
#map-section {
    position: relative;
    height: 45vh;
    z-index: 1;
}

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

.glass-header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    padding: 10px 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.header-main h1 { font-size: 1rem; font-weight: 800; }
.badge { font-size: 0.6rem; background: #ef4444; padding: 2px 6px; border-radius: 4px; font-weight: bold; }

.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: white; }

/* BOTTOM SECTION: RANKING */
#content-section {
    height: 55vh;
    background: var(--bg-dark);
    border-top: 1px solid var(--glass-border);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 0 auto 15px;
}

.content-header { margin-bottom: 20px; }
.content-header h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.content-header p { font-size: 0.8rem; opacity: 0.6; }

.station-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* STATION CARDS */
.station-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.station-card:hover { background: rgba(255,255,255,0.06); }
.station-card:active { transform: scale(0.98); }

.card-info { flex: 1; }
.card-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.card-price .price-val { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.card-price .unit { font-size: 0.7rem; opacity: 0.6; }

.card-meta { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
.card-subtext { font-size: 0.7rem; opacity: 0.5; }

.card-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dist-badge { background: rgba(56, 189, 248, 0.1); color: var(--accent); padding: 4px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: bold; }
.nav-round-btn {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
}

/* SETTINGS OVERLAY */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.settings-content { width: 90%; max-width: 350px; padding: 25px; }
.settings-content h3 { margin-bottom: 20px; }

.setting-item { margin-bottom: 20px; }
.setting-item label { display: block; font-size: 0.8rem; margin-bottom: 8px; opacity: 0.7; }
.setting-item select, .setting-item input[type="range"] { width: 100%; }

.btn-primary { width: 100%; background: var(--accent); color: #000; border: none; padding: 12px; border-radius: 12px; font-weight: bold; cursor: pointer; margin-bottom: 10px; }
.btn-secondary { width: 100%; background: rgba(255,255,255,0.1); color: #fff; border: none; padding: 10px; border-radius: 12px; cursor: pointer; }

/* Loader */
.loader-container {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px; }

/* MARKERS PRICE TAG */
.price-tag-icon {
    background: none;
    border: none;
}

.marker-pin {
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    white-space: nowrap;
}

.marker-pin::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #fff;
}

.marker-pin.cheapest {
    background: #22c55e;
    color: #fff;
    transform: scale(1.1);
    z-index: 1000;
}

/* CARDS PREMIUM & GLOW */
.border-glow {
    border-color: #22c55e !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.text-green { color: #22c55e !important; }

@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
