body {
    margin: 0;
    background-color: #000;
    font-family: Arial, sans-serif;
    color: white;
}

body.diashow {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000; /* sicherheitshalber nochmal */
    margin: 0;
}

/* Container für Bild und Spruch */
#container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center; /* Bild und Spruch horizontal mittig */
    gap: 20px;
    max-width: 90vw;
    margin: 0 auto;
    padding: 1rem;
}

/* Spruchbereich */
#spruch {
    flex: 1 1 250px; /* mindestens 250px breit, flexibel */
    color: white; /* weiß statt rot */
    font-size: 2.5rem; /* etwas größer */
    font-style: italic;
    text-align: center;
    user-select: none;
    white-space: normal; /* Umbruch erlauben */
    word-wrap: break-word;
    opacity: 0; /* für fadein */
    transition: opacity 1.5s ease-in-out;
}

/* Bild */
#slideshow {
    flex: 2 1 500px;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* --- Mobile Anpassungen --- */
@media (max-width: 700px) {
     #container {
        flex-direction: column;
        gap: 15px;
        padding: 0.5rem;
    }

    #spruch {
        font-size: 1.3rem;
        flex: none;
        max-width: 100%;
    }

    #slideshow {
        flex: none;
        max-height: 50vh;
    }
}

body.diashow img {
    max-width: 90%;
    max-height: 90%;
    transition: opacity 1s ease-in-out;
    opacity: 1;
    position: relative;
    object-fit: contain;
}

/* --- Mobile Anpassungen --- */
@media (max-width: 600px) {
    body.diashow img {
        max-width: 95vw;
        max-height: 80vh;
    }

    body.upload, body.admin {
        padding: 1rem;
    }

    .btn {
        font-size: 1em;
        padding: 8px 12px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
    }

    .thumb {
        padding: 6px;
    }
}

/* Upload-spezifisch */
body.upload {
    background-color: #111;
    color: white;
    font-family: Arial, sans-serif;
    padding: 2rem;
    margin: 0;
}

h1, h3 {
    margin-bottom: 1rem;
    text-align: center;
}

#file {
    display: block;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
    cursor: pointer;
}

#uploadStatus {
    max-width: 600px;
    margin: 0 auto;
}

.upload-container {
    background: #222;
    border: 1px solid #444;
    padding: 10px 15px;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress {
    background: #333;
    border: 1px solid #555;
    height: 20px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: #0f0;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.status {
    font-size: 1rem;
}

.status.error {
    color: #f55;
    font-weight: bold;
}

.btn-retry {
    align-self: flex-start;
    background: #a00;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-retry:hover {
    background: #d00;
}

/* Mobile */
@media (max-width: 600px) {
    body.upload {
        padding: 1rem;
    }

    #uploadStatus {
        max-width: 100%;
    }

    .upload-container {
        padding: 8px 12px;
    }

    .status {
        font-size: 0.9rem;
    }

    .btn-retry {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
}

h1 {
    margin-bottom: 1rem;
}

.text {
    color: white;
    text-align: center;
    font-size: 1.2em;
}

body.admin {
    background-color: #111;
    color: #fff;
    padding: 2rem;
    font-family: sans-serif;
}

.upload-section {
    margin-bottom: 2rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.thumb {
    display: flex;
    flex-direction: column;
    background: #222;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    height: 100%;
}

.thumb img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    flex-shrink: 0;
}

.filename {
    margin-top: 6px;
    font-size: 0.9em;
    color: #ccc;
    word-break: break-word;
    text-align: center;
    user-select: text;
    flex-shrink: 0;
}

.actions {
    margin-top: auto; /* schiebt die Buttons ans untere Ende */
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: #444;
    color: white;
    padding: 5px 10px;
    border: none;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1.2em;
}

.btn:hover {
    background: #666;
    cursor: pointer;
}

.btn.delete {
    background: #a00;
}

.btn.delete:hover {
    background: #d00;
}

/* Rotate-Form Elemente */
.actions form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.actions select {
    background: #444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.actions select:hover,
.actions select:focus {
    background: #666;
    outline: none;
}

.actions form button.btn {
    padding: 5px 10px;
    font-size: 1.2em;
    background: #444;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.actions form button.btn:hover {
    background: #666;
    cursor: pointer;
}
