/* WP Rescisão Calculator Styles */

.wp-rescisao-calculator-form {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wp-rescisao-calculator-form h2 {
    color: #1a202c;
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 700;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 0;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

#btn-calcular {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
}

#btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.3);
}

#btn-calcular:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
}

/* Results Section */
#rescisao-results {
    margin-top: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

#rescisao-results h3 {
    color: #1a202c;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

/* Total Líquido Destacado */
.total-liquido {
    font-size: 1.6rem;
    font-weight: 700;
    border-left: 4px solid #007cba;
    padding: 20px;
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.total-icon {
    font-size: 2rem;
}

.total-label {
    color: #2d3748;
}

.total-value {
    color: #007cba;
    margin-left: auto;
}

/* Grid 2 Colunas para Verbas */
.grid-2 {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.verbas {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Layout Mobile Otimizado - Remove cards e usa layout linear */
@media (max-width: 767px) {
    .grid-2 {
        display: block;
        gap: 0;
    }
    
    .verbas {
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 25px;
    }
    
    .verbas:last-child {
        margin-bottom: 0;
    }
}

.verbas h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Títulos mais destacados no mobile sem cards */
@media (max-width: 767px) {
    .verbas h4 {
        font-size: 1.1rem;
        padding: 12px 16px;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-radius: 8px;
        border-left: 4px solid #007cba;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .verbas.deducoes h4 {
        border-left-color: #b00020;
    }
}

.verbas ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.verbas li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.verbas li:last-child {
    border-bottom: none;
}

/* Layout otimizado para mobile */
@media (max-width: 767px) {
    .verbas li {
        padding: 16px 20px;
        background: white;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        margin-bottom: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    
    .verbas li:last-child {
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 0;
    }
}

.verba-nome {
    font-weight: 500;
    color: #4a5568;
}

.verba-valor {
    font-weight: 600;
    color: #007cba;
    text-align: right;
    word-break: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
}

/* Melhor tipografia no mobile */
@media (max-width: 767px) {
    .verba-nome {
        font-size: 15px;
        font-weight: 600;
        color: #2d3748;
        line-height: 1.4;
        width: 100%;
    }
    
    .verba-valor {
        font-size: 18px;
        font-weight: 700;
        text-align: left;
        width: 100%;
        margin-top: 4px;
    }
}

/* Deduções com estilo diferenciado */
.verbas.deducoes li {
    opacity: 0.95;
}

.verbas.deducoes li .verba-valor {
    color: #b00020;
}

/* IA Response Card */
.ia-resposta {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%) !important;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #007cba;
    margin-bottom: 30px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ia-resposta h4 {
    color: #1a202c;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ia-resposta p {
    color: #2d3748;
    line-height: 1.6;
    margin: 0;
    font-size: 16px;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #f7fafc;
    color: #2d3748;
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-style: italic;
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #e53e3e;
}

.error-field {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-rescisao-calculator-form {
        margin: 10px;
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .total-liquido {
        font-size: 1.3rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .total-value {
        margin-left: 0;
    }
    
    .export-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-secondary {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .wp-rescisao-calculator-form {
        margin: 8px;
        padding: 18px;
    }
}

/* Animation for results */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

#rescisao-results {
    animation: fadeInUp 0.6s ease-out;
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}



/* IA Error State */
.ia-error {
    color: #d69e2e !important;
    font-style: italic;
    opacity: 0.9;
}

/* Improved button states */
#btn-calcular:disabled .btn-text {
    display: none;
}

#btn-calcular:disabled .btn-loader {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

/* Enhanced loading states */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Better error styling */
.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success state for results */
#rescisao-results.success {
    border-left: 4px solid #48bb78;
}

#rescisao-results.success h3::before {
    content: "✅ ";
    margin-right: 8px;
}


/* Badge de Rescisão */
.rescission-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

.badge-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
}

/* Total Líquido com Badge */
.total-liquido {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px;
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007cba;
}

.total-content {
    flex: 1;
}

.total-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.total-value {
    font-size: 2rem;
    font-weight: 700;
    color: #007cba;
    display: block;
}

/* IA Detalhada */
.ia-actions {
    margin-top: 15px;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: #007cba;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: #f0f8ff;
    text-decoration: none;
}

.ia-detalhada-content {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ia-detalhada-content h5 {
    color: #1a202c;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ia-detalhada-content h5:first-child {
    margin-top: 0;
}

.ia-detalhada-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.ia-detalhada-content li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
}

.ia-detalhada-content li:last-child {
    border-bottom: none;
}

.ia-detalhada-content li:before {
    content: "• ";
    color: #007cba;
    font-weight: bold;
    margin-right: 8px;
}

/* Responsive adjustments for badges */
@media (max-width: 768px) {
    .total-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rescission-badge {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .total-value {
        font-size: 1.6rem;
    }
    
    .total-liquido {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .total-content {
        width: 100%;
    }
}

/* Animation for IA detalhada */
.ia-detalhada-content {
    animation: fadeInUp 0.3s ease-out;
}

/* Improved button states for IA actions */
.ia-actions .btn-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Loading state for IA content */
.ia-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #718096;
    font-style: italic;
}

.ia-loading .spinner {
    width: 14px;
    height: 14px;
}




/* Estilo para o botão de exportar PDF */
#export-pdf {
    background: linear-gradient(135deg, #5A2D82 0%, #3C1E57 100%); /* Roxo escuro */
    color: white;
    border: 2px solid #3C1E57;
}

#export-pdf:hover {
    background: linear-gradient(135deg, #3C1E57 0%, #5A2D82 100%);
    border-color: #5A2D82;
}




@media (max-width: 480px) {
    .wp-rescisao-calculator-form {
        margin: 5px;
        padding: 15px;
    }
    
    .verbas li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .verba-valor {
        text-align: left;
        font-size: 0.95em;
        width: 100%;
    }
    
    .verba-nome {
        font-size: 0.9em;
        width: 100%;
    }
    
    .total-value {
        font-size: 1.4rem;
        word-break: break-word;
    }
    
    .total-liquido {
        padding: 15px;
    }
    
    .verbas {
        padding: 15px;
    }
    
    .verbas h4 {
        font-size: 0.95rem;
    }
}


/* Melhorias específicas para dispositivos muito pequenos */
@media (max-width: 360px) {
    .wp-rescisao-calculator-form {
        margin: 5px;
        padding: 12px;
    }
    
    .wp-rescisao-calculator-form h2 {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .total-liquido {
        padding: 12px;
        font-size: 1.1rem;
    }
    
    .total-value {
        font-size: 1.2rem;
    }
    
    .verbas {
        padding: 12px;
    }
    
    .verbas h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .verbas li {
        padding: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .verba-nome,
    .verba-valor {
        font-size: 0.85em;
        width: 100%;
    }
    
    .verba-valor {
        text-align: left;
        margin-top: 2px;
    }
    
    .ia-resposta {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .ia-resposta h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .ia-resposta p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .export-actions {
        gap: 10px;
    }
    
    .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Garantir que nenhum elemento ultrapasse a largura da tela */
* {
    box-sizing: border-box;
}

.wp-rescisao-calculator-form,
.wp-rescisao-calculator-form * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}



/* Otimizações adicionais para telas muito pequenas */
@media (max-width: 480px) {
    .wp-rescisao-calculator-form {
        padding: 15px;
        margin: 5px;
    }

    .total-liquido {
        font-size: 1.2rem;
        padding: 15px;
    }

    .verbas h4 {
        font-size: 1rem;
        padding: 10px 12px;
        margin-bottom: 15px;
    }

    .verbas li {
        padding: 12px 15px;
        margin-bottom: 6px;
    }

    .verba-nome {
        font-size: 14px;
    }

    .verba-valor {
        font-size: 16px;
    }

    .ia-resposta {
        padding: 20px;
    }

    .ia-resposta h4 {
        font-size: 16px;
    }

    .ia-resposta p {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .wp-rescisao-calculator-form {
        padding: 10px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .total-liquido {
        font-size: 1.1rem;
        padding: 10px;
        border-radius: 0;
    }

    .verbas h4 {
        font-size: 0.9rem;
        padding: 8px 10px;
        margin-bottom: 10px;
        border-radius: 0;
    }

    .verbas li {
        padding: 10px 12px;
        margin-bottom: 4px;
        border-radius: 0;
    }

    .verba-nome {
        font-size: 13px;
    }

    .verba-valor {
        font-size: 15px;
    }

    .ia-resposta {
        padding: 15px;
        border-radius: 0;
    }

    .ia-resposta h4 {
        font-size: 15px;
    }

    .ia-resposta p {
        font-size: 13px;
    }

    .export-actions .btn-secondary {
        font-size: 13px;
        padding: 10px 15px;
        border-radius: 0;
    }
}


