/* Modal-Stile */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Breite Variante für den Workout-Editor */
.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
}

/* Scrollbarer Inhaltsbereich */
.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px;
    margin-right: -15px;
}

.modal-close-btn {
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
}

.modal-search input {
    width: 100%;
    padding: 0.75em;
    margin-bottom: 1em;
    font-size: 1.1em;
    box-sizing: border-box;
}

.modal-results {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.modal-results li {
    padding: 0.75em 1em;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    margin-top: 1.5em;
    flex-shrink: 0;
    border-top: 1px solid #e9ecef;
    padding-top: 1.5em;
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
}

/* Detail-Modal breiter machen */
#event-details-modal .modal-content {
    max-width: 700px;
}

@media (max-width: 900px) {
    #event-details-modal .modal-content {
        max-width: 90vw;
    }
}

/* ================================================================= */
/* Bootstrap-Modal-Overrides                                           */
/* ================================================================= */

.modal-dialog { max-width: 800px; }
@media (min-width: 992px) {
    .modal-lg { max-width: 800px; }
    .modal-xl { max-width: 1140px; }
}
.modal-footer { flex-wrap: wrap; }

/* ================================================================= */
/* Kontextmenü (Rechtsklick im Kalender/Planeditor)                   */
/* ================================================================= */

.context-menu {
    position: fixed;
    z-index: 2000;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
}
.context-menu ul { list-style: none; padding: 5px 0; margin: 0; }
.context-menu li { padding: 8px 15px; cursor: pointer; font-size: 0.9em; }
.context-menu li:hover { background-color: #007bff; color: white; }
.context-menu li.separator {
    height: 1px;
    background-color: #eee;
    padding: 0;
    margin: 5px 0;
    cursor: default;
}
.context-menu li.separator:hover { background-color: #eee; }

/* ================================================================= */
/* Modal-Tabs (Ausfallzeit-Modal und ähnliche)                        */
/* ================================================================= */

.modal-tabs { display: flex; border-bottom: 1px solid #dee2e6; margin-bottom: 1.5em; }
.tab-btn { background: none; border: none; padding: 0.75em 1em; cursor: pointer; color: #6c757d; font-weight: 600; }
.tab-btn.active { color: #007bff; border-bottom: 2px solid #007bff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ================================================================= */
/* Stimmungs-Buttons (Trainingstagebuch-Modal)                        */
/* ================================================================= */

.mood-btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.2s ease-in-out;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}
.btn-check:checked + .mood-btn,
.mood-btn:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-check:checked + .btn-outline-success {
    background-color: #198754 !important;
    color: white !important;
    border-color: #198754 !important;
}
.btn-check:checked + .btn-outline-warning {
    background-color: #ffc107 !important;
    color: black !important;
    border-color: #ffc107 !important;
}
.btn-check:checked + .btn-outline-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

@media (max-width: 768px) {
    .mood-btn { height: 36px; }
    .mobile-compact-textarea { height: 50px !important; min-height: 50px !important; }
    .mobile-compact-list { max-height: 105px !important; }
}
