/* ==========================================================================
 * Chat Modal Overlay + Sendbird Modal (Vitima)
 * Extraido de: protected/views/layouts/main.php
 * ========================================================================== */

/* ===== ESTILOS DO MODAL (mantidos para compatibilidade) ===== */

/* Modal Overlay */
.chat-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-modal-overlay.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.chat-modal-container {
    background: #fff;
    width: 90%;
    max-width: 1600px;
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0);
    transform-origin: bottom right;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chat-modal-overlay.show .chat-modal-container {
    transform: scale(1);
    opacity: 1;
}

/* Modal Header */
.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.chat-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chat-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.chat-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.chat-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chat-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#chatModalContent {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#chatModalContent .container {
    flex: 1;
    height: 100%;
    overflow: hidden;
}

/* Loading Spinner */
.chat-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 768px) {
    .chat-modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: 100%;
    }

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

/* ========================== ESTILOS MODAL SENDBIRD (VITIMA) ========================== */
.sendbird-modal {
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
}

.sendbird-header {
    background: #580f0f;
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sendbird-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sendbird-header-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sendbird-header-text h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sendbird-header-subtitle {
    font-size: 13px;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
}

.sendbird-header .chat-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sendbird-header .chat-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sendbird-body {
    padding: 0;
    background: #f8f9fa;
    height: calc(100% - 88px);
    overflow: hidden;
}

.sendbird-body .chat-modal-loading {
    background: linear-gradient(135deg, #667eea11 0%, #764ba211 100%);
}

.sendbird-body #sendbirdModalContent {
    height: 100%;
    overflow: hidden;
}

/* Estilos responsivos para Sendbird */
@media (max-width: 768px) {
    .sendbird-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .sendbird-header {
        padding: 16px 20px;
    }

    .sendbird-header-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .sendbird-header-text h3 {
        font-size: 18px;
    }

    .sendbird-header-subtitle {
        font-size: 12px;
    }
}
