/* ========================================
   Mapa investic Liberce - SLK Design
   Vizuální styl podle knapdominik.cz/project/slk2
   ======================================== */

:root {
    /* Barvy z loga Lukáš Hájek */
    --slk-pink: #e91e8c;
    --slk-pink-light: #ff6b9d;
    --slk-pink-dark: #c4167a;
    --slk-pink-bg: #fdf2f8;
    --slk-pink-10: rgba(233, 30, 140, 0.1);
    --slk-pink-20: rgba(233, 30, 140, 0.2);
    --slk-purple: #3d2352;
    --slk-purple-light: #5a3875;
    
    /* Neutrální barvy */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    
    /* Kategorie */
    --cat-skolstvi: #e91e8c;
    --cat-doprava: #f59e0b;
    --cat-sport: #22c55e;
    --cat-kultura: #a855f7;
    --cat-sidliste: #ef4444;
    --cat-zelen: #10b981;
    --cat-voda: #3b82f6;
    --cat-energie: #fbbf24;
    --cat-sluzby: #6366f1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--gray-100);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Layout - Fullscreen mapa
   ======================================== */

.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================
   Horní panel
   ======================================== */

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--slk-pink);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.logo-img {
    height: 85px;
    width: auto;
    object-fit: contain;
    margin-top: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.logo-text {
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--slk-pink);
    padding-left: 16px;
}

.logo-headline {
    font-size: 17px;
    font-weight: 700;
    color: var(--slk-purple);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.top-stats {
    display: flex;
    gap: 20px;
}

.top-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.top-stat-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--slk-purple);
}

.top-stat-label {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Tlačítko filtrů
   ======================================== */

/* filter-toggle nyní nahrazeno .control-btn v .map-controls */

/* ========================================
   Panel filtrů - Overlay
   ======================================== */

.filter-panel {
    position: absolute;
    top: 66px;
    left: 0;
    width: 320px;
    max-height: calc(100vh - 66px);
    background: var(--white);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.filter-panel.active {
    transform: translateX(0);
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--slk-pink-bg);
}

.filter-panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--slk-pink);
}

.filter-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--white);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s;
}

.filter-panel-close:hover {
    background: var(--slk-pink);
    color: var(--white);
}

.filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.filter-group-wrapper {
    margin-bottom: 20px;
}

.filter-group-wrapper:last-child {
    margin-bottom: 0;
}

.filter-group-wrapper h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

/* Search box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 36px 12px 40px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--slk-pink);
    box-shadow: 0 0 0 3px var(--slk-pink-10);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--gray-200);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    color: var(--gray-600);
}

.search-box input:not(:placeholder-shown) + .search-clear {
    opacity: 1;
}

.search-clear:hover {
    background: var(--slk-pink);
    color: var(--white);
}

/* Filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.filter-chip:hover {
    border-color: var(--slk-pink-light);
    background: var(--slk-pink-bg);
}

.filter-chip.active {
    background: var(--slk-pink);
    border-color: var(--slk-pink);
    color: var(--white);
}

.filter-chip .chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Select */
.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--slk-pink);
}

/* Year chips - kompaktní tlačítka pro roky */
.year-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.year-chips .filter-chip {
    padding: 6px 10px;
    min-width: auto;
    font-size: 11px;
    font-weight: 600;
}

/* Budget row - jeden řádek */
.budget-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-row input[type="number"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    text-align: right;
    transition: all 0.2s;
}

.budget-row input[type="number"]:focus {
    outline: none;
    border-color: var(--slk-pink);
    box-shadow: 0 0 0 3px var(--slk-pink-10);
}

.budget-row input[type="number"]::placeholder {
    color: var(--gray-400);
    text-align: left;
}

/* Hide number input spinners */
.budget-row input[type="number"]::-webkit-outer-spin-button,
.budget-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.budget-row input[type="number"] {
    -moz-appearance: textfield;
}

.budget-separator {
    color: var(--gray-400);
    font-weight: 500;
}

.budget-unit {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Footer */
.filter-panel-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--slk-pink);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--slk-pink-dark);
}

.btn-outline {
    background: var(--white);
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    border-color: var(--slk-pink);
    color: var(--slk-pink);
}

/* ========================================
   Legenda
   ======================================== */

.map-legend {
    position: absolute;
    bottom: 24px;
    left: 12px;
    z-index: 1000;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 140px;
}

.legend-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.legend-toggle svg {
    transition: transform 0.2s;
}

.map-legend.collapsed .legend-toggle svg {
    transform: rotate(-90deg);
}

.legend-content {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-legend.collapsed .legend-content {
    display: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--gray-600);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: var(--gray-500);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--slk-pink);
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--slk-pink-bg);
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
    padding-right: 40px;
}

.modal-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-category {
    background: var(--slk-pink-bg);
    color: var(--slk-pink);
}

