/* Mapa Boxů - Alza-inspired Dark Design */

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

:root {
    /* Alza-inspired Dark Theme */
    --alza-orange: #ff6600;
    --alza-orange-light: #ff8533;
    --alza-orange-dark: #e55a00;

    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #333333;
    --bg-sidebar: #242424;
    --bg-card: #2f2f2f;
    --bg-overlay: rgba(26, 26, 26, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --text-disabled: #666666;

    --border-primary: #444444;
    --border-secondary: #555555;
    --border-active: var(--alza-orange);

    --accent-success: #10b981;
    --accent-info: #3b82f6;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-purple: #8b5cf6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.5);

    --header-height: 70px;
    --footer-height: 50px;
    --sidebar-width: 400px;

    --transition: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Alza Style */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(255, 102, 0, 0.3));
}

.logo-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-stats {
    text-align: right;
}

.stat-primary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 2px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--alza-orange);
    line-height: 1;
}

.stat-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-coverage {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Layout */
.main {
    height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    overflow: hidden;
}

/* Sidebar - Alza Style */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: none;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.hamburger-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Search Section */
.search-section {
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--alza-orange);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
    z-index: 2;
}

.search-clear:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-clear svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-primary);
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-item:hover {
    background: var(--bg-tertiary);
    color: var(--alza-orange);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Partners Section */
.partners-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.quick-filter {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    flex: 1;
    text-align: center;
}

.quick-filter.active {
    background: var(--alza-orange);
    color: white;
}

.quick-filter:hover:not(.active) {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Filter List */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.filter-item:hover {
    background: var(--bg-card);
    border-color: var(--border-secondary);
}

.filter-item.active {
    border-color: var(--alza-orange);
    background: var(--bg-card);
}

.filter-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.filter-item.active .filter-checkbox {
    border-color: var(--alza-orange);
    background: var(--alza-orange);
}

.filter-checkbox.alzabox {
    border-color: var(--alza-orange);
}

.filter-item.active .filter-checkbox.alzabox {
    background: var(--alza-orange);
}

.filter-checkbox.zbox {
    border-color: var(--accent-success);
}

.filter-item.active .filter-checkbox.zbox {
    background: var(--accent-success);
}

.filter-checkbox.gls {
    border-color: var(--accent-info);
}

.filter-item.active .filter-checkbox.gls {
    background: var(--accent-info);
}

.filter-checkbox.dpd {
    border-color: var(--accent-danger);
}

.filter-item.active .filter-checkbox.dpd {
    background: var(--accent-danger);
}

.filter-checkbox.balik {
    border-color: var(--accent-purple);
}

.filter-item.active .filter-checkbox.balik {
    background: var(--accent-purple);
}

.check-icon {
    width: 14px;
    height: 14px;
    fill: white;
    opacity: 0;
    transition: var(--transition-fast);
}

.filter-item.active .check-icon {
    opacity: 1;
}

.filter-content {
    flex: 1;
    min-width: 0;
}

.filter-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.filter-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
}

.filter-description {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Distance Section */
.distance-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.distance-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition-fast);
}

.distance-label:hover .distance-text {
    color: var(--text-primary);
}

.distance-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-secondary);
    border-radius: 50%;
    position: relative;
    transition: var(--transition-fast);
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--alza-orange);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: var(--transition-fast);
}

.distance-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--alza-orange);
}

.distance-label input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.distance-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

/* Action Section */
.locate-button {
    background: linear-gradient(135deg, var(--alza-orange), var(--alza-orange-dark));
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.locate-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--alza-orange-light), var(--alza-orange));
}

.locate-button:active {
    transform: translateY(0);
}

.locate-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

.map-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    z-index: 1000;
}

.status-text strong {
    color: var(--alza-orange);
    font-weight: 800;
}

/* Loading */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    margin-bottom: 20px;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 102, 0, 0.2);
    border-top: 4px solid var(--alza-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    height: var(--footer-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 13px;
}

.footer-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-attribution {
    color: var(--text-muted);
    font-weight: 400;
}

/* Leaflet Customizations - Dark Theme */
.leaflet-control-zoom {
    border: 1px solid var(--border-primary) !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    border: none !important;
    color: var(--text-primary) !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    transition: var(--transition-fast) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--alza-orange) !important;
    color: white !important;
}

/* Marker Clusters - Alza Style */
.marker-cluster-small {
    background-color: rgba(255, 102, 0, 0.6) !important;
    border: 2px solid rgba(255, 102, 0, 0.8) !important;
}
.marker-cluster-small div {
    background-color: rgba(255, 102, 0, 0.8) !important;
    color: white !important;
    font-weight: 700 !important;
}

.marker-cluster-medium {
    background-color: rgba(16, 185, 129, 0.6) !important;
    border: 2px solid rgba(16, 185, 129, 0.8) !important;
}
.marker-cluster-medium div {
    background-color: rgba(16, 185, 129, 0.8) !important;
    color: white !important;
    font-weight: 700 !important;
}

.marker-cluster-large {
    background-color: rgba(239, 68, 68, 0.6) !important;
    border: 2px solid rgba(239, 68, 68, 0.8) !important;
}
.marker-cluster-large div {
    background-color: rgba(239, 68, 68, 0.8) !important;
    color: white !important;
    font-weight: 700 !important;
}

/* Popup Customizations */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-xl) !important;
    border: 1px solid var(--border-primary) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 18px !important;
    padding: 8px !important;
    width: auto !important;
    height: auto !important;
}

.leaflet-popup-close-button:hover {
    color: var(--alza-orange) !important;
    background: none !important;
}

.popup-title {
    font-weight: 700;
    color: var(--alza-orange);
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.3;
}

.popup-address {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.popup-hours, .popup-phone {
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-weight: 500;
}

.popup-services {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.service-tag {
    background: var(--alza-orange);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        order: 1;
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
    }

    .map-container {
        flex: 1;
        order: 2;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar.collapsed .sidebar-content {
        display: none;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-text {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 80px;
        --sidebar-width: 100%;
    }

    .container {
        padding: 0 16px;
    }

    .logo-title {
        font-size: 20px;
    }

    .logo-subtitle {
        font-size: 11px;
    }

    .header-stats {
        text-align: center;
        width: 100%;
    }

    .sidebar-content {
        padding: 16px;
        gap: 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .map-status {
        bottom: 16px;
        left: 16px;
        right: 16px;
        text-align: center;
    }
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track,
.search-suggestions::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb,
.search-suggestions::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--alza-orange);
}

/* Dark Map Filter */
.leaflet-tile-pane {
    filter: brightness(0.7) contrast(1.1) saturate(0.8);
}
