/* Store Locator CSS mit Progressive Loading */

/* === STATISTIK DASHBOARD === */
.store-stats-dashboard {
    margin: 20px 0;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: bold;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-weight: 600;
}

.stat-total h3 { color: #0073aa; }
.stat-approved h3 { color: #28a745; }
.stat-pending h3 { color: #ffc107; }
.stat-standplatz h3 { color: #6f42c1; }

.pending-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.pending-notice p {
    margin: 0;
    color: #856404;
}

/* === STATUS ANZEIGEN === */
.status-yes { color: green; font-weight: bold; }
.status-no { color: #999; }
.status-unknown { color: #999; }
.status-pending { color: orange; font-weight: bold; }
.status-approved { color: green; font-weight: bold; }

.no-stores {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* === EINSTELLUNGEN === */
.settings-stats {
    margin: 20px 0;
}

.pin-colors-table .color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    margin-left: 10px;
    vertical-align: middle;
}

.shortcode-info {
    max-width: none;
}

.shortcode-info ul {
    list-style-type: disc;
    margin-left: 20px;
}

.shortcode-info ul li {
    margin-bottom: 5px;
}

.privacy-notice {
    margin: 15px 0;
}

.css-classes ul {
    list-style-type: disc;
    margin-left: 20px;
}

.css-classes ul li {
    margin-bottom: 5px;
}

/* === FRONTEND KARTE === */
#store-locator-container {
    max-width: 100%;
    margin: 20px 0;
    position: relative; /* Für Progress-Indikator */
}

#store-map {
    border: 1px solid #ddd;
    border-radius: 4px;
}

#store-list {
    margin-top: 20px;
}

#store-list h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#store-count {
    color: #666;
    font-weight: normal;
    font-size: 0.8em;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.store-list-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.store-list-item:hover {
    background: #e9e9e9;
    border-color: #0073aa;
}

.store-list-item h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 1.1em;
}

.store-list-item p {
    margin: 5px 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.pin-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-right: 10px;
    flex-shrink: 0;
}

/* === POPUP STYLES === */
.store-popup h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.store-popup p {
    margin: 5px 0;
    line-height: 1.4;
}

.leaflet-popup-content {
    min-width: 200px;
}

/* === KATEGORIE TAGS === */
.category-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin: 2px 2px 2px 0;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* === MEHRFARBIGE PINS === */
.custom-marker {
    border: none !important;
    background: transparent !important;
}

/* Verbessertes Styling für mehrfarbige Indikatoren */
.pin-indicator {
    position: relative;
    overflow: hidden;
}

/* Fallback für Browser ohne conic-gradient Support */
@supports not (background: conic-gradient(red, blue)) {
    .pin-indicator {
        background: #e74c3c !important; /* Fallback-Farbe */
    }
}

/* === ANMELDEFORMULAR === */
#store-registration-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

#store-registration-container h3 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.form-row {
    display: block;
    margin-bottom: 15px;
}

.form-row .form-field {
    margin-bottom: 15px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-field select[multiple] {
    height: 120px;
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.form-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

.field-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 0;
}

.submit-button {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background: #005a87;
}

/* === NACHRICHTEN === */
#registration-message {
    margin-top: 15px;
}

#registration-message .success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 4px;
}

#registration-message .error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 4px;
}

#registration-message .loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    padding: 12px;
    border-radius: 4px;
}

/* === ERWEITERTE LEGENDE STYLES === */
.color-legend {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 15px;
    font-size: 12px;
    border: 1px solid #ddd;
    max-width: 100%;
}

.color-legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 2px 0;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.legend-color.multi-color {
    border-radius: 3px;
}

.legend-text {
    font-size: 11px;
    color: #555;
    line-height: 1.3;
}

.legend-note {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.legend-note .legend-text {
    color: #888;
    font-style: italic;
}

/* === NEU: Legende Desktop nebeneinander === */
.legend-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 2px 0;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.legend-note {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    width: 100%;
    flex-basis: 100%;
}

/* === NEU: Verpflegungsstand komplett === */
.verpflegungsstand-item {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    order: -999;
}

.verpflegungsstand-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
    filter: brightness(1.05);
}

.verpflegungsstand-item h4 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.verpflegungsstand-item p {
    margin: 5px 0;
    font-size: 0.95em;
    line-height: 1.4;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.verpflegungsstand-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verpflegungsstand-indicator img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.verpflegungsstand-marker {
    border: none !important;
    background: transparent !important;
}

.verpflegungsstand-marker img {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    transform: rotate(45deg) !important;
}

/* === VERPFLEGUNGSSTAND IN LEGENDE === */
.legend-verpflegung {
    order: -1; /* Erscheint immer zuerst */
}

.legend-verpflegung-color {
    width: 16px;
    height: 16px;
    border-radius: 3px !important; /* Rechteckiger für Verpflegung */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff !important;
}

.legend-verpflegung-color img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    border-radius: 2px;
}

.legend-verpflegung-color span {
    font-size: 8px;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.7);
    line-height: 1;
}

.legend-verpflegung-text {
    font-weight: 600; /* Etwas fetter für Hervorhebung */
    color: #333 !important;
}

/* Trennlinie nach Verpflegungsstand */
.legend-verpflegung::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 16px;
    background: #ddd;
}

