:root {
    --bg-color: #0D0E15;
    --accent-cyan: #00E5FF;
    --accent-orange: #FFAB00;
    --accent-red: #FF3D71;
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Design System */
    --radius-card: 16px;
    --radius-dialog: 24px;
    --radius-button: 10px;
    --radius-input: 10px;
    --radius-pill: 16px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

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

body {
    background-color: var(--bg-color);
    color: #FFFFFF;
    font-family: var(--font-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hlavička aplikace */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 14, 21, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.15);
    z-index: 1000;
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#app-header h1 {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    letter-spacing: -0.5px;
}

#app-header h1 span {
    color: var(--accent-cyan);
}

/* Map container */
#map {
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 1;
}

/* Cyber-tech Dark Mode - Invert OSM tiles */
.leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.7) contrast(1.3);
}

/* Spodní panel (bottom-sheet) */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 14, 21, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1000;
    padding: var(--spacing-lg);
    padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom, 24px));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.bottom-sheet.active {
    transform: translateY(0);
}

/* Styly pro SVG piny na mapě */
.cyber-marker {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
}

.cyber-marker svg {
    filter: drop-shadow(0 0 8px currentColor);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.cyber-marker:hover svg {
    transform: scale(1.25);
    filter: drop-shadow(0 0 15px currentColor);
}

/* Detail Sheet Content */
#detail-sheet {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.close-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

#detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-right: 40px;
    letter-spacing: -0.5px;
}

.station-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-md);
    border-radius: var(--radius-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.separator {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: var(--spacing-sm) 0;
}

.compressor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-button);
}

.grid-item .label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Specific Pill Styles */
.status-working { background: rgba(0, 229, 255, 0.1); color: var(--accent-cyan); border-color: rgba(0, 229, 255, 0.2); }
.status-broken { background: rgba(255, 61, 113, 0.1); color: var(--accent-red); border-color: rgba(255, 61, 113, 0.2); }
.status-unknown { background: rgba(255, 171, 0, 0.1); color: var(--accent-orange); border-color: rgba(255, 171, 0, 0.2); }

.hose-yes { background: rgba(0, 229, 255, 0.1); color: var(--accent-cyan); border-color: rgba(0, 229, 255, 0.2); }
.hose-borrow { background: rgba(255, 171, 0, 0.1); color: var(--accent-orange); border-color: rgba(255, 171, 0, 0.2); }
.hose-unknown { background: rgba(255, 255, 255, 0.05); color: #ccc; border-color: rgba(255, 255, 255, 0.1); }

.price-free { background: rgba(0, 229, 255, 0.1); color: var(--accent-cyan); border-color: rgba(0, 229, 255, 0.2); }
.price-paid { background: rgba(255, 61, 113, 0.1); color: var(--accent-red); border-color: rgba(255, 61, 113, 0.2); }

.last-updated {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

/* Navigation Buttons Grid */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.nav-grid.compact {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

/* Unified Buttons */
.nav-btn, .submit-btn, .report-btn, .cyber-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    outline: none;
}

/* Secondary Actions */
.nav-btn {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

.nav-grid.compact .nav-btn {
    padding: 10px;
    font-size: 0.85rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn.waze { border-color: rgba(51, 204, 255, 0.3); color: #33ccff; }
.nav-btn.waze:hover { background: rgba(51, 204, 255, 0.1); }

.nav-btn.google { border-color: rgba(66, 133, 244, 0.3); color: #4285F4; }
.nav-btn.google:hover { background: rgba(66, 133, 244, 0.1); }

.nav-btn.mapycz { border-color: rgba(204, 0, 0, 0.3); color: #ff4d4d; }
.nav-btn.mapycz:hover { background: rgba(204, 0, 0, 0.1); }

.nav-btn.apple { border-color: rgba(163, 170, 174, 0.3); color: #A3AAAE; }
.nav-btn.apple:hover { background: rgba(163, 170, 174, 0.1); }

/* Report Button */
.report-btn {
    background: rgba(255, 171, 0, 0.05);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 171, 0, 0.3);
    margin-top: var(--spacing-sm);
}

.report-btn:hover {
    background: rgba(255, 171, 0, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 171, 0, 0.2);
}

/* Primary Action Buttons */
.submit-btn {
    background: var(--accent-cyan);
    color: var(--bg-color);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
    margin-top: var(--spacing-sm);
}

.submit-btn:hover {
    background: #4dffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
}

/* FAB Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    color: var(--bg-color);
    border: none;
    font-size: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 900;
}

.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.6);
}

.fab.hidden {
    transform: scale(0);
    pointer-events: none;
}

/* Cancel Add Mode Button */
#cancel-add-mode {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255, 61, 113, 0.4);
    z-index: 1000;
}

#cancel-add-mode:hover {
    background: #ff5c8a;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 61, 113, 0.6);
}

#cancel-add-mode.hidden {
    display: none;
}

/* Dialogs */
.cyber-dialog {
    margin: auto;
    background: rgba(13, 14, 21, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.1);
    border-radius: var(--radius-dialog);
    color: #fff;
    padding: var(--spacing-xl);
    width: 90%;
    max-width: 440px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cyber-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.dialog-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.dialog-content h3 {
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.close-dialog-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.close-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
}

/* Modern Inputs & Selects */
.form-group input[type="text"],
.form-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 14px;
    border-radius: var(--radius-input);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input[type="text"]::placeholder {
    color: #64748b;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1);
}

.form-group option {
    background: var(--bg-color);
    color: #fff;
}

/* Custom Checkbox & Radio */
.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--radius-input);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.checkbox-group label:hover,
.radio-group label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.coords-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-input);
    text-align: center;
}

/* Locate Button */
#locate-btn {
    position: fixed;
    bottom: 100px;
    left: 15px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-button);
    background: rgba(13, 14, 21, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 900;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#locate-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* User Location Marker */
.user-location-marker {
    width: 18px;
    height: 18px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 15px var(--accent-cyan);
    animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 229, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    }
}

/* Altcha specific overrides */
altcha-widget {
    --altcha-color-base: #fff;
    --altcha-color-bg: rgba(0, 0, 0, 0.2);
    --altcha-color-border: rgba(255, 255, 255, 0.1);
    --altcha-color-primary: var(--accent-cyan);
    --altcha-color-error: var(--accent-red);
    --altcha-border-radius: var(--radius-input);
    width: 100%;
}

/* Desktop view pro boční panel */
@media (min-width: 768px) {
    .bottom-sheet {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        width: 100%;
        max-width: 420px;
        height: 100vh;
        border-top: none;
        border-radius: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(100%);
        padding-top: 100px; /* prostor pod hlavičkou */
        padding-bottom: var(--spacing-lg);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }

    .bottom-sheet.active {
        transform: translateX(0);
    }
}
