/* CSS-Variablen für bessere Wartbarkeit */
:root {
    --primary-color: #a80a0a;
    --secondary-color: #946a6f;
    --background-color: #f8f9fa;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Basis-Styles */
body {
    background-color: #f8f9fa;
}

/* Upload-Bereich */
.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #a80a0a;
    background-color: #f8f9fa;
}

/* Datei-Grid */
.file-grid {
    display: grid;
    gap: 15px;
    width: 100%;
}

/* Dynamische Grid-Layouts */
.file-grid[data-count="1"] {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.file-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin: 0 auto;
}

.file-grid:not([data-count="1"]):not([data-count="2"]) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Datei-Karten */
.file-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
    position: relative;
}

.file-card:hover {
    transform: translateY(-5px);
}

/* Vorschaubereich */
.preview-area {
    position: relative;
    padding-top: 75%;
    background: #f8f9fa;
    overflow: hidden;
}

.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Checkbox-Container */
.file-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgb(255 255 255 / 0%);
    padding: 3px;
    border-radius: 4px;
}

.file-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Datei-Informationen */
.file-info {
    padding: 1rem;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Filter-Bereich */
.filter-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Buttons für Mehrfachauswahl */
.bulk-actions {
    display: flex;
    gap: 10px;
}

/* Benachrichtigungen */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.notification {
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .file-grid:not([data-count="1"]) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .file-grid:not([data-count="1"]) {
        grid-template-columns: 1fr;
    }
}

/* Autocomplete */
.autocomplete-items {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
}

.autocomplete-items div:hover {
    background-color: #f8f9fa;
}

.autocomplete-active {
    background-color: #e9ecef !important;
}

/* Datei-Grid */
.file-grid {
    display: grid;
    gap: 15px;
    width: 100%;
}

/* Dynamische Grid-Layouts */
.file-grid[data-count="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.file-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.file-grid[data-count="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.file-grid[data-count="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.file-grid[data-count="5"],
.file-grid[data-count="6"],
.file-grid[data-count="7"],
.file-grid[data-count="8"],
.file-grid[data-count="9"],
.file-grid[data-count="10"],
.file-grid[data-count="11"],
.file-grid[data-count="12"],
.file-grid[data-count="13"],
.file-grid[data-count="14"],
.file-grid[data-count="15"] {
    grid-template-columns: repeat(5, 1fr);
}

.file-grid:not([data-count]) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}


/* Vorschau-Bereich */
.preview-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Upload-Bereich */
.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #a80a0a;
    background-color: #f8f9fa;
}

.drop-zone.drag-over {
    background-color: #e0f7ff; /* Leicht bläulicher Hintergrund beim Draggen */
}

.drop-zone .drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle at center, rgba(13,110,253,0.1), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.drop-zone.drag-over::after {
    opacity: 1;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

/* Animiertes Wolken-Icon */
.drop-zone .drop-zone-content i {
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Eingabefeld für Straße */
#streetInput {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#streetInput:focus {
    border-color: #a80a0a;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25);
}

/* Erfolgsnachricht */
#notificationContainer .alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hover-Effekt für die Drop-Zone */
.drop-zone:hover {
    background-color: #f0f8ff;
    border-color: #a80a0a;
}

/* Subtiler Effekt beim Klicken auf das Upload-Symbol */
.drop-zone .drop-zone-content i {
    transition: transform 0.3s ease;
}

.drop-zone:active .drop-zone-content i {
    transform: scale(0.95);
}

/* Anpassung des Upload-Bereichs */
.upload-section .card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.upload-section .card-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Eingabefeld-Highlight */
#streetInput {
    border-radius: 30px;
    padding: 10px 20px;
}

#streetInput:focus {
    border-color: #a80a0a;
    outline: none;
    box-shadow: 0 0 5px rgba(13,110,253,0.5);
}

/* Anpassung der Schriftarten */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Anpassung der Buttons */
.btn-primary {
    background-color: #a80a0a;
    border-color: #a80a0a;
}

.btn-primary:hover {
    background-color: #946a6f;
    border-color: #946a6f;
}

.btn-primary:active {
    background-color: #946a6f;
    border-color: #946a6f;
}

.btn-check:checked+.btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check)+.btn:active {
    background-color: #946a6f;
    border-color: #946a6f;
}
.form-control:focus {
    border-color: #946a6f;
    box-shadow: 0 0 0 .25rem #a80a0a66;
}

.btn-outline-danger {
    --bs-btn-color: #a80a0a;
    --bs-btn-border-color: #a80a0a;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #a80a0a;
    --bs-btn-hover-border-color: #a80a0a;
    --bs-btn-focus-shadow-rgb: 220, 53, 69;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a80a0a;
    --bs-btn-active-border-color: #a80a0a;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #a80a0a;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #a80a0a;
    --bs-gradient: none;
}

/* Anpassung der Benachrichtigung */
.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}
/* Sicherstellen, dass der Navbar-Text und der Logout-Button immer auf einer Linie bleiben */
.navbar .navbar-brand,
.navbar .navbar-text {
    display: flex;
    align-items: center;
}

/* Kleinere Anpassungen an das Logo, falls nötig */
.navbar .navbar-brand img {
    width: 30px; /* Größe des Logos kann hier angepasst werden */
    height: auto;
    margin-right: 10px;
}

/* Optional: Etwas mehr Platz zwischen Logo und Logout-Button */
.container.d-flex.justify-content-between.align-items-center {
    gap: 20px;
}

.navbar-text a:hover {
    color: #fff;
}

/* Smooth Transitions für Buttons */
.btn {
    transition: all 0.3s ease;
}

/* Hover-Animation für File-Cards */
.file-card {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Loading-Animation für Upload */
.uploading {
    position: relative;
    pointer-events: none;
}

.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .bulk-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .file-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}
/* Galerie-Navigation */
.gallery-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.btn-gallery {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.3s ease;
}

.btn-gallery:hover {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.btn-gallery.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.btn-gallery.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.modal-image-container {
    position: relative;
    text-align: center;
}

.modal-image-container img {
    max-height: 80vh;
    width: auto;
    margin: auto;
}

/* Modal Styles */
.modal-dialog {
    max-width: 90vw; /* Maximale Breite des Modals */
    margin: 1.75rem auto;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-header {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: none;
    color: white;
}

.modal-body {
    padding: 0;
    position: relative;
    height: calc(90vh - 120px); /* Höhe des Modals minus Header */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
}

.gallery-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.btn-gallery {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.3s ease;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-gallery:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.modal-header .btn-close {
    color: white;
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Performance-Optimierte Animationen */
.file-card {
    transform: translateZ(0);
    will-change: transform;
}

/* Verbesserte Mobile-Ansicht */
@media (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .file-info {
        font-size: 0.9rem;
    }
}
