/* ===== UI COMPONENTS - MODAL CONTENT ===== */

/* ===== UNIVERSAL MODAL OVERLAY ===== */
/* 
 * Stilul universal pentru overlay-ul modalelelor
 * Folosit în: toate modalele create prin createBaseModal
 */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

/* ===== HIGHEST Z-INDEX FOR DELETE AND RENAME MODALS ===== */
#delete-conversation-modal,
#rename-conversation-modal {
    z-index: 9999999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== FORCE VISIBILITY WHEN DISPLAYED ===== */
#delete-conversation-modal[style*="display: flex"],
#rename-conversation-modal[style*="display: flex"] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== LOWER Z-INDEX FOR CONVERSATION MANAGER ===== */
#conversation-manager-modal {
    z-index: 999999 !important;
}

/* ===== UNIVERSAL MODAL CONTENT ===== */
/* 
 * Stilul universal pentru conținutul modalelelor
 * Folosit în: conversation-manager, rename-modal, delete-modal, etc.
 */

.modal-content {
    background: var(--modal-bg, var(--header-glass-bg));
    border: 2px solid var(--modal-border-color, var(--header-glass-border));
    border-radius: 16px;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 20px 60px var(--modal-shadow, rgba(0, 0, 0, 0.5)) !important;
    backdrop-filter: blur(var(--header-glass-blur));
    overflow: hidden !important;
}

/* Modal Body - Universal padding and overflow */
.modal-body {
    padding: 16px;
    overflow: hidden;
    max-height: calc(80vh - 120px); /* Account for header and footer */
    overflow-y: auto;
}

/* Modal Content specific for rename operations */
.rename-conversation-content {
    overflow: hidden;
}

.rename-conversation-content .modal-body {
    padding: 16px;
    overflow: hidden;
}

/* Modal Content specific for delete operations */
.delete-conversation-content {
    overflow: hidden;
}

.delete-conversation-content .modal-body {
    padding: 16px;
    overflow: hidden;
}

/* Modal Content specific for conversation manager */
.conversation-manager-content {
    overflow: hidden;
}

.conversation-manager-content .modal-body {
    padding: 16px;
    overflow: hidden;
}

/* Modal Content specific for task manager */
.task-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    will-change: transform;
    background: var(--task-modal-bg, var(--header-glass-bg));
    box-shadow: 
        0 0 40px var(--task-modal-shadow-color, rgba(0, 212, 255, 0.3)),
        inset 0 0 20px var(--task-modal-inset-shadow, rgba(0, 212, 255, 0.1));
    backdrop-filter: blur(var(--header-glass-blur));
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Category Modal Overlay - Specific for category details */
.category-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--category-modal-overlay-bg, rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000 !important;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.category-modal-overlay.closing {
    animation: modalFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.category-modal-container {
    background: var(--category-modal-bg, var(--header-glass-bg)) !important;
    border: 1px solid var(--category-modal-border, var(--header-glass-border)) !important;
    border-radius: 20px;
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1000001 !important;
    box-shadow: 0 25px 50px var(--category-modal-shadow, rgba(0, 0, 0, 0.6)) !important;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
}

.category-modal-overlay:not(.closing) .category-modal-container {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.category-modal-overlay.closing .category-modal-container {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* Category Modal Header - Folosește stilurile din ui-components/header.css */
/* .category-modal-header este definit în ui-components/header.css */

/* Category Modal Content - Folosește stilurile din task-modal-content */
.category-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    will-change: transform;
    background: var(--category-content-bg, var(--header-glass-bg)) !important;
    box-shadow: 
        0 0 40px var(--category-content-shadow-color, rgba(0, 212, 255, 0.3)) !important;
        inset: 0 0 20px var(--category-content-inset-shadow, rgba(0, 212, 255, 0.1)) !important;
    backdrop-filter: blur(var(--header-glass-blur));
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    height: calc(90vh - 80px);
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Specificitate pentru tema producători */
body.theme-producatori .category-modal-content,
body.theme-content-creator .category-modal-content {
    background: linear-gradient(135deg, var(--category-content-bg-start, rgba(13, 13, 23, 0.98)) 0%, var(--category-content-bg-end, rgba(27, 28, 36, 0.99)) 100%) !important;
    box-shadow: 
        0 0 40px var(--category-content-shadow-color, rgba(102, 126, 234, 0.3)) !important;
        inset: 0 0 20px var(--category-content-inset-shadow, rgba(102, 126, 234, 0.1)) !important;
}

/* Specificitate pentru tema programatori */
body.theme-programatori .category-modal-content {
    background: linear-gradient(135deg, var(--category-content-bg-start, rgba(10, 11, 20, 0.98)) 0%, var(--category-content-bg-end, rgba(15, 20, 25, 0.99)) 100%) !important;
    box-shadow: 
        0 0 40px var(--category-content-shadow-color, rgba(0, 212, 255, 0.3)) !important;
        inset: 0 0 20px var(--category-content-inset-shadow, rgba(0, 212, 255, 0.1)) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw !important;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 12px;
        max-height: calc(90vh - 100px);
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98vw !important;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 10px;
        max-height: calc(95vh - 80px);
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .modal-content {
    border: 2px solid var(--text-cyan);
        background: rgba(15, 20, 25, 0.95);
    }
    
    .modal-body {
        background: rgba(0, 0, 0, 0.3);
    }
} 