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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-bar {
    background: #A51009;
    color: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

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

.logo-container {
    width: 80px;
    height: 80px;
    margin-right: 15px;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.title-section {
    display: flex;
    flex-direction: column;
}

.top-bar h1 {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
}

.subtitle {
    font-size: 14px;
    font-weight: 300;
    opacity: 0.9;
    font-style: italic;
    margin-top: -2px;
}

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

.stadtkapelle-logo {
    width: 160px;
    height: 80px;
    object-fit: contain;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

/* Footer */
footer {
    background: #A51009;
    color: white;
    padding: 20px 30px;
    margin-top: auto;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 300;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Hauptinhalt */
main {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Karte */
#map {
    width: 100%;
    height: 80vh;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
        height: 60px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: center;
    }
    
    .header-left {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-shrink: 1;
        height: 100%;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 1;
        height: 100%;
    }
    
    .logo-container {
        width: 40px;
        height: 40px;
        margin-right: 0;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .title-section {
        display: flex;
        flex-direction: column;
        text-align: center;
        flex-grow: 1;
        min-width: 0; /* Wichtig für Flexbox */
        justify-content: center;
    }
    
    .top-bar h1 {
        font-size: 18px;
        margin: 0;
        white-space: nowrap;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 11px;
        margin-top: -2px;
        line-height: 1;
    }
    
    .stadtkapelle-logo {
        width: 80px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .admin-nav {
        margin-top: 0;
    }
    
    #map {
        height: calc(100vh - 60px - 80px); /* Angepasst für neue Top-Bar Höhe */
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    footer {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 8px 12px;
        height: 60px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .logo-container {
        width: 35px;
        height: 35px;
    }
    
    .top-bar h1 {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 10px;
    }
    
    .stadtkapelle-logo {
        width: 75px;
        height: 38px;
    }
    
    #map {
        height: calc(100vh - 60px - 80px);
    }
}

/* Zusätzliche Mobile Optimierungen */
@media (max-width: 360px) {
    .top-bar {
        height: 60px;
        padding: 6px 10px;
    }
    
    .top-bar h1 {
        font-size: 14px;
    }
    
    .subtitle {
        font-size: 9px;
    }
    
    .logo-container {
        width: 32px;
        height: 32px;
    }
    
    .stadtkapelle-logo {
        width: 70px;
        height: 35px;
    }
    
    #map {
        height: calc(100vh - 60px - 80px);
    }
}

/* Moderne Formulare */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
}

/* Moderne Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Login-Container */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #8B0000;
    font-weight: 300;
}

/* Dashboard-Layout */
.dashboard-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 160px);
}

.sidebar {
    width: 280px;
    background: white;
    padding: 30px 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    height: fit-content;
}

.sidebar h2 {
    margin-bottom: 30px;
    padding: 0 30px;
    color: #8B0000;
    font-weight: 300;
    font-size: 24px;
}

.sidebar ul {
    list-style: none;
}

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

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 15px 30px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 16px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    border-left: 4px solid transparent;
}

.sidebar-btn:hover, .sidebar-btn.active {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #8B0000;
    border-left-color: #8B0000;
}

.content-area {
    flex-grow: 1;
    padding: 20px;
}

/* Admin-Formulare */
.admin-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.admin-form h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
    font-size: 24px;
}

/* Tabellen */
.locations-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.locations-table th,
.locations-table td {
    padding: 15px;
    text-align: left;
}

.locations-table th {
    background: #A51009;
    color: white;
    font-weight: 600;
}