.badge-status {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-status.planovane { background: #fef3c7; color: #92400e; }
.badge-status.probihajici { background: #dbeafe; color: #1e40af; }
.badge-status.dokoncene { background: #dcfce7; color: #166534; }

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slk-pink);
    margin-bottom: 8px;
}

.modal-section p {
    color: var(--gray-700);
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-card {
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--slk-pink);
}

.info-card .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.info-card .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}

.progress-section {
    margin-top: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--slk-pink), var(--slk-pink-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.modal-actions .btn {
    flex: 1;
}

/* Branding v detailu */
.modal-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-200);
    flex-wrap: wrap;
}

.modal-logo {
    height: 52px;
    width: auto;
}

.modal-social {
    display: flex;
    gap: 8px;
}

.modal-social-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    color: var(--gray-600);
    transition: all 0.2s;
}

.modal-social-btn:hover {
    background: var(--slk-pink);
    color: white;
    transform: scale(1.1);
}

.modal-slogan {
    font-size: 15px;
    font-weight: 700;
    color: var(--slk-purple);
    padding-left: 16px;
    border-left: 3px solid var(--slk-pink);
    line-height: 1.3;
}

/* ========================================
   Leaflet Custom - Markery SLK
   ======================================== */

.custom-marker {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    border: 3px solid var(--white);
    transition: transform 0.2s;
}

.custom-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

.custom-marker:hover {
    transform: rotate(-45deg) scale(1.1);
}

.leaflet-marker-icon {
    background: transparent !important;
    border: none !important;
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 240px;
}

.leaflet-popup-tip {
    background: var(--white);
}

.popup-content {
    padding: 16px;
}

.popup-content h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.popup-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.popup-info {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.popup-info p {
    margin: 4px 0;
}

.popup-budget {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--slk-pink-bg);
    border-radius: var(--radius-sm);
}

.popup-budget .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--slk-pink);
}

.popup-budget .percent {
    font-size: 12px;
    color: var(--gray-500);
}

.popup-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--slk-pink);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-btn:hover {
    background: var(--slk-pink-dark);
}


/* ========================================
   Responsive - Tablet
   ======================================== */

