 :root { --primary: #333; --white: #fff; }
        body { font-family: sans-serif; background: #292525; color: rgb(241, 248, 177); margin: 20px; }
        
        /* Thumbnail-Grid */
        .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }
        .gallery img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            cursor: pointer;
            border-radius: 8px;
            transition: transform 0.2s;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .gallery img:hover { transform: scale(1.05); }

        /* Overlay / Lightbox */
        #overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.9);
            z-index: 1000;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 20px 0;
            box-sizing: border-box;
        }
        #img-container {
            width: 90%;
            height: 80vh;
            overflow: auto; /* Aktiviert echte Scrollbalken beim Zoomen */
            display: block; /* Wichtig, damit Text-Align und Scrollen harmonieren */
            text-align: center;
        }
        #full-image {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            display: inline-block;
            vertical-align: middle;
            transition: width 0.1s ease; /* Sanfter Übergang beim Zoomen */
        }

        .controls {
            margin-top: 20px;
            display: flex;
            gap: 10px;
        }
        button, .btn-dl {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            text-decoration: none;
            color: var(--white);
        }
        .close-btn { background: #e74c3c; width: 100%;}
        /** Upload */


        #overlay_error {
            display: none; /* Hinweis: Um Flexbox zu aktivieren, muss dies per JS/CSS zu 'display: flex' werden */
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            flex-direction: column;
            /* FAKTEN-ÄNDERUNG: 'center' zentriert das Kind-Element vertikal */
            justify-content: center; 
            /* 'center' zentriert das Kind-Element horizontal */
            align-items: center; 
            padding: 20px 0;
            box-sizing: border-box;
        }
        .error {
            width: 50%;
            max-width: 500px; 
            box-sizing: border-box;
            padding: 30px;
            background: #1a1a1a; /* Dunkler Kontrast zum tiefschwarzen Overlay */
            border-radius: 12px;
            border: 1px solid #333;
            display: flex;
            flex-direction: column;
            gap: 20px; /* Erzeugt gleichmäßige Abstände zwischen Elementen */
        }

        .right{
            position: absolute;
            right: 0;
            top:0;
            padding-top:0.5%;
            padding-right:2%;
           
        }

        #overlay_up {
            display: none; /* Hinweis: Um Flexbox zu aktivieren, muss dies per JS/CSS zu 'display: flex' werden */
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.9);
            z-index: 1000;
            flex-direction: column;
            /* FAKTEN-ÄNDERUNG: 'center' zentriert das Kind-Element vertikal */
            justify-content: center; 
            /* 'center' zentriert das Kind-Element horizontal */
            align-items: center; 
            padding: 20px 0;
            box-sizing: border-box;
        }
        .upload-btn {
            width: 100%;
            padding: 10px;
            background: #54c96f; /* Grün signalisiert Aktion/Abschluss */
            border: none;
            border-radius: 6px;
            color: #fff;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.2s;
        }
        .upload-btn:hover {
            background: #1b6e2d;
        }


/* Container für die Formular-Elemente */
#uploadform {
    width: 50%;
    max-width: 500px; /* Verhindert ein zu breites Formular */
    box-sizing: border-box;
    padding: 30px;
    background: #1a1a1a; /* Dunkler Kontrast zum tiefschwarzen Overlay */
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Erzeugt gleichmäßige Abstände zwischen Elementen */
}

/* Styling für das Text-Input-Feld (Nutzername) */
#upload_name {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background: #2b2b2b;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}
#upload_name:focus {
    border-color: #007bff; /* Blauer Fokus-Rahmen */
}

/* Styling für das Datei-Input-Feld */
#upload_files {
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    background: #222;
    border: 2px dashed #444; /* Gestrichelter Rand signalisiert eine Dropzone */
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
}
#upload_files:hover {
    background: #282828;
    border-color: #007bff;
}

/* FAKTEN-METHODE: Styling des nativen "Datei auswählen"-Buttons */
#upload_files::file-selector-button {
    padding: 8px 16px;
    margin-right: 15px;
    background: #007bff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
