/**
 * Financial Advisor - Estilos
 * Versão: 1.0.0
 */

/* ========================================
   Print Styles
   ======================================== */

@media print {
    /* Reset margins and padding */
    @page {
        size: A4;
        margin: 15mm 15mm 15mm 15mm;
        font-family: Arial, sans-serif;
    }
    
    /* Add title before content */
    body:before {
        content: "CalculaFin - Relatório Financeiro";
        display: block;
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
        width: 100%;
    }
    
    /* Add page numbers */
    body {
        counter-reset: page;
    }
    
    .page-break {
        page-break-after: always;
    }
    
    /* Ensure proper page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    /* Better handling of tables */
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    /* Hide print button and other unnecessary elements */
    .fa-print-actions,
    .fa-print-actions *,
    .fa-result-actions,
    .fa-result-actions *,
    #faPrintReport,
    .fa-btn,
    button,
    .no-print,
    .wp-site-header,
    .site-header,
    header,
    footer,
    .site-footer,
    .wp-block-navigation,
    .wp-block-site-title,
    .wp-block-site-tagline {
        display: none !important;
    }
    
    /* Ensure content takes full width */
    .fa-container,
    .fa-screen {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        color: black !important;
    }
    
    /* Reset some styles for better print */
    body {
        padding: 10mm !important;
        margin: 0 auto !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
        color: #000 !important;
        background: #fff !important;
        width: 100%;
        max-width: 210mm;
    }
    
    /* Ensure links are visible in print */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    


	/* Add URL after links in print */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}

/* ========================================
   Container Principal
   ======================================== */

.fa-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========================================
   Telas
   ======================================== */

.fa-screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.fa-screen.active {
    display: block;
}

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

/* ========================================
   Header
   ======================================== */

.fa-header {
    text-align: center;
    margin-bottom: 40px;
}

.fa-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.fa-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   Formulário
   ======================================== */

.fa-form-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#faDebtsContainer {
    margin-bottom: 24px;
}

.fa-debt-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    transition: all 0.2s ease;
}

.fa-debt-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.fa-debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.fa-debt-number {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.fa-debt-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.fa-debt-remove:hover {
    background: #dc3545;
    color: #fff;
}

.fa-form-group {
    margin-bottom: 16px;
}

.fa-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.fa-form-group input,
.fa-form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.fa-form-group input:focus,
.fa-form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

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

/* ========================================
   Botões
   ======================================== */

.fa-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.fa-btn-primary {
    background: #4CAF50;
    color: #fff;
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.fa-btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.fa-btn-secondary {
    background: #fff;
    color: #495057;
    border: 2px solid #dee2e6;
}

.fa-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Classes de botões premium removidas */

.fa-icon {
    font-size: 20px;
}

.fa-actions {
    margin-bottom: 24px;
}

.fa-submit-wrapper {
    margin-top: 32px;
}


/* ========================================
   Resultado
   ======================================== */

.fa-result-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.fa-result-header {
    text-align: center;
    margin-bottom: 32px;
}

.fa-result-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.fa-priority-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.fa-priority-card h3 {
    font-size: 20px;
    margin: 0 0 16px 0;
    opacity: 0.9;
}

.fa-priority-card .fa-debt-name {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.fa-priority-card .fa-reason {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
    margin: 0 0 16px 0;
}

.fa-priority-card .fa-savings {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.fa-savings-label {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 4px 0;
}

.fa-savings-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

/* ========================================
   Comparativo
   ======================================== */

.fa-comparison {
    margin-bottom: 24px;
}

.fa-comparison h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.fa-debt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fa-debt-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fa-debt-list li.priority {
    background: #e8f5e9;
    border: 2px solid #4CAF50;
    font-weight: 600;
}

.fa-debt-list .fa-badge {
    background: #4CAF50;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   Timeline
   ======================================== */

.fa-timeline {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.fa-timeline h4 {
    font-size: 16px;
    font-weight: 600;
    color: #856404;
    margin: 0 0 8px 0;
}

.fa-timeline p {
    font-size: 15px;
    color: #856404;
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   Explicação Emocional
   ======================================== */

.fa-emotional {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
}

.fa-emotional h4 {
    font-size: 16px;
    font-weight: 600;
    color: #0d47a1;
    margin: 0 0 8px 0;
}

.fa-emotional p {
    font-size: 15px;
    color: #0d47a1;
    margin: 0;
    line-height: 1.6;
}

/* Seção de Upsell removida */

/* ========================================
   Erro
   ======================================== */

.fa-error-content {
    text-align: center;
    padding: 60px 20px;
}

.fa-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.fa-error-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.fa-error-content p {
    font-size: 16px;
    color: #666;
    margin: 0 0 24px 0;
}

/* ========================================
   Ações do Resultado
   ======================================== */

.fa-result-actions {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   Responsividade
   ======================================== */

@media (max-width: 768px) {
    .fa-container {
        padding: 16px;
    }
    
    .fa-title {
        font-size: 24px;
    }
    
    .fa-subtitle {
        font-size: 15px;
    }
    
    .fa-form-wrapper,
    .fa-result-content {
        padding: 20px;
    }
    
    .fa-form-row {
        grid-template-columns: 1fr;
    }
    
    .fa-priority-card {
        padding: 24px;
    }
    
    .fa-priority-card .fa-debt-name {
        font-size: 24px;
    }
    
    .fa-savings-value {
        font-size: 24px;
    }
}



/* ========================================
   Correção Emojis (Solução 2 + 3)
   ======================================== */

/* Emojis isolados em span para controle */
.fa-emoji {
  display: inline-block;
  font-size: 1em;
  line-height: 1;
}

/* Ajustes específicos para impressão (Solução 3) */
@media print {
  /* Garante que o emoji isolado seja pequeno */
  .fa-emoji {
    font-size: 14px !important; /* Tamanho fixo para garantir consistência */
    line-height: 1 !important;
    vertical-align: middle;
  }
  
  /* Se o emoji for renderizado como pseudo-elemento (caso não aplicado aqui, mas como fallback) */
  .fa-result-title::before,
  .fa-btn-secondary::before {
    font-size: 12pt !important;
    display: inline-block;
    transform: scale(0.7) !important;
    margin-right: 2px;
  }
  
  /* Esconder o texto do botão de imprimir para não duplicar */
  .fa-print-actions .fa-text {
    display: inline !important;
  }
  
  /* Garante que emojis que não foram envolvidos em span também sejam controlados */
  [role="img"],
  span.emoji,
  i.emoji {
    font-size: 14px !important;
    line-height: 1 !important;
  }
}