@media (max-width: 768px) {
    .top-bar {
        height: 54px;
        padding: 0 12px;
        padding-top: env(safe-area-inset-top);
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo-img {
        height: 36px;
    }
    
    .logo-text {
        padding-left: 10px;
        border-left-width: 2px;
    }
    
    .logo-headline {
        font-size: 13px;
    }
    
    .top-stats {
        gap: 12px;
    }
    
    .top-stat-value {
        font-size: 15px;
    }
    
    .top-stat-label {
        font-size: 9px;
    }
    
    .modal-footer-brand {
        gap: 12px;
        padding-top: 16px;
    }
    
    .modal-logo {
        height: 44px;
    }
    
    .modal-slogan {
        font-size: 13px;
        padding-left: 12px;
    }
    
    .filter-toggle {
        top: calc(58px + env(safe-area-inset-top));
        padding: 10px 14px;
    }
    
    .filter-toggle span {
        display: none;
    }
    
    .filter-panel {
        width: 100%;
        top: calc(50px + env(safe-area-inset-top));
        max-height: calc(100vh - 50px - env(safe-area-inset-top));
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }
    
    .filter-panel-body {
        padding: 12px 16px;
    }
    
    .filter-group-wrapper {
        margin-bottom: 16px;
    }
    
    .filter-chip {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .year-chips .filter-chip {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .map-legend {
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 8px;
    }
    
    /* Modal - bottom sheet na mobilu */
    .modal {
        align-items: flex-end;
        padding: 0;
    }
    
    .modal-content {
        max-height: 85vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin-top: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .modal-body {
        padding: 20px 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .info-card {
        padding: 12px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Leaflet popup - větší na mobilu */
    .leaflet-popup-content {
        min-width: 280px;
        max-width: calc(100vw - 60px);
    }
    
    .popup-content {
        padding: 14px;
    }
    
    .popup-btn {
        padding: 14px;
        font-size: 14px;
    }
    
    /* Zoom controls */
    .leaflet-control-zoom {
        margin-right: 8px !important;
        margin-top: calc(70px + env(safe-area-inset-top)) !important;
    }
    
    .leaflet-control-zoom a {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px !important;
    }
}

/* ========================================
   Responsive - Malé mobily
   ======================================== */

@media (max-width: 480px) {
    .top-bar {
        height: 50px;
        padding: 0 10px;
    }
    
    .logo-img {
        height: 32px;
    }
    
    /* Na malých mobilech skrýt headline v headeru */
    .logo-text {
        display: none;
    }
    
    .top-stats {
        gap: 8px;
    }
    
    .top-stat-value {
        font-size: 14px;
    }
    
    /* Modal branding - vertikální na mobilu */
    .modal-footer-brand {
        flex-direction: column;
        gap: 10px;
        padding-top: 16px;
    }
    
    .modal-logo {
        height: 48px;
    }
    
    .modal-slogan {
        border-left: none;
        padding-left: 0;
        font-size: 14px;
        text-align: center;
    }
    
    .filter-toggle {
        top: calc(54px + env(safe-area-inset-top));
        padding: 8px 12px;
    }
    
    .filter-panel {
        top: calc(46px + env(safe-area-inset-top));
    }
    
    .filter-chip {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .budget-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .budget-row input[type="number"] {
        flex: 1 1 40%;
        padding: 10px;
    }
    
    .map-legend {
        min-width: 120px;
    }
    
    .legend-item {
        font-size: 10px;
    }
}

/* ========================================
   Iframe mode - extra kompaktní
   ======================================== */

@media (max-height: 500px) {
    .top-bar {
        height: 40px;
    }
    
    .logo-img {
        height: 26px;
    }
    
    .top-stat-value {
        font-size: 14px;
    }
    
    .filter-toggle {
        top: 48px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .filter-panel {
        top: 40px;
        max-height: calc(100vh - 40px);
    }
    
    .map-legend {
        bottom: 8px;
    }
    
    .leaflet-control-zoom {
        margin-top: 50px !important;
    }
    
    .leaflet-control-zoom a {
        width: 28px !important;
        height: 28px !important;
        line-height: 28px !important;
    }
}

/* ========================================
   Touch optimalizace
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Větší touch targets */
    .filter-chip {
        min-height: 44px;
    }
    
    .btn {
        min-height: 48px;
    }
    
    .popup-btn {
        min-height: 48px;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
    }
    
    .filter-panel-close {
        width: 40px;
        height: 40px;
    }
    
    .legend-toggle {
        min-height: 44px;
    }
    
    /* Odstranit hover efekty na touch */
    .filter-chip:hover {
        border-color: transparent;
        background: var(--gray-100);
    }
    
    .filter-chip.active:hover {
        background: var(--slk-pink);
        border-color: var(--slk-pink);
    }
    
    .filter-toggle:hover {
        background: var(--white);
        color: var(--gray-700);
    }
}

/* ========================================
   Landscape mobil
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .filter-panel {
        width: 50%;
        max-width: 320px;
        height: calc(100vh - 40px);
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    }
    
    .modal-content {
        max-height: 100vh;
        max-width: 90%;
        border-radius: var(--radius-xl);
        margin: auto;
    }
}

/* ========================================
   Podpora tmavého režimu (volitelně)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Zatím prázdné - lze přidat dark mode */
}

/* ========================================
   Leaflet overrides
   ======================================== */

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    color: var(--gray-700) !important;
    border-bottom: 1px solid var(--gray-200) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: var(--slk-pink) !important;
    color: var(--white) !important;
}

.leaflet-control-attribution {
    background: rgba(255,255,255,0.8) !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    border-radius: var(--radius-sm) 0 0 0 !important;
}

/* ========================================
   Ovládací tlačítka v mapě
   ======================================== */

.map-controls {
    position: absolute;
    top: 90px;
    left: 12px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s, transform 0.3s;
}

/* Skrýt ovládací tlačítka když je filtr panel otevřený */
body.filter-open .map-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--slk-pink);
    color: var(--white);
}

.control-btn svg {
    flex-shrink: 0;
}

/* ========================================
   Panel statistik
   ======================================== */

.stats-panel {
    position: absolute;
    top: 66px;
    right: 0;
    width: 320px;
    max-height: calc(100vh - 66px);
    background: var(--white);
    z-index: 998;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.stats-panel.active {
    transform: translateX(0);
}

.stats-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--slk-pink-bg);
}

.stats-panel-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--slk-pink);
}

.stats-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--white);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-500);
}

.stats-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.district-stat-item {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.district-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.district-bar-wrap {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.district-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--slk-pink), var(--slk-pink-light));
    border-radius: 4px;
}

.district-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--slk-purple);
    text-align: right;
}

/* ========================================
   User location marker
   ======================================== */

.user-location-marker {
    background: transparent !important;
    border: none !important;
}

.user-dot {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Popup pro uživatelskou polohu */
.user-popup {
    text-align: center;
    padding: 4px 8px;
}

.user-popup strong {
    color: var(--slk-pink);
    font-size: 14px;
}

.user-popup small {
    color: var(--gray-500);
    font-size: 11px;
}

/* Spinner animace pro tlačítka */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.marker-nearby {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: rotate(-45deg) scale(1); }
    50% { transform: rotate(-45deg) scale(1.2); }
}

/* ========================================
   Share modal
   ======================================== */

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    position: relative;
}

.share-modal-content h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-btn {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.9; }

