.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: var(--space-l);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 900px;
    width: 90%;
    animation: slideInModal 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-l);
    padding-bottom: var(--space-s);
    border-bottom: 2px solid var(--color-medium-grey);
    width: 100%;
}

.modal-header h2 {
    color: var(--color-main);
    margin: 0;
}

.modal-body {
    padding-top: var(--space-s);
    overflow-y: auto;
    max-height: 70vh;
}

.close-modal-button {
    position: absolute;
    top: -50px;
    right: 0px;
    color: white;
    background: var(--color-second);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: normal;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1010;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: none;
    padding: 0;
}

.close-modal-button:hover {
    background-color: var(--color-accent);
    color: white;
}

.close-modal-button svg {
  width: 1.5rem; /* Bestimmt die Icon-Größe */
  height: 1.5rem;
  transition: color 0.2s; /* Sorgt für einen sanften Hover-Effekt */
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 90%;
        padding: var(--space-l) var(--space-s);
    }

    .close-modal-button {
        top: -40px;
        right: 0px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}