.locations-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.locations-table tr:hover {
    background-color: #e9ecef;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Bildergalerie */
.image-gallery {
    margin-top: 30px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-item form {
    padding: 15px;
    text-align: center;
}

/* Upload Form */
.upload-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-form h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
}

/* Verbesserte Popup-Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.custom-popup {
    position: relative;
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #8B0000;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-popup:hover {
    background-color: #f8f9fa;
}

.location-info {
    margin-bottom: 25px;
    text-align: center;
    width: 100%;
}

.location-info h3 {
    font-size: 28px;
    color: #8B0000;
    margin-bottom: 10px;
    font-weight: 300;
}

.location-info p {
    color: #6c757d;
    font-size: 14px;
}

.image-container {
    width: 100%;
    max-height: 300px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 15px;
    padding: 10px 0;
}

.image-container::-webkit-scrollbar {
    height: 8px;
}

.image-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.image-container::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 4px;
}

.location-image {
    min-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.location-image:hover {
    transform: scale(1.05);
}

/* Fullscreen Slideshow */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.slideshow-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border: 3px solid white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.slideshow-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.slideshow-button {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    color: #8B0000;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.slideshow-button:hover {
    transform: scale(1.1);
}

.slideshow-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border: 2px solid white;
    color: #8B0000;
    font-size: 24px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.slideshow-close:hover {
    transform: scale(1.1);
}

/* Datenschutz-Seite */
.datenschutz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.datenschutz-container h1 {
    color: #8B0000;
    margin-bottom: 30px;
    font-weight: 300;
}

.datenschutz-container h2 {
    color: #8B0000;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 400;
}

.datenschutz-container p {
    margin-bottom: 15px;
    text-align: justify;
}

.datenschutz-container ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.datenschutz-container li {
    margin-bottom: 8px;
}

/* Custom Duck Icons mit verbessertem Glow */
.custom-duck-icon {
    background: transparent !important;
    border: none !important;
    width: 35px !important;
    height: 35px !important;
}

.duck-glow-container {
    width: 35px !important;
    height: 35px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.duck-glow-image {
    width: 35px !important;
    height: 35px !important;
    object-fit: contain;
}

/* Neue Enten - Grüner Glow mit angepasster Intensität */
.duck-glow-container.new-glow {
    animation: pulse-green 3s ease-in-out infinite;
}

/* Sehr neue Enten - Gelber Glow mit angepasster Intensität */
.duck-glow-container.very-new-glow {
    animation: pulse-yellow 2s ease-in-out infinite;
}

/* Animationen */
@keyframes pulse-green {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.05);
    }
}

@keyframes pulse-yellow {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.08);
    }
}

/* Quack Button - neues Grün und Text */
.quack-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #005922 0%, #004d1d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quack-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 89, 34, 0.3);
}

.quack-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* FIXED POPUP OVERLAYS - WICHTIG: display: none als Standard */
.quack-popup-overlay,
.success-popup-overlay,
.share-popup-overlay,
.stats-popup-overlay,
.challenges-popup-overlay,
.photo-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none !important; /* WICHTIG: Standardmäßig versteckt */
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Sehr hoher Z-Index */
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Wenn Popup aktiv ist */
.quack-popup-overlay.active,
.success-popup-overlay.active,
.share-popup-overlay.active,
.stats-popup-overlay.active,
.challenges-popup-overlay.active,
.photo-viewer-overlay.active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.quack-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.quack-popup-overlay.active .quack-popup {
    transform: scale(1);
}

.quack-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.quack-close:hover {
    background-color: #f8f9fa;
}

.quack-popup h2 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
    text-align: center;
}

/* Info Section */
.info-section {
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.info-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: background-color 0.3s ease;
}

.info-toggle:hover {
    background: #e9ecef;
}

.info-content {
    display: none;
    padding: 16px;
    background: white;
}

.info-content ul {
    margin: 0;
    padding-left: 20px;
}

.info-content li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* Form Buttons */
.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
   border: 4px solid #f3f3f3;
   border-top: 4px solid #8B0000;
   border-radius: 50%;
   width: 50px;
   height: 50px;
   animation: spin 1s linear infinite;
   margin: 0 auto 20px;
}

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

/* Success Popup */
.success-popup-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.8);
   display: none;
   align-items: center;
   justify-content: center;
   z-index: 2001;
}

.success-popup {
   background: white;
   border-radius: 12px;
   padding: 40px;
   max-width: 400px;
   width: 90%;
   text-align: center;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
   transform: scale(0.9);
   transition: transform 0.3s ease;
}

.success-popup-overlay.active .success-popup {
    transform: scale(1);
}

.success-icon {
   font-size: 48px;
   margin-bottom: 20px;
}

.success-popup h3 {
   color: #28a745;
   margin-bottom: 15px;
   font-weight: 300;
}

.success-popup p {
   color: #6c757d;
   margin-bottom: 25px;
   line-height: 1.6;
}

/* Share Popup */
.share-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-popup-overlay.active .share-popup {
    transform: scale(1);
}

.share-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.share-close:hover {
    background-color: #f8f9fa;
}

.share-popup h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
}

.share-url {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.share-url input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background: #f8f9fa;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Stats Popup */
.stats-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.stats-popup-overlay.active .stats-popup {
    transform: scale(1);
}

.stats-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.stats-close:hover {
    background-color: #f8f9fa;
}

.stats-popup h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
    text-align: center;
}

.countries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.country-item {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #8B0000;
}

/* Challenges Popup */
.challenges-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.challenges-popup-overlay.active .challenges-popup {
    transform: scale(1);
}

