/* H1 im Header ausblenden */
header h1 {
    display: none;
}

/* Footer immer am unteren Rand */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #fff; /* Optional: Textfarbe */
    padding: 5px 0; 
    font-size: 6px; 
    z-index: 1000; /* Stellt sicher, dass der Footer immer sichtbar ist */
}

main {
    width: 100%; /* 95% der verfügbaren Breite */
    height: 100%; /* 90% der verfügbaren Höhe */
    margin: auto; /* Zentriert den Container */
    display: flex; /* Optional: Flexbox für Layoutsteuerung */
    justify-content: center; /* Zentriere Inhalte horizontal */
    align-items: center; /* Zentriere Inhalte vertikal */
    box-sizing: border-box; /* Inklusive Padding und Border */
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top center, #365880 45%, #718cae 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
}

#slideshow {
    position: relative;
    width: 95%;
    height: 90%;
    overflow: hidden;
    display: block;
    visibility: visible;
    background: url('../images/mountainstream-logo-2025.png') center center no-repeat;
    background-size: 300px auto;
}

#slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 2;
}

#slideshow img.active {
    opacity: 1;
}

#slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenburns 21.4s infinite ease-in-out;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: block;
    visibility: visible;
}

#slideshow img.active {
    opacity: 1;
}

/* Ken-Burns-Effekt */
@keyframes kenburns {
    0% {
        transform: scale(1.2) translateX(-5%);
    }
    50% {
        transform: scale(1.2) translateX(5%);
    }
    100% {
        transform: scale(1.2) translateX(-5%);
    }
}

/* Ken-Burns deaktiviert - gesamtes Bild zentriert sichtbar */
#slideshow.no-kenburns img {
    animation: none !important;
    object-fit: contain; /* Gesamtes Bild sichtbar, keine Zuschnitte */
    object-position: center center; /* Bild zentriert */
    transform: scale(1) translateX(0) !important;
}

#slideshow.no-kenburns img.active {
    transform: scale(1) translateX(0) !important;
    object-position: center center; /* Bild zentriert */
}

/* Einheitliches Styling für alle Buttons im link-symbol Container */
#link-symbol button,
#link-symbol a {
    background: rgba(54, 87, 130, 0.8) !important; /* Standard Blau */
    border: none !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 20px !important;
    line-height: 1 !important;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none;
    box-sizing: border-box !important;
}

#link-symbol button:hover,
#link-symbol a:hover {
    background: rgba(54, 87, 130, 1);
    transform: scale(1.1);
}

/* Ken-Burns Toggle Button - Standard (Ken-Burns aktiv) = Grün */
#kenburns-toggle:not(.active) {
    background: rgba(52, 199, 89, 0.8) !important; /* Grün wenn Ken-Burns aktiv */
}

#kenburns-toggle:not(.active):hover {
    background: rgba(52, 199, 89, 1) !important; /* Grün beim Hover wenn Ken-Burns aktiv */
}

/* Ken-Burns Toggle Button - deaktiviert (Ken-Burns aus) = Blau */
#kenburns-toggle.active {
    background: rgba(54, 87, 130, 0.8) !important; /* Blau wenn Ken-Burns aus */
}

#kenburns-toggle.active:hover {
    background: rgba(54, 87, 130, 1) !important; /* Blau beim Hover wenn Ken-Burns aus */
}

/* Ladeindikator */
#loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Datum und Uhrzeit */
#datetime {
    position: absolute;
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: bold;
    z-index: 10;
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

/* Kamerastandort - Liquid Glass Effekt wie link-symbol */
#camera-location {
    position: absolute;
    bottom: 20px;  /* Einheitlicher Abstand */
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
    color: white;
    height: 50px;  /* Feste Höhe wie Buttons */
    display: flex;
    align-items: center;
    padding: 0 18px;  /* Nur horizontal padding */
    /* Liquid Glass Effekt - Apple Style */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    /* Mehrschichtige Schatten für Tiefe */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    /* Subtiler Rand für Reflektion */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease;
}

/* Link */
#webcam-link {
    text-decoration: none;
}

/* Link-Symbol Container - Liquid Glass Effekt */
#link-symbol {
    position: absolute;
    bottom: 20px;  /* Einheitlicher Abstand */
    right: 20px;   /* Einheitlicher Abstand */
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;  /* Feste Höhe */
    padding: 0 8px;  /* Nur horizontal padding */
    /* Liquid Glass Effekt - Apple Style */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    /* Mehrschichtige Schatten für Tiefe */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    /* Subtiler Rand für Reflektion */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: none;
}

