/**
 * Enhanced Location Finder - Stylesheet
 * Version: 1.0.0
 */

/* Container */
.elf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Suchbereich */
.elf-search-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.elf-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.elf-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.elf-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.elf-location-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.elf-location-btn:hover {
    background: #218838;
}

.elf-location-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.elf-radius-select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

/* Filter */
.elf-filters {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.elf-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.elf-filter-label {
    font-weight: 500;
    color: #495057;
    margin-right: 10px;
}

.elf-filter-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.elf-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.elf-filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007cba;
}

/* Hauptinhalt */
.elf-main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    min-height: 500px;
}

/* Karte */
.elf-map-container {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.elf-map {
    width: 100%;
    height: 500px;
    border: none;
}

.elf-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.elf-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: elf-spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Ergebnisliste */
.elf-results-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.elf-results-header {
    background: #007cba;
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
}

.elf-results-list {
    max-height: 500px;
    overflow-y: auto;
}

.elf-result-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.elf-result-item:hover {
    background: #f8f9fa;
}

.elf-result-item.active {
    background: #e3f2fd;
    border-left: 4px solid #007cba;
}

.elf-result-name {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.elf-result-address {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
}

.elf-result-distance {
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.elf-result-type {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.elf-result-type.supermarket {
    background: #d4edda;
    color: #155724;
}

.elf-result-type.recycling_center {
    background: #cce5ff;
    color: #004085;
}

.elf-result-status {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.elf-result-status.open {
    color: #28a745;
}

.elf-result-status.closed {
    color: #dc3545;
}

.elf-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.elf-action-btn {
    padding: 6px 12px;
    border: 1px solid #007cba;
    background: white;
    color: #007cba;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.elf-action-btn:hover {
    background: #007cba;
    color: white;
    text-decoration: none;
}

.elf-action-btn.primary {
    background: #007cba;
    color: white;
}

.elf-action-btn.primary:hover {
    background: #005a87;
}

/* Detailansicht */
.elf-detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.elf-detail-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.elf-detail-header {
    background: #007cba;
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.elf-detail-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.elf-detail-body {
    padding: 25px;
}

.elf-detail-section {
    margin-bottom: 25px;
}

.elf-detail-section h4 {
    color: #212529;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.elf-opening-hours {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.elf-opening-day {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.elf-opening-day.today {
    font-weight: 600;
    color: #007cba;
}

.elf-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.elf-service-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .elf-container {
        padding: 15px;
    }
    
    .elf-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .elf-search-input {
        min-width: auto;
    }
    
    .elf-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .elf-map {
        height: 300px;
    }
    
    .elf-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .elf-opening-hours {
        grid-template-columns: 1fr;
    }
    
    .elf-detail-popup {
        padding: 10px;
    }
    
    .elf-detail-content {
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .elf-search-section {
        padding: 20px;
    }
    
    .elf-result-actions {
        flex-direction: column;
    }
    
    .elf-action-btn {
        text-align: center;
    }
}

/* Accessibility */
.elf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.elf-search-input:focus,
.elf-radius-select:focus,
.elf-filter-select:focus,
.elf-location-btn:focus,
.elf-action-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .elf-container {
        border: 2px solid;
    }
    
    .elf-result-item:hover {
        background: highlight;
        color: highlighttext;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .elf-loading-spinner {
        animation: none;
    }
    
    .elf-search-input,
    .elf-location-btn,
    .elf-result-item,
    .elf-action-btn {
        transition: none;
    }
}