.share-fb { background: #1877f2; color: white; }
.share-tw { background: #1da1f2; color: white; }
.share-copy { background: var(--gray-200); color: var(--gray-700); }

.share-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

/* ========================================
   Embed info
   ======================================== */

.embed-info {
    position: absolute;
    bottom: 24px;
    right: 12px;
    z-index: 1000;
}

.embed-toggle {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-family: monospace;
    font-size: 12px;
    color: var(--gray-600);
}

.embed-toggle:hover {
    background: var(--slk-pink);
    color: white;
}

.embed-content {
    display: none;
    position: absolute;
    bottom: 48px;
    right: 0;
    width: 300px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-xl);
}

.embed-info.expanded .embed-content {
    display: block;
}

.embed-content h4 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--gray-700);
}

.embed-content textarea {
    width: 100%;
    height: 60px;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 11px;
    resize: none;
}

/* ========================================
   Spinner
   ======================================== */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--slk-pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Responsive pro nové prvky
   ======================================== */

@media (max-width: 768px) {
    .map-controls {
        top: 62px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .control-btn span {
        display: none;
    }
    
    .control-btn {
        padding: 10px;
    }
    
    .stats-panel {
        width: 100%;
        top: 54px;
        max-height: calc(100vh - 54px);
        border-radius: 0;
    }
    
    .embed-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .map-controls {
        top: 56px;
        left: 8px;
        gap: 6px;
    }
    
    .control-btn {
        padding: 8px;
        font-size: 14px;
    }
}


/* ========================================
   GPS Editor
   ======================================== */

.gps-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--gray-100);
    padding: 10px 14px;
    border-radius: var(--radius-md);
}

.gps-coords {
    font-family: monospace;
    font-size: 13px;
    color: var(--gray-600);
}

.btn-edit-gps {
    background: transparent;
    border: 1px solid var(--gray-300);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s;
}

.btn-edit-gps:hover {
    background: var(--slk-pink);
    border-color: var(--slk-pink);
    color: white;
}

.gps-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gps-editor-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.gps-editor-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-500);
}

.gps-editor-close:hover {
    background: var(--gray-200);
}

.gps-editor-content h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-right: 40px;
    color: var(--gray-800);
}

.gps-editor-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gps-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gps-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.gps-input-group input {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: monospace;
}

.gps-input-group input:focus {
    outline: none;
    border-color: var(--slk-pink);
    box-shadow: 0 0 0 3px var(--slk-pink-10);
}

.gps-editor-help {
    background: var(--slk-pink-bg);
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--gray-600);
}

.gps-editor-help p {
    margin-bottom: 8px;
}

.gps-editor-help ol {
    margin: 0;
    padding-left: 20px;
}

.gps-editor-help li {
    margin-bottom: 4px;
}

.gps-editor-help a {
    color: var(--slk-pink);
    text-decoration: none;
}

.gps-editor-help a:hover {
    text-decoration: underline;
}

.gps-editor-preview {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.gps-editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .gps-editor-content {
        padding: 20px;
        margin: 10px;
    }
    
    .gps-editor-actions {
        flex-direction: column;
    }
    
    .gps-editor-actions .btn {
        width: 100%;
    }
}

/* ========================================
   Photo Manager v detailu
   ======================================== */

.photo-manager {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-100);
    padding: 10px 14px;
    border-radius: var(--radius-md);
}

.photo-manager .photo-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.no-photo {
    width: 60px;
    height: 60px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--gray-500);
    text-align: center;
}

.photo-preview-large {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.photo-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-editor-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   Fotky v detailu
   ======================================== */

.modal-photo {
    margin: -24px -24px 20px -24px;
    position: relative;
}

.modal-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.photo-source {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
}

/* ========================================
   Call to action
   ======================================== */

.cta-banner {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--slk-pink), var(--slk-pink-light));
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    max-width: calc(100% - 24px);
}

.cta-banner.hidden {
    display: none;
}

.cta-text {
    font-size: 14px;
    font-weight: 600;
}

.cta-social {
    display: flex;
    gap: 8px;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.social-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.social-fb { background: #1877f2; }
.social-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-yt { background: #ff0000; }

.cta-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 4px;
}

.cta-close:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .cta-banner {
        bottom: 20px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 16px 20px;
    }
    
    .cta-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .cta-social {
        gap: 12px;
    }
    
    .social-btn {
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   Embedded mód (pro iframe)
   ======================================== */

body.embedded .top-bar .logo {
    display: none;
}

body.embedded .top-bar {
    justify-content: flex-end;
}

body.embedded .embed-info {
    display: none;
}

body.embedded .modal-footer-brand .modal-logo {
    display: none;
}

/* CTA banner - zobrazit ve fullscreen a embed, skrýt na LP */
.cta-embed-only {
    display: flex;
}

body.hide-cta .cta-embed-only {
    display: none;
}