/* Status-Symbol - jetzt Teil des link-symbol Containers */
#progress-indicator {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    background: rgba(54, 87, 130, 0.8) !important; /* Gleicher Hintergrund wie andere Buttons */
    border: none !important;
    border-radius: 8px !important; /* Gleiche border-radius wie andere Buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; /* Padding in Größe einbeziehen */
    flex-shrink: 0; /* Verhindert Schrumpfen */
    transition: background 0.2s ease;
}

#progress-indicator:hover {
    background: rgba(54, 87, 130, 1) !important;
    transform: scale(1.1);
}

#debug-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    color: white;
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
    font-family: monospace;
    border: 1px solid rgba(54, 87, 130, 0.8);
}

#debug-panel h3 {
    margin: 0 0 10px 0;
    color: rgba(54, 87, 130, 1);
    border-bottom: 1px solid rgba(54, 87, 130, 0.8);
    padding-bottom: 5px;
}

#debug-panel pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#debug-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
}

.menu-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-action-button {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-action-button:hover {
    opacity: 1;
}

.menu-action-button.active {
    color: #ff4444;
}

.menu-action-button.delete {
    color: #ff4444;
    opacity: 0.7;
}

.menu-action-button.delete:hover {
    opacity: 1;
}

.menu-action-button .icon {
    font-size: 16px;
}

/* Playlist-Links Sektion */
.menu-playlists {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.playlists-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
}

.playlists-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlists-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.playlist-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-link:hover {
    color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.playlist-link.active {
    color: rgba(52, 199, 89, 1);
    background: rgba(52, 199, 89, 0.15);
    border-color: rgba(52, 199, 89, 0.3);
    font-weight: 500;
}



#progress-circle {
    width: 20px; /* Feste Größe für runden Kreis */
    height: 20px; /* Feste Größe für runden Kreis */
    border: 2px solid rgba(54, 87, 130, 1); /* Vollständig blauer Rand */
    border-radius: 50%;
    background: conic-gradient(rgba(54, 87, 130, 1) 0%, rgba(255, 255, 255, 0.5) 0%); /* Fortschritt */
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0; /* Verhindert Verzerrung */
}

#progress-circle.loading {
    animation: progress-spin 1s linear; /* Rotation während des Ladens */
}

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

/* Querformat-Aufforderung */
#orientation-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000; /* Schwarzer Text */
    font-size: 18px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.5); /* Weiße Box mit 50% Transparenz */
    padding: 20px;
    border-radius: 10px;
    z-index: 20;
    display: block; /* Immer anzeigen im Portrait-Modus */
    text-align: center;
    box-shadow: 1px 4px 10px rgba(0, 0, 0, 0.3);
}

/* Hochformat Layout */
@media (orientation: portrait) {
    #datetime, #camera-location,
    #progress-indicator, #slideshow img, #link-symbol,
    #menuToggle, .radio-menu
    {
        display: none;
    }

    #orientation-warning {
        display: block; /* Sicherstellen, dass es sichtbar ist */
    }
    
    #rotating-arrow {
        position: absolute;
        top: 30%; /* Zentrieren */
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px; /* Größe des Pfeils */
        height: 80px;
        background-image: url('../../assets/images/rotating-arrow.png');
        background-size: contain;
        background-repeat: no-repeat;
        animation: rotate 15s linear infinite;
        filter: invert(1); /* Bild invertieren */
    }

    /* Animation */
    @keyframes rotate {
        0% {
            transform: translate(-50%, -50%) rotate(0deg);
        }
        100% {
            transform: translate(-50%, -50%) rotate(360deg);
        }
    }
    
}

/* Querformat Layout */
@media (orientation: landscape) {
    #datetime {
        position: absolute;
        color: #fff;
        font-size: 20px;
        font-weight: bold;
        z-index: 10;
        text-shadow: 3px 2px 10px rgba(0, 0, 0, 0.7);
    }

    #datetime {
        top: 5%;
        left: 50%;
        transform: translateX(-50%);
    }

    #orientation-warning {
        display: none;
    }
}

/* PC Layout - Element mittig im Rahmen */
@media (min-width: 960px) {
    #datetime {
        position: absolute;
        color: #fff;
        font-size: 20px;
        font-weight: bold;
        z-index: 10;
        text-shadow: 10px 2px 10px rgba(0, 0, 0, 0.7);
    }

    #datetime {
        top: 2.5%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #orientation-warning {
        display: none;
    }
}

/* Camera-Location Fallback für Browser ohne backdrop-filter */
@supports not (backdrop-filter: blur(20px)) and not (-webkit-backdrop-filter: blur(20px)) {
    #camera-location {
        background: rgba(0, 0, 0, 0.85) !important;
    }
}
