/**
 * Calculadora de Prazos Processuais v2.0
 * Estilos CSS
 */

/* ===== CONTAINER PRINCIPAL ===== */
.calc-prazos-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== CONTADOR DE CÁLCULOS ===== */
.calc-prazos-contador {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
}

.contador-icone {
    font-size: 24px;
    margin-right: 10px;
}

.contador-texto {
    font-size: 16px;
}

.contador-texto strong {
    font-size: 20px;
    font-weight: bold;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CABEÇALHO ===== */
.calc-prazos-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.calc-prazos-header h2 {
    color: #2c5282;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.calc-prazos-subtitle {
    color: #718096;
    font-size: 16px;
    margin-bottom: 20px;
}

.btn-ajuda {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-ajuda:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.icone-ajuda {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: white;
    color: #4299e1;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    margin-right: 5px;
    font-weight: bold;
}

/* ===== FORMULÁRIO ===== */
.calc-prazos-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.label-icon {
    margin-right: 8px;
    font-size: 18px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-help {
    color: #a0aec0;
    font-size: 12px;
    margin-top: 5px;
}

.info-ato {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    padding: 12px 15px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 14px;
    color: #2c5282;
    display: none;
}

.info-ato.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== BOTÕES ===== */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 150px;
}

.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== RESULTADO ===== */
.calc-prazos-resultado {
    margin-top: 40px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resultado-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 25px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.resultado-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.data-final-destaque {
    font-size: 36px;
    font-weight: bold;
    margin: 15px 0;
}

.resultado-info {
    background: white;
    padding: 25px;
    border: 2px solid #e2e8f0;
    border-top: none;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
}

.info-item-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 5px;
}

.info-item-value {
    font-size: 15px;
    color: #2d3748;
    font-weight: 600;
}

/* ===== TABELA DE CONTAGEM ===== */
.tabela-contagem {
    margin: 30px 0;
}

.tabela-contagem h4 {
    color: #2c5282;
    margin-bottom: 15px;
}

.tabela-contagem table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.tabela-contagem th {
    background: #2c5282;
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.tabela-contagem td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.tabela-contagem tr:last-child td {
    border-bottom: none;
}

.tabela-contagem tr:nth-child(even) {
    background: #f7fafc;
}

.tabela-contagem tr.excluido {
    background: #fed7d7 !important;
}

.tabela-contagem tr.excluido td {
    color: #742a2a;
}

.tabela-contagem tr.final {
    background: #feebc8 !important;
    font-weight: bold;
}

.tabela-contagem tr.final td {
    color: #c05621;
}

/* ===== OBSERVAÇÕES ===== */
.observacoes {
    background: #edf2f7;
    padding: 20px;
    border-left: 4px solid #4299e1;
    border-radius: 6px;
    margin: 20px 0;
}

.observacoes h4 {
    color: #2c5282;
    margin-top: 0;
    margin-bottom: 15px;
}

.observacoes ul {
    margin: 0;
    padding-left: 20px;
}

.observacoes li {
    margin: 8px 0;
    color: #4a5568;
}

/* ===== BOTÃO PDF ===== */
.btn-pdf {
    background: #e53e3e;
    color: white;
    margin-top: 20px;
}

.btn-pdf:hover {
    background: #c53030;
}

/* ===== MODAL DE AJUDA ===== */
.modal-ajuda {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-ajuda-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-ajuda-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-ajuda-close:hover {
    color: #4a5568;
}

.modal-ajuda-content h3 {
    color: #2c5282;
    margin-top: 0;
    margin-bottom: 20px;
}

.ajuda-secao {
    margin-bottom: 20px;
}

.ajuda-secao h4 {
    color: #4299e1;
    margin-bottom: 10px;
}

.ajuda-secao p {
    color: #4a5568;
    line-height: 1.6;
}

.ajuda-observacao {
    background: #fff5f5;
    border: 1px solid #fc8181;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.ajuda-observacao strong {
    color: #c53030;
}

.ajuda-observacao p {
    margin: 10px 0 0 0;
    color: #742a2a;
}

#btn-fechar-ajuda {
    width: 100%;
    margin-top: 20px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .calc-prazos-container {
        padding: 15px;
    }
    
    .calc-prazos-form {
        padding: 20px;
    }
    
    .calc-prazos-header h2 {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .tabela-contagem {
        overflow-x: auto;
    }
    
    .tabela-contagem table {
        font-size: 12px;
    }
    
    .tabela-contagem th,
    .tabela-contagem td {
        padding: 8px;
    }
    
    .modal-ajuda-content {
        margin: 20px;
        max-height: 90vh;
    }
}

/* ===== LOADING ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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