/**
 * CSS ISOLADO - Modal Registro de Dor
 * ESCOPO: Apenas #modalRegistroDor - NÃO afeta resto do site
 */

/* ==================================
   DISPLAY DA INTENSIDADE
   ================================== */
#modalRegistroDor #intensidadeDisplay {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==================================
   SLIDER CUSTOMIZADO
   ================================== */
#modalRegistroDor #intensidadeDor {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #509073 0%, #f59e0b 50%, #dc2626 100%);
    border-radius: 4px;
    outline: none;
}

#modalRegistroDor #intensidadeDor::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #509073;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#modalRegistroDor #intensidadeDor::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #509073;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#modalRegistroDor #intensidadeDor::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#modalRegistroDor #intensidadeDor::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* ==================================
   SCROLLBAR CUSTOMIZADO
   ================================== */
#modalRegistroDor .max-h-96::-webkit-scrollbar {
    width: 8px;
}

#modalRegistroDor .max-h-96::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#modalRegistroDor .max-h-96::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#modalRegistroDor .max-h-96::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================================
   ANIMAÇÕES
   ================================== */
#modalRegistroDor .transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Fade in do modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale in do conteúdo */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#modalRegistroDor:not(.hidden) {
    animation: fadeIn 0.2s ease-out;
}

#modalRegistroDor:not(.hidden) > div > div {
    animation: scaleIn 0.2s ease-out;
}

/* ==================================
   LOADER SPINNER
   ================================== */
#modalRegistroDor #btnSubmitLoader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================================
   TOAST ANIMATION
   ================================== */
#modalRegistroDor #toastCopiado {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================================
   FOCUS STATES (Acessibilidade)
   ================================== */
#modalRegistroDor input:focus,
#modalRegistroDor select:focus,
#modalRegistroDor textarea:focus {
    outline: none;
    border-color: #509073;
    box-shadow: 0 0 0 3px rgba(80, 144, 115, 0.1);
}

#modalRegistroDor button:focus-visible {
    outline: 2px solid #509073;
    outline-offset: 2px;
}

/* ==================================
   RADIO BUTTONS CUSTOMIZADOS
   ================================== */
#modalRegistroDor input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

#modalRegistroDor input[type="radio"]:checked {
    border-color: #509073;
    background-color: #509073;
}

#modalRegistroDor input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* ==================================
   CHECKBOXES CUSTOMIZADOS
   ================================== */
#modalRegistroDor input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

#modalRegistroDor input[type="checkbox"]:checked {
    border-color: #509073;
    background-color: #509073;
}

#modalRegistroDor input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* ==================================
   DISCLAIMER PROGRESS BAR
   ================================== */
#modalRegistroDor #disclaimerProgressBar {
    transition: width 1s linear;
}

/* Cronômetro com animação pulsante */
#modalRegistroDor #disclaimerCounter {
    animation: pulse-counter 1s ease-in-out infinite;
}

@keyframes pulse-counter {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Botão copiar protocolo */
#modalRegistroDor #btnCopiarProtocolo {
    transition: all 0.2s ease;
}

#modalRegistroDor #btnCopiarProtocolo:hover {
    transform: scale(1.1);
}

/* ==================================
   RESPONSIVE
   ================================== */
@media (max-width: 768px) {
    #modalRegistroDor > div > div {
        max-height: 90vh;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    #modalRegistroDor .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* ==================================
   PRINT STYLES (Copiar registro)
   ================================== */
@media print {
    #modalRegistroDor #estadoFormulario {
        display: none !important;
    }
    
    #modalRegistroDor #estadoResposta {
        display: block !important;
    }
}