.challenges-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.challenges-close:hover {
    background-color: #f8f9fa;
}

.challenges-popup h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
    text-align: center;
}

.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.challenge-item-public {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
    background: #f8f9fa;
}

.challenge-item-public.completed {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #f0f8f0 100%);
}

.challenge-header-public {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.challenge-icon {
    font-size: 20px;
}

.challenge-title-public {
    font-weight: 600;
    color: #8B0000;
    flex-grow: 1;
}

.challenge-description-public {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.challenge-target {
    font-size: 13px;
    color: #495057;
}

.completed-date {
    color: #28a745;
    font-weight: 500;
}

/* Photo Viewer Popup */
.photo-viewer-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.photo-viewer-overlay.active .photo-viewer-popup {
    transform: scale(1);
}

.photo-viewer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.photo-viewer-close:hover {
    background-color: #f8f9fa;
}

.photo-viewer-popup h3 {
    margin-bottom: 20px;
    color: #8B0000;
    font-weight: 300;
}

#photo-canvas {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
}

#photo-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

/* Full Stats */
.full-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #8B0000;
}

/* Footer Stats - größere Icons und klickbar */
.footer-stats {
   display: flex;
   gap: 20px;
   align-items: center;
}

.stat-item {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 8px 12px;
   border-radius: 8px;
   transition: all 0.3s ease;
}

.stat-item:hover {
   background: rgba(255, 255, 255, 0.1);
   transform: translateY(-2px);
}

.stat-icon {
   width: 35px;
   height: 35px;
   object-fit: contain;
}

