/* ==================== MODAL DE DENÚNCIA ==================== */

/* Overlay do modal */
.modal-denuncia-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000; /* Garantir que fique acima de tudo */
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Inicialmente não interceptar eventos */
}

/* Classe para bloquear scroll do corpo quando modal está aberto */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
    -webkit-overflow-scrolling: none;
    position: relative; /* Garantir que o scroll não afete o corpo */
}

/* Classe para criar um pseudo-overlay que previne interação com o fundo */
.scroll-blocker {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: transparent; /* Sem cor de fundo */
}

body.modal-open .scroll-blocker {
    display: block;
}

.modal-denuncia-overlay.show {
    display: flex;
    opacity: 1;
    touch-action: none; /* Prevenir scroll em dispositivos touch */
    box-sizing: border-box; /* Garantir que o padding não afete as dimensões */
    pointer-events: all; /* Permitir interação quando visível */
}

/* Container do modal */
.modal-denuncia {
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    width: 85%;
    max-width: 360px;
    max-height: 85vh;
    margin: 20px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-denuncia-overlay.show .modal-denuncia {
    transform: scale(1);
}

/* Header do modal */
.modal-denuncia-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.modal-denuncia-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    padding-right: 40px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.modal-denuncia-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-denuncia-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Body do modal */
.modal-denuncia-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

/* Seção do motivo */
.denuncia-section {
    margin-bottom: 20px;
}

.denuncia-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: block;
}

/* Dropdown de motivo */
.motivo-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #374151;
    background: white;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
}

.motivo-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.motivo-dropdown option {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #374151;
    padding: 8px;
}

/* Campo de especificação */
.especifica-container {
    margin-top: 12px;
    display: none;
}

.especifica-container.show {
    display: block;
}

.especifica-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #374151;
    background: white;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 80px;
}

.especifica-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.especifica-input::placeholder {
    color: #9ca3af;
}

/* Seção de descrição */
.descricao-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #374151;
    background: white;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 100px;
}

.descricao-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.descricao-textarea::placeholder {
    color: #9ca3af;
}

/* Footer do modal */
.modal-denuncia-footer {
    padding: 20px 24px 24px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.btn-denuncia {
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    text-align: center;
}

.btn-cancelar {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-cancelar:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-enviar {
    background: #dc2626;
    color: white;
}

.btn-enviar:hover {
    background: #b91c1c;
}

.btn-enviar:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-denuncia {
        width: 90%;
        margin: 10px;
        max-height: 90vh;
        max-width: 340px;
    }
    
    .modal-denuncia-header {
        padding: 20px 20px 16px 20px;
    }
    
    .modal-denuncia-title {
        font-size: 1.1rem;
        padding-right: 35px;
    }
    
    .modal-denuncia-close {
        top: 16px;
        right: 16px;
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    .modal-denuncia-body {
        padding: 20px;
        max-height: 60vh;
    }
    
    .modal-denuncia-footer {
        padding: 16px 20px 20px 20px;
        /* Mantendo na mesma direção em todos os dispositivos */
        flex-direction: row;
    }
    
    .btn-denuncia {
        width: 50%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .motivo-option label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-denuncia {
        width: 98%;
        margin: 5px;
    }
    
    .modal-denuncia-header {
        padding: 16px 16px 12px 16px;
    }
    
    .modal-denuncia-title {
        font-size: 1rem;
        padding-right: 30px;
    }
    
    .modal-denuncia-body {
        padding: 16px;
    }
    
    .modal-denuncia-footer {
        padding: 12px 16px 16px 16px;
    }
    
    .denuncia-section {
        margin-bottom: 20px;
    }
    
    .denuncia-label {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
}

/* Animação de loading no botão */
.btn-enviar.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn-enviar.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
