/* 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%);
    }
}

/* 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, #camera-location {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    z-index: 10;
    text-align: center;
}

#datetime {
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}

/* Roter blinkender Punkt und "LIVE"-Text */
#live-indicator {
    position: absolute;
    top: 5%;
    right: 3%;
    display: flex;
    align-items: center;
    font-size: 25px;
    color: #fff;
    font-weight: bold;
    z-index: 10;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}

#live-indicator .dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: red;
    margin-right: 10px;
    animation: blink 1s infinite step-start;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

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

/* Link-Symbol */
#link-symbol {
    position: absolute;
    bottom: 5%;
    right: 3%;
    font-size: 20px;
    color: #fff;
    z-index: 10;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    text-decoration: none;
}

/* Status-Symbol */
#progress-indicator {
    position: absolute;
    bottom: 6%;
    left: 3%;
    width: 20px; /* Größe des gesamten Kreises */
    height: 20px;
    z-index: 1000;
}

/* Kamerastandort */
#camera-location {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 2px 8px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

#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;
}

.favorite-btn.active {
    color: #ff4444;
    opacity: 1;
}

#favorites-menu {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    background: rgba(54, 87, 130, 0.8);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 900;
    width: 300px;
    padding: 20px;
    box-sizing: border-box;
}

#favorites-menu.open {
    transform: translateX(0);
}

#favorites-menu h3 {
    color: white;
    margin: 0 0 20px 0;
    font-size: 20px;
    text-align: center;
}

#favorites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: white;
    max-height: calc(100vh - 200px); /* Höhe abzüglich Header und Buttons */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

#favorites-list::-webkit-scrollbar {
    width: 6px;
}

#favorites-list::-webkit-scrollbar-track {
    background: transparent;
}

#favorites-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

#favorites-list li {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

#favorites-list li .delete-favorite {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0 5px;
    font-size: 16px;
    margin-left: 10px;
}

#favorites-list li .delete-favorite:hover {
    opacity: 1;
}

#favorites-list li .favorite-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-right: 10px;
}

#favorites-list li:last-child {
    border-bottom: none;
}

#favorites-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(54, 87, 130, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 1000;
    border-radius: 8px 0 0 8px;
    transition: right 0.3s ease;
}

#favorites-menu.open + #favorites-toggle {
    right: 300px; /* Breite des Menüs */
}

#favorites-menu {
    position: fixed;
    right: -300px; /* Start außerhalb des Bildschirms */
    width: 300px;
    transition: right 0.3s ease;
}

#favorites-menu.open {
    right: 0;
}


.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;
}

#favorites-toggle.active {
    background: rgba(54, 87, 130, 1);
}


.favorite-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
    opacity: 0.7;
}

.favorite-btn.active {
    color: #ff4444;
    opacity: 1;
}

#link-symbol .favorite-btn {
    margin-right: 10px;
}

#progress-circle {
    width: 100%;
    height: 100%;
    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;
}

#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) {
    #live-indicator, #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;
    }
}