.stat-number {
   font-size: 18px;
   font-weight: 600;
   color: white;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        min-height: calc(100vh - 200px);
    }
    
    .sidebar {
        width: 100%;
        border-radius: 0;
        position: static;
    }
    
    .sidebar-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .admin-form {
        padding: 20px;
    }
    
    .custom-duck-icon {
        width: 30px !important;
        height: 30px !important;
    }
    
    .duck-glow-container {
        width: 30px !important;
        height: 30px !important;
    }
    
    .duck-glow-image {
        width: 30px !important;
        height: 30px !important;
    }
    
    .quack-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .quack-icon {
        width: 16px;
        height: 16px;
    }
    
    .quack-popup,
    .share-popup,
    .challenges-popup,
    .stats-popup,
    .photo-viewer-popup {
        padding: 20px;
        margin: 10px;
        max-width: none;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .custom-popup {
        margin: 10px;
        padding: 20px;
        max-width: none;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .location-info h3 {
        font-size: 24px;
    }
    
    .image-container {
        max-height: 200px;
    }
    
    .location-image {
        min-width: 150px;
        height: 120px;
    }
    
    .datenschutz-container {
        margin: 20px;
        padding: 20px;
    }
    
    /* Mobile Footer - Kilometer auf zweite Zeile */
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    /* Erste Zeile: 3 Statistiken */
    .footer-stats .stat-item:not(#stat-kilometers) {
        flex: 1;
        min-width: calc(33.333% - 7px);
        max-width: calc(33.333% - 7px);
        justify-content: center;
    }
    
    /* Zweite Zeile: Kilometer allein */
    .footer-stats #stat-kilometers {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 10px;
    }
    
    .stat-icon {
        width: 30px;
        height: 30px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .share-url {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .challenge-header-public {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Mobile Measurement Popup */
    .kilometer-stats {
        padding: 15px;
        max-width: 100%;
    }
    
    .comparisons-section {
        margin-top: 15px;
    }
    
    .comparison-item {
        flex-direction: column;
        text-align: center;
        padding: 12px 8px;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .comparison-item strong {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .comparison-icon, .measurement-icon {
        width: 20px;
        height: 20px;
        margin-right: 4px;
    }
    
    .measurement-icon-large {
        width: 28px;
        height: 28px;
    }
    
    .info-icon {
        font-size: 18px;
        margin-left: 0;
        margin-top: 5px;
        display: block;
        width: 24px;
        height: 24px;
        text-align: center;
        line-height: 24px;
    }
    
    .measurement-info {
        padding: 15px;
        text-align: center;
    }
    
    .measurement-info h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .measurement-size {
        font-size: 16px !important;
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .measurement-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding: 12px !important;
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .slideshow-controls {
        bottom: 20px;
        gap: 15px;
    }
    
    .slideshow-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .slideshow-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .quack-popup,
    .share-popup,
    .challenges-popup,
    .stats-popup,
    .photo-viewer-popup {
        padding: 15px;
        margin: 5px;
        width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }
    
    .custom-popup {
        padding: 15px;
        margin: 5px;
        width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }
    
    .challenge-item-public {
        padding: 12px;
    }
    
    /* Sehr kleine Bildschirme - Footer kompakter */
    .footer-stats .stat-item:not(#stat-kilometers) {
        min-width: calc(50% - 5px);
        max-width: calc(50% - 5px);
    }
    
    .footer-stats .stat-item:nth-child(3) {
        width: 100%;
        margin-top: 5px;
    }
    
    .footer-stats #stat-kilometers {
        margin-top: 10px;
        padding: 8px;
    }
    
    .stat-icon {
        width: 25px;
        height: 25px;
    }
    
    .stat-number {
        font-size: 14px;
    }
    
    /* Mobile Measurement Popup - sehr kleine Bildschirme */
    .kilometer-stats {
        padding: 10px;
        font-size: 14px;
    }
    
    .comparison-item {
        padding: 10px 6px;
        margin-bottom: 6px;
        font-size: 14px;
    }
    
    .comparison-item strong {
        font-size: 14px;
    }
    
    .comparison-icon, .measurement-icon {
        width: 18px;
        height: 18px;
    }
    
    .measurement-icon-large {
        width: 24px;
        height: 24px;
    }
    
    .info-icon {
        font-size: 16px;
        width: 20px;
        height: 20px;
        line-height: 20px;
    }
    
    .measurement-info h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .measurement-size {
        font-size: 14px !important;
        padding: 10px !important;
    }
    
    .measurement-description {
        font-size: 13px !important;
        padding: 10px !important;
    }
}

/* Weisswurst Icon Fix - sicherstellen dass alle Icons korrekt angezeigt werden */
.comparison-icon, .measurement-icon, .measurement-icon-large {
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
}

/* Spezielle Behandlung für Weisswurst-Icon */
img[src*="weisswurst"] {
    object-fit: contain !important;
    filter: none !important;
    background: transparent !important;
}

/* Kilometer Statistiken Styling */
.kilometer-stats {
    text-align: center;
}

.comparisons-section {
    margin-top: 20px;
}

.comparison-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.comparison-item:hover {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-color: #8B0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.1);
}

.comparison-item strong {
    color: #8B0000;
    font-weight: 600;
}

.info-icon {
    font-size: 16px;
    color: #6c757d;
    opacity: 0.7;
    transition: all 0.3s ease;
    margin-left: 8px;
    float: right;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
}

.info-icon:hover {
    color: #8B0000;
    opacity: 1;
    background: rgba(139, 0, 0, 0.1);
    transform: scale(1.1);
}

.measurement-info {
    text-align: center;
    padding: 20px;
}

.measurement-info h3 {
    color: #8B0000;
    margin-bottom: 20px;
}

.measurement-size {
    background: #f8f9fa !important;
    padding: 15px !important;
    border-radius: 8px !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    border: 2px solid #e9ecef;
}

.measurement-description {
    line-height: 1.6 !important;
    color: #333 !important;
    text-align: left;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #8B0000;
}

.comparison-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

.measurement-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: contain;
}

.measurement-icon-large {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    object-fit: contain;
}

/* Extra kleine Bildschirme - noch kompakteres Layout */
@media (max-width: 360px) {
    /* Footer für sehr kleine Bildschirme optimieren */
    .footer-stats .stat-item:not(#stat-kilometers) {
        min-width: 100%;
        max-width: 100%;
        margin-bottom: 5px;
    }
    
    .footer-stats #stat-kilometers {
        margin-top: 10px;
        padding: 6px;
    }
    
    .stat-icon {
        width: 22px;
        height: 22px;
    }
    
    .stat-number {
        font-size: 12px;
    }
    
    /* Measurement Popup für sehr kleine Bildschirme */
    .kilometer-stats {
        padding: 8px;
        font-size: 12px;
    }
    
    .comparison-item {
        padding: 8px 4px;
        margin-bottom: 4px;
        font-size: 12px;
    }
    
    .comparison-item strong {
        font-size: 12px;
    }
    
    .comparison-icon, .measurement-icon {
        width: 16px;
        height: 16px;
    }
    
    .measurement-icon-large {
        width: 20px;
        height: 20px;
    }
    
    .info-icon {
        font-size: 14px;
        width: 18px;
        height: 18px;
        line-height: 18px;
    }
    
    .measurement-info {
        padding: 8px;
    }
    
    .measurement-info h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .measurement-size {
        font-size: 12px !important;
        padding: 8px !important;
    }
    
    .measurement-description {
        font-size: 11px !important;
        padding: 8px !important;
    }
}