/* === PROGRESSIVE LOADING STYLES === */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading-States für Store-Items */
.loading-item {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loaded-item {
    opacity: 1;
    pointer-events: auto;
    transition: background-color 0.5s ease, opacity 0.3s ease;
}

/* Progress-Indikator Basis-Styles (werden per JavaScript eingefügt) */
#loading-progress {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Temporäre Nachrichten */
#temp-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Highlight-Animation für geladene Items */
.store-list-item.highlight,
.verpflegungsstand-item.highlight {
    animation: highlightPulse 1s ease-out;
}

@keyframes highlightPulse {
    0% { background-color: #e8f4fd; }
    50% { background-color: #d1ecf1; }
    100% { background-color: inherit; }
}

/* Loading-Spinner für initiale Anzeige */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* Error-States */
.error-container {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

.retry-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.retry-button:hover {
    background: #c82333;
}

/* === EXPORT INTERFACE STYLES === */
.export-options {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

.export-option {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.export-option.recommended {
    border: 2px solid #0073aa;
    background: #f0f8ff;
}

.export-option h4 {
    margin-top: 0;
    color: #333;
}

.export-option.recommended h4 {
    color: #0073aa;
}

.export-option ul {
    font-size: 12px;
    margin: 10px 0;
    color: #666;
    list-style-type: none;
    padding-left: 0;
}

.export-option ul li {
    margin-bottom: 3px;
    padding-left: 15px;
    position: relative;
}

.export-option.recommended ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #00a32a;
    font-weight: bold;
}

.export-option:not(.recommended) ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #666;
}

.export-option form {
    margin-top: 15px;
}

.export-badge {
    display: inline-block;
    background: #00a32a;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: bold;
}

/* === PDF PREVIEW STYLES === */
.pdf-preview-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 13px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-card {
        margin-bottom: 10px;
    }
    
    #store-registration-container {
        padding: 15px;
    }
    
    .form-field select[multiple] {
        height: 100px;
    }
    
    .category-tag {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    /* Responsive Anpassungen für die Legende */
    .color-legend {
        margin-bottom: 10px;
        padding: 10px;
        max-width: 100%;
    }
    
    .legend-items-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    .legend-text {
        font-size: 10px;
    }
    
    .verpflegungsstand-item {
        padding: 15px;
    }
    
    /* Trennlinie auf Mobile entfernen */
    .legend-verpflegung::after {
        content: none;
    }
    
    .legend-verpflegung {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    /* Progress-Indikator auf Mobile anpassen */
    #loading-progress {
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        width: auto !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Reduzierte Animationen auf Mobile */
    .store-list-item {
        transition: background-color 0.2s ease;
    }
    
    .verpflegungsstand-item {
        transition: background-color 0.2s ease;
    }
    
    .verpflegungsstand-item:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.2);
    }
    
    /* Export-Optionen responsive */
    .export-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .export-option {
        padding: 12px;
    }
    
    .export-option h4 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .stat-card h3 {
        font-size: 2em;
    }
    
    .store-list-item {
        padding: 10px;
    }
    
    .pin-indicator {
        width: 12px;
        height: 12px;
    }
    
    /* Noch kleinerer Progress-Indikator */
    #loading-progress {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
}

/* === ADMIN STYLES === */
.form-table th {
    width: 200px;
}

.code {
    font-family: Consolas, Monaco, monospace;
}

.card {
    max-width: none;
}

.card ul {
    list-style-type: disc;
    margin-left: 20px;
}

.card ul li {
    margin-bottom: 5px;
}

/* === ACCESSIBILITY IMPROVEMENTS === */
.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;
}

/* Fokus-Indikatoren für Tastaturnutzung */
.store-list-item:focus,
.verpflegungsstand-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* === REDUCED MOTION SUPPORT === */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner,
    #loading-progress div,
    .store-list-item,
    .verpflegungsstand-item,
    .pin-indicator {
        animation: none !important;
        transition: none !important;
    }
}

/* === PRINT STYLES === */
@media print {
    #loading-progress,
    #temp-message,
    .loading-spinner {
        display: none !important;
    }
    
    .store-list-item,
    .verpflegungsstand-item {
        break-inside: avoid;
        border: 1px solid #000 !important;
        margin-bottom: 10px !important;
    }
    
    .loading-item {
        opacity: 1 !important;
    }
}

/* === PROGRESSIVE LIST LOADING === */

/* Loading-Container für Liste */
#list-loading-container {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Animationen für Listen-Items */
.store-list-item,
.verpflegungsstand-item {
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Hover-Effekte während Loading */
.store-list-item:hover,
.verpflegungsstand-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Counter-Animation */
#store-count {
    transition: all 0.3s ease;
}

/* Highlight-Effekte */
.store-list-item.map-loaded,
.verpflegungsstand-item.map-loaded {
    border-left: 4px solid #0073aa;
    background: linear-gradient(90deg, #e8f4fd 0%, transparent 100%);
}

/* Gestaffelte Loading-Animation */
.store-list-item[style*="opacity: 0"] {
    pointer-events: none;
}

/* Optimierung für Mobile */
@media (max-width: 768px) {
    #list-loading-container {
        padding: 15px;
        font-size: 13px;
    }
    
    .store-list-item,
    .verpflegungsstand-item {
        transition-duration: 0.2s;
    }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .store-list-item,
    .verpflegungsstand-item,
    #store-count {
        transition: none !important;
        animation: none !important;
    }
    
    .store-list-item:hover,
    .verpflegungsstand-item:hover {
        transform: none !important;
    }
}