/* Estilos modernos para calculadoras e modais complexos */

/* SOBRESCREVER COMPLETAMENTE OS ESTILOS DO MODAL DE DOCUMENTOS MÉDICOS */
/* Esta regra tem prioridade máxima sobre qualquer outro CSS */
#document-modal,
#document-modal.document-modal,
#document-modal.modal-options,
.document-modal#document-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    z-index: 10000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    animation: fadeIn 0.3s ease !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#document-modal .document-modal-content,
.document-modal .document-modal-content {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3) !important;
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    transform: scale(0.95) !important;
    animation: modalSlideIn 0.4s ease forwards !important;
}

/* Tamanho maior no desktop */
@media (min-width: 768px) {
    #document-modal .document-modal-content,
    .document-modal .document-modal-content {
        width: 85% !important;
        max-width: 1400px !important;
    }
}

@keyframes modalSlideIn {
    to {
        transform: scale(1);
    }
}

#document-modal .document-modal-header,
.document-modal .document-modal-header {
    background: linear-gradient(135deg, #4a7424, #5a8a2f) !important;
    color: white !important;
    padding: 24px !important;
    position: relative !important;
    overflow: hidden !important;
}

.document-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    opacity: 0.3;
}

.document-modal-header h1 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.document-modal-header h1 i {
    font-size: 20px;
    opacity: 0.9;
}

.document-modal-subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    font-weight: 400;
    position: relative;
    font-style: italic;
}

/* Estilos maiores para desktop */
@media (min-width: 768px) {
    .document-modal-header h1 {
        font-size: 26px;
    }
    
    .document-modal-header h1 i {
        font-size: 24px;
    }
    
    .document-modal-subtitle {
        font-size: 14px;
    }
}

.close-document-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-document-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.document-modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

/* Corpo maior no desktop */
@media (min-width: 768px) {
    .document-modal-body {
        max-height: 75vh;
        padding: 32px;
        font-size: 15px;
    }
}

#document-modal-content {
    min-height: 200px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
    font-family: 'Roboto', sans-serif;
    white-space: pre-wrap;
}

/* Área de conteúdo maior no desktop */
@media (min-width: 768px) {
    #document-modal-content {
        min-height: 300px;
        max-height: 60vh;
        padding: 20px;
        font-size: 15px;
        line-height: 1.7;
    }
}

#document-modal-content:empty::before {
    content: "Carregando documento...";
    color: #6c757d;
    font-style: italic;
}

.document-modal-footer {
    background: #f8f9fa;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.document-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.document-modal-btn:not(.secondary) {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.document-modal-btn.secondary {
    background: #e9ecef;
    color: #495057;
}

.document-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estilos para calculadoras */
.calculator-modal .document-modal-content {
    max-width: 700px;
}

.calculator-form-container {
    padding: 0;
}

.calculator-info {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 4px solid #3498db;
    font-size: 14px;
    color: #2c3e50;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row .form-group[style*="width: 100%"] {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.radio-label:hover {
    background: rgba(52, 152, 219, 0.05);
}

.radio-label input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.calculator-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.calculator-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.calculate-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.reset-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.calculator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Resultados das calculadoras */
.calculator-result {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.calculator-result h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
}

.calculator-result h4 {
    color: #34495e;
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.risk-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.risk-level {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-level.baixo, .risk-level.normal {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.risk-level.medio, .risk-level.moderado {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.risk-level.alto, .risk-level.elevado {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.risk-value {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.risk-value span {
    color: #3498db;
}

.risk-interpretation,
.risk-recommendation {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.risk-interpretation:last-child,
.risk-recommendation:last-child {
    margin-bottom: 0;
}

/* Tabelas nas calculadoras */
.apgar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.apgar-table th,
.apgar-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.apgar-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apgar-table tr:last-child td {
    border-bottom: none;
}

.apgar-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Menu de opções forenses modernizado */
.forensic-menu-container {
    display: grid;
    gap: 8px;
    padding: 0;
}

.forensic-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.forensic-btn:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.forensic-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.forensic-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: white;
    border-color: #dee2e6;
}

/* Responsividade para modais */
@media (max-width: 768px) {
    .document-modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 1vh auto;
    }
    
    .document-modal-header {
        padding: 20px;
    }
    
    .document-modal-header h1 {
        font-size: 20px;
    }
    
    .document-modal-body {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .calculator-actions {
        flex-direction: column;
    }
    
    .document-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .document-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .document-modal-header {
        padding: 16px;
    }
    
    .document-modal-body {
        padding: 16px;
        max-height: calc(100vh - 160px);
    }
    
    .calculator-result {
        padding: 16px;
    }
}

/* Estilos específicos para elementos de entrada com placeholders */
input::placeholder,
select option:first-child {
    color: #95a5a6;
    font-style: italic;
}

/* Melhorias para scrollbar em modais */
.document-modal-body::-webkit-scrollbar {
    width: 6px;
}

.document-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.document-modal-body::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.document-modal-body::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Alertas e avisos especiais */
.risk-interpretation[style*="border: 1px solid #f44336"] {
    border-left: 4px solid #e74c3c !important;
    background: linear-gradient(135deg, #ffebee, #ffffff) !important;
}

.risk-interpretation[style*="border: 1px solid #f44336"] h4 {
    color: #e74c3c !important;
}

/* Transições suaves para mudanças de estado */
.form-group input:valid {
    border-color: #27ae60;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

/* Estilo para elementos desabilitados */
input:disabled,
select:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa !important;
    border-color: #e9ecef !important;
}

/* Melhorias visuais para campos obrigatórios */
.form-group label[for] {
    position: relative;
}

.form-group input[required] + label::after,
.form-group select[required] + label::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

/* Animações para feedback visual */
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

.calculate-btn:active {
    animation: successPulse 0.6s ease-out;
}

/* Melhorias para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 