/* css/modals.css - CORE FRAMEWORK */

/* --- 1. OVERLAY & CONTAINER --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.open { display: flex; opacity: 1; }

.modal-content {
    background: #1c1c1e;
    width: 95%; max-width: 1000px;
    height: 90vh; max-height: 850px;
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,1);
    border: 1px solid #333;
    display: flex; flex-direction: column;
    overflow: hidden;
}

/* --- 2. HEADER STRUKTUR --- */
.modal-header-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #333;
    flex-shrink: 0;
}
.modal-title h2 { margin: 0; font-size: 1.5rem; color: #fff; }

.close-btn {
    background: #2c2c2e; color: #fff; border: none;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: #e74c3c; transform: rotate(90deg); }

/* --- 3. SCROLL AREA (Der flexible Mittelteil) --- */
.modal-scroll-area {
    flex-grow: 1;
    overflow-y: auto; overflow-x: hidden;
    padding-right: 5px; margin-bottom: 10px;
}
/* Scrollbar Styling */
.modal-scroll-area::-webkit-scrollbar { width: 6px; }
.modal-scroll-area::-webkit-scrollbar-track { background: transparent; }
.modal-scroll-area::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* --- 4. FOOTER (Buttons + Datum) --- */
.modal-footer-row {
    position: relative;
    display: flex; justify-content: center; align-items: center;
    border-top: 1px solid #333; padding-top: 15px; margin-top: auto;
    flex-shrink: 0; width: 100%; min-height: 70px;
}

/* Tage-Buttons Container */
.day-selector-wrapper {
    display: flex; gap: 8px; overflow-x: auto;
    padding-bottom: 5px; justify-content: center; width: 100%;
    scrollbar-width: none;
}
.day-selector-wrapper::-webkit-scrollbar { display: none; }

/* Basis Button Style */
.day-btn {
    background: #2c2c2e; border: 1px solid #444; color: #888;
    padding: 8px 10px; border-radius: 12px; cursor: pointer;
    transition: all 0.2s ease; min-width: 60px;
    text-align: center; display: flex; flex-direction: column;
    align-items: center; gap: 3px; flex-shrink: 0;
}
.day-btn:hover { background: #3a3a3c; border-color: #666; }
.day-btn.active {
    background: #f1c40f; color: #000; border-color: #f1c40f;
    transform: translateY(-2px); box-shadow: 0 5px 15px rgba(241, 196, 15, 0.2);
}
.day-btn span.d-name { font-size: 0.7rem; text-transform: uppercase; font-weight: bold; }
.day-btn span.d-date { font-size: 0.9rem; font-weight: bold; color: #ccc; }
.day-btn.active span.d-date { color: #000; }

/* Datumswähler rechts */
.footer-date-container {
    position: absolute; right: 0; top: 50%; transform: translateY(-40%);
    display: flex; flex-direction: column; align-items: center;
    padding-left: 15px; background: #1c1c1e; z-index: 10;
}
.footer-date-label {
    font-size: 0.65rem; color: #fff; font-weight: bold;
    text-transform: uppercase; margin-bottom: 4px; letter-spacing: 1px;
}
.date-picker-footer {
    background: #222; border: 1px solid #444; color: #fff;
    padding: 8px; border-radius: 10px; font-family: inherit; font-size: 0.9rem;
    cursor: pointer; outline: none; width: 40px; text-align: center; transition: 0.2s;
}
.date-picker-footer:hover { border-color: #f1c40f; background: #2c2c2e; }
.date-picker-footer::-webkit-calendar-picker-indicator { filter: invert(1); width: 100%; height: 100%; cursor: pointer; }


/* --- RESPONSIVE CORE --- */
@media (max-width: 768px) {
    .modal-content { width: 100%; height: 100%; max-height: 100vh; border-radius: 0; padding: 15px; border: none; }

    .modal-footer-row {
        position: relative; justify-content: space-between; padding-bottom: 25px; gap: 5px;
    }
    .day-selector-wrapper { justify-content: flex-start; padding-right: 10px; }
    .footer-date-container {
        position: relative; right: auto; top: auto; transform: none;
        border-left: 1px solid #333; background: transparent; padding-left: 10px;
    }
}
@media (min-width: 1000px) {
    .modal-content { max-width: 1200px; height: 95vh; }
    .date-picker-footer { width: auto; }
}