#upload_files::file-selector-button:hover {
    background: #0056b3;
}

/* Styling für den Submit-Button */
.download-btn {
    width: 100%;
    padding: 14px;
    background: #28a745; /* Grün signalisiert Aktion/Abschluss */
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.download-btn:hover {
    background: #218838;
}

#file_list_preview {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    background: #111;
    border-radius: 4px;
}

#file_list_sum {
    margin-top: 10px;
    background: #461414;
    border-radius: 4px;
    display: none;
    color: #dfe9b5;
    padding: 8px;
}

.preview-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    font-size: 13px;
    color: #007bff;
    border-bottom: 1px solid #222;
}

.preview-file-item:last-child {
    border-bottom: none;
}

/* Der Löschen-Button */
.remove-file-btn {
    background: none;
    border: none;
    color: #dc3545; /* Rot für Löschen */
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.remove-file-btn:hover {
    color: #bd2130;
}

#loadingIndicator{

    display: none;
    width: 50%;
    max-width: 500px; /* Verhindert ein zu breites Formular */
    box-sizing: border-box;
    padding: 30px;
    background: #1a1a1a; /* Dunkler Kontrast zum tiefschwarzen Overlay */
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Erzeugt gleichmäßige Abstände zwischen Elementen */
    
    margin-top: 10px;  
} 



/*** SOLAR SPINNER****/

/*  by narmesh_sah */ 
.solar-system-container {
  perspective: 1500px;
  width: 100px;
  height: 100px;
  margin: 25px auto;
}

.solar-system {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: all 0.5s ease-out;
  animation: rotate-center 6s linear infinite;
}

.sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 30% 30%, #fff, #ffd700, #ffa500);
  border-radius: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  box-shadow: 0 0 20px #ffd700;
  transition: all 0.5s ease-out;
}

.earth-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) translateZ(-50px);
  transform-style: preserve-3d;
  transition: all 0.5s ease-out;
}

.earth {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 30% 30%, #4b9cd3, #1b4f72);
  border-radius: 50%;
  transform: translateX(-50%) translateZ(0);
  transform-style: preserve-3d;
  transition: all 0.5s ease-out;
}

.moon-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) translateZ(-10px);
  animation: rotate-orbit 2s linear infinite;
  transform-style: preserve-3d;
  transition: all 0.5s ease-out;
}

.moon {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  border-radius: 50%;
  transform: translateX(-50%) translateZ(0);
  transition: all 0.5s ease-out;
}

/* Hover Effects */
.solar-system-container:hover .solar-system {
  animation-play-state: paused;
  transform: rotateX(45deg) rotateY(-45deg);
}

.solar-system-container:hover .sun {
  transform: translate(-50%, -50%) translateZ(100px);
  box-shadow: 0 0 40px #ffd700;
}

.solar-system-container:hover .earth-orbit {
  transform: translate(-50%, -50%) translateZ(-100px) rotateX(75deg);
  border-color: rgba(255, 255, 255, 0.2);
}

.solar-system-container:hover .earth {
  transform: translateX(-50%) translateZ(20px);
  box-shadow: 0 0 15px rgba(75, 156, 211, 0.8);
}

.solar-system-container:hover .moon-orbit {
  transform: translate(-50%, -50%) translateZ(-120px) rotateX(75deg);
  border-color: rgba(255, 255, 255, 0.2);
}

.solar-system-container:hover .moon {
  transform: translateX(-50%) translateZ(10px);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Active state for even more depth */
.solar-system-container:active .solar-system {
  transform: rotateX(55deg) rotateY(-55deg);
}

.solar-system-container:active .sun {
  transform: translate(-50%, -50%) translateZ(150px);
  box-shadow: 0 0 50px #ffd700;
}

.solar-system-container:active .earth-orbit {
  transform: translate(-50%, -50%) translateZ(-150px) rotateX(85deg);
}

.solar-system-container:active .moon-orbit {
  transform: translate(-50%, -50%) translateZ(-180px) rotateX(85deg);
}

@keyframes rotate-orbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes rotate-center {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

