/* Backdrop unsichtbar machen */
.modal-backdrop {
    display: none !important; /* Verhindert das Erscheinen des Backdrops */
}

/* Galerie-Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18%, 1fr));
    gap: 2px;
    margin-top: 10px;
    grid-auto-flow: dense;
    padding: 1px;
    transition: all 0.5s ease-in-out;
}

/* Galerie-Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    opacity: 0; /* Startet unsichtbar für Fade-In */
    transform: translateY(20px); /* Leichter Versatz für Animation */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Am Ende der CSS-Datei hinzufügen */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item.verstecken {
    opacity: 0;
    transform: scale(0.2);
    pointer-events: none;
}

/* Interaktionsleiste */
.interaction-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    color: var(--interaction-bar-color);
    font-size: 0.9rem;
    opacity: 0.5;
    border-radius: 0 0 8px 8px;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .interaction-bar {
    opacity: 0.8;
}

.interaction-bar button {
    color: var(--interaction-bar-color);
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.interaction-bar button:hover {
    color: var(--theme-color);
}

/* Like-Button */
.like-button {
    display: flex;
    align-items: center;
    padding-right: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    font-size: 1rem;
    cursor: pointer;
}

.like-button:hover {
    background: rgba(255, 0, 0, 0.8);
}

.like-button .like-count {
    margin-left: 5px;
}

/* Löschen-Button */
.delete-media-button {
    display: none;
    background-color: var(--theme-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}



.delete-media-button:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2);
    background-color: #ff6b81;
}

/* Plus-Kachel */
.add-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--accent-color);
    background-color: rgba(255, 245, 230, 0.5);
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.add-photo:hover {
    background: rgba(249, 185, 177, 0.3);
    transform: scale(1.02);
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
    background: conic-gradient(var(--theme-color) 0%, lightgray 0%);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z" fill="white"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z" fill="white"/></svg>');
    mask-size: cover;
    -webkit-mask-size: cover;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    transition: background 0.3s ease;
}




/* Modal-Container */
.modal-container {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-container.show {
    display: flex;
}

.modal-item {
    flex-shrink: 0;
    scroll-snap-align: start;
    height: 100vh;
    width: 100%;
    display: flex;
    transition: opacity 0.5s ease-in-out;
}

.modal-item.verstecken {
    display: none;
    opacity: 0;
}

.modal-item.visible {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding-bottom: calc(env(safe-area-inset-bottom) + 60px);
}

.media-container {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 95%;
    overflow: hidden;
}

.media-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.back-button {
    position: absolute;
    top: 60px;
    left: 20px;
    font-size: 1.2rem;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 150;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease, transform 0.2s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.8);
    color: black;
    transform: scale(1.1);
}


/* Collection-Modal */
.assign-collection-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.assign-collection-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.assign-close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

.assign-close-modal:hover {
    color: var(--theme-color);
}

.assign-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.assign-image-grid img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.assign-image-grid img.selected {
    border-color: var(--theme-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.8);
}

.assign-collection-select {
    margin-top: 20px;
    text-align: center;
}

#assign-collection-select {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
}

.assign-save-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--theme-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.assign-save-button:hover {
    background-color: #0056b3;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(20%, 1fr));
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(25%, 1fr));
    }
}

/* Fortschritts-Anzeige */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Fortschritts-Herz */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
    background: conic-gradient(#f0394d 0%, lightgray 0%);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z" fill="white"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z" fill="white"/></svg>');
    mask-size: cover;
    -webkit-mask-size: cover;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    transition: background 0.3s ease;
}

/* "+" Symbol */
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: bold;
    color: #000000;
    text-align: center;
    transition: color 0.2s ease;
}

/* Upload-Text */
.upload-text {
    font-size: 0.6rem;
    font-weight: bold;
    color: #090500;
    margin-top: 8px;
}
