﻿    
/* ======================================== */
/*                 Modal                   */
/* ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
   
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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


.modal {
    overflow: visible;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    width: min(100vw, var(--modal-w, 700px));
    max-height: min(100dvh, 90vh);
    min-width: 250px;
    background: var(--body-bg);
    color: var(--text-color);
}

.modal--sm {
    --modal-w: 420px;
}

.modal--md {
    --modal-w: 600px;
}

.modal--lg {
    --modal-w: 1100px;
    height:820px;
    max-height:95vH;
    
  
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5px 0px 20px;
    border-radius: 8px 8px 0 0;
    background: var(--primary);
}

.modal-header .hFlex {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.modal-header .hFlex h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.modal-header .help-button {
    background: transparent;
    border: none;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0.8;
    margin-left: auto;
    flex-shrink: 0;
}

.modal-header .help-button:hover {
    opacity: 1;
}

.modal-header .help-button i {
    font-size: 1.2rem;
}

.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    line-height:normal;
    font-size: var(--font-size);
}

.modal-footer {
    padding: 10px 20px 10px 20px;
    border-top:1px solid var(--gray-300);
    gap: 15px;
    display: flex;
    justify-content: space-between;
}

.modal-footer-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .modal-footer-right .btn {
        min-width: 80px;
    }

/* Vollbild für md & lg auf kleinen Screens :) */
@media (max-width: 1000px) {
    .modal:not(.modal--sm) {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        
    }

    .modal-footer {
        padding: 10px 5px 10px 5px;
        border-top: 1px solid var(--gray-300);
        gap: 15px;
        display: flex;
    }

    /* kein Vollbild für das kleine Modal ;( */
    .modal--sm {
        width: min(calc(100vw - 32px), var(--modal-w, 420px));
        height: auto;
        max-height: min(100dvh, 90dvh);
        border-radius: var(--border-radius);
    }

    .modal-header {
        border-radius: 0;
    }
}

@media (max-width: 400px) {
    .modal-body {
        padding:10px 5px;
    }

    .modal-footer {
        padding: 10px 5px 10px 5px;
        border-top: 1px solid var(--gray-300);
        gap: 15px;
        display: flex;
    }
}

    .no-overflow {
        overflow: hidden !important;
        padding: 0;
    }





