/* css/components/_modal.css */
/* Enthält allgemeine Stile, die für ALLE Modals gelten. */

.modal-backdrop { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: var(--modal-backdrop); 
    display: none; 
    z-index: 9999; 
    justify-content: center; 
    align-items: center; 
}
.modal-backdrop.show { display: flex; }

.modal-content { 
    width: 600px; 
    max-height: 90vh; 
    background: var(--bg-modal); 
    border: 1px solid var(--border-color-dark); 
    padding: 0;
    box-shadow: 0 2px 8px var(--shadow-color); 
    position: relative; 
    border-radius: 16px;
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 18px 24px 2px 24px;
    flex-shrink: 0;
    background-color: var(--bg-modal-header);
    border-bottom: 1px solid var(--border-color-medium);
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left; /* KORREKTUR: Erzwingt linksbündige Ausrichtung */
}

.modal-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}

.modal-title-group {
    display: flex;
    flex-direction: column;
}

.modal-title { 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: var(--text-primary); 
    margin: 0;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-title[contenteditable="true"] { 
    text-decoration: underline; 
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    color: var(--text-link); 
    cursor: text; 
}

.modal-close-btn { 
    width: 32px; 
    height: 32px; 
    cursor: pointer; 
    border-radius: 50%;
    background-color: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    flex-shrink: 0;
    border: 1px solid var(--border-color-medium);
}
.modal-close-btn:hover {
    background-color: var(--bg-month-button-hover);
    transform: rotate(90deg);
}
.modal-close-btn svg { 
    stroke: var(--icon-color); 
    width: 20px; 
    height: 20px; 
    stroke-width: 2.5; 
}

.modal-body { 
    overflow-y: auto;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.5rem;
}
.modal-body label, .label-with-button > label { 
    display: block; 
    margin-bottom: 0.25rem; 
    font-weight: bold; 
}
.modal-footer { 
    margin-top: 1.5rem; 
    border-top: 1px solid var(--border-color-light); 
    padding: 1rem 1.5rem;
    flex-shrink: 0; 
}
.note-textarea { 
    min-height: 100px; 
    overflow: auto; 
    padding: 0.5rem; 
    border: 1px solid var(--border-color-dark); 
    border-radius: 4px; 
    background-color: var(--bg-input); 
}
.note-image-container { 
    margin-bottom: 1rem; 
    position: relative; 
    min-height: 100px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: var(--bg-body); 
    border-radius: 4px; 
    flex-shrink: 0; 
}
.modal-form-content {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px; 
}

.note-image, .note-video, .note-embed {
    max-width: 100%; 
    max-height: 300px; 
    width: auto; 
    object-fit: contain; 
    border-radius: 4px; 
}
.note-video, .note-embed { 
    width: 100%; 
    height: auto; 
    aspect-ratio: 16 / 9; 
}
.image-icon-overlay { 
    position: absolute; top: 8px; right: 8px; display: flex; gap: 8px; 
    background-color: rgba(0,0,0,0.5); border-radius: 10px; padding: 5px; 
    opacity: 0; transition: opacity 0.2s ease-in-out; 
}
.note-image-container:hover .image-icon-overlay { opacity: 1; }
.image-icon { cursor: pointer; color: var(--text-white); font-size: 1.3em; }
.image-icon:hover { transform: scale(1.1); }

.textarea-container { position: relative; }
.copy-text-icon { position: absolute; top: 8px; right: 8px; cursor: pointer; color: var(--icon-color); opacity: 0; transition: opacity 0.2s ease-in-out; }
.textarea-container:hover .copy-text-icon { opacity: 1; }
.copy-text-icon:hover { color: var(--icon-color-hover); }

.modal-buttons { 
    display: flex; 
    gap: 0.75rem; 
    align-items: center; 
    justify-content: flex-end; 
}
.generate-group { display: flex; align-items: center; } 
#modalCreateBtn, .generate-group, #modalGenerateVideoBtn, .publish-container { flex-grow: 1; }
#modalGenerateImageBtn { flex-grow: 1; }
.generate-group .modal-button { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.modal-button.freigegeben { background-color: var(--bg-freigegeben) !important; color: var(--text-freigegeben); font-weight: bold; }
.modal-button.freigegeben:hover { filter: brightness(1.1); }
@keyframes blinkBtn { 0%, 100% { background-color: #f88; } 50% { background-color: var(--bg-modal); } }
.blink { animation: blinkBtn 0.4s ease-in-out 3; }

.hidden-editor { display: none !important; }
#dialogMessage { white-space: pre-wrap; text-align: left; font-size: 0.9em; line-height: 1.5; }

.lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); display: none; justify-content: center; align-items: center; z-index: 10000;
}
.lightbox-overlay.show { display: flex; }
.lightbox-content { max-width: 90%; max-height: 90%; object-fit: contain; }
.lightbox-close {
    position: absolute; top: 20px; right: 30px; color: #fff; font-size: 40px;
    font-weight: bold; cursor: pointer; user-select: none;
}

#snapshotList {
    list-style: none;
    padding: 0;
    margin: 0;
}
.snapshot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color-light);
}
.snapshot-item:last-child {
    border-bottom: none;
}
.snapshot-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.snapshot-info .material-symbols-outlined {
    color: var(--text-tertiary);
}
.snapshot-info span {
    color: var(--text-secondary);
}