/* ===================================================================== */
/*                 🔍 CALCULADORA DE RAÍZES POLINOMIAIS                 */
/* ===================================================================== */

/* ===================================
   VARIÁVEIS DE COR - ÁREA MATEMÁTICA
   ================================== */
:root {
    --primary: #667eea;        /* Azul lógico */
    --secondary: #764ba2;      /* Roxo precisão */
    --accent: #f093fb;         /* Rosa suave */
    --light: #f8f9ff;          /* Fundo azul claro */
    --gradient: linear-gradient(135deg, #667eea, #764ba2);
    --dark-primary: #4c63d2;   /* Azul mais escuro */
    --light-accent: #fce4ec;   /* Rosa claro */
}

/* ===================================
   SEÇÃO DA CALCULADORA RAÍZES POLINOMIAIS
   ================================== */
.raiz-calculator-section {
    margin-bottom: 3rem;
}

.raiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.raiz-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.raiz-header p {
    font-size: 1.2rem;
    color: #5a6c7d;
}

.raiz-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
}

.raiz-inputs h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ===================================
   SISTEMA DE ABAS ESPECÍFICO RAÍZES
   ================================== */
.raiz-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e6ed;
    padding-bottom: 1rem;
}

.raiz-tab-btn {
    background: #f8f9fa;
    border: 2px solid #e0e6ed;
    color: #5a6c7d;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 120px;
}

.raiz-tab-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.raiz-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--dark-primary);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* ===================================
   CONTEÚDO DAS ABAS RAÍZES
   ================================== */
.raiz-tab-content {
    display: none;
}

.raiz-tab-content.active {
    display: block;
    animation: fadeInRaizTab 0.3s ease;
}

@keyframes fadeInRaizTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   DISPLAY DE POLINÔMIOS
   ================================== */
.raiz-polynomial-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e6ed;
}

.raiz-polynomial-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-accent);
    border-radius: 12px;
    border: 2px solid var(--primary);
}

.raiz-polynomial-input h4 {
    color: var(--primary);
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.raiz-polynomial-equation {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.raiz-polynomial-equation span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
}

.raiz-polynomial-equation input {
    width: 70px;
    padding: 0.8rem;
    border: 2px solid var(--primary);
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
    background: white;
    transition: all 0.3s ease;
}

.raiz-polynomial-equation input:focus {
    outline: none;
    border-color: var(--dark-primary);
    transform: scale(1.05);
    background: var(--light);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.raiz-polynomial-equation input:valid:not(:placeholder-shown) {
    border-color: var(--secondary);
    background: var(--light-accent);
}

.raiz-operation-symbol {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
    padding: 0.5rem;
}

/* ===================================
   GRUPOS DE RESULTADO
   ================================== */
.raiz-result-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
    border: 2px solid var(--secondary);
    min-width: 250px;
}

.raiz-result-group h4 {
    color: var(--secondary);
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.raiz-result-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--primary);
}

.raiz-result-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.raiz-result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    font-family: 'Courier New', monospace;
}

.raiz-verification {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    padding: 0.5rem;
    background: #e8f5e8;
    border-radius: 6px;
    border: 1px solid #4caf50;
}

/* ===================================
   RESULTADOS QUADRÁTICOS
   ================================== */
.raiz-quadratic-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.raiz-delta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--primary);
}

.raiz-delta-info span:first-child {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.raiz-delta-status {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    background: #c8e6c9;
    color: #2e7d32;
}

.raiz-delta-status.no-real-roots {
    background: #ffcdd2;
    color: #c62828;
}

.raiz-delta-status.one-root {
    background: #fff3cd;
    color: #856404;
}

.raiz-roots-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.raiz-root-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--secondary);
}

.raiz-root-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
}

.raiz-root-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary);
    font-family: 'Courier New', monospace;
}

/* ===================================
   RESULTADOS CÚBICOS E QUÁRTICOS
   ================================== */
.raiz-cubic-results,
.raiz-quartic-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.raiz-cubic-status,
.raiz-quartic-status {
    text-align: center;
    padding: 0.8rem;
    background: #fff3cd;
    border-radius: 8px;
    border: 2px solid #ffc107;
    color: #856404;
    font-weight: 600;
}

/* ===================================
   CONFIGURAÇÃO NEWTON-RAPHSON
   ================================== */
.raiz-newton-setup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e6ed;
}

.raiz-newton-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #fff8e1;
    border-radius: 12px;
    border: 2px solid #ff9800;
    min-width: 300px;
}

.raiz-newton-input h4 {
    color: #ff9800;
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.raiz-newton-config {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.raiz-config-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: space-between;
}

.raiz-config-row label {
    font-weight: 600;
    color: #e65100;
    min-width: 100px;
    font-size: 0.9rem;
}

.raiz-config-row input {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #ff9800;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
}

.raiz-config-row input:focus {
    outline: none;
    border-color: #e65100;
    background: #fff8e1;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.15);
}

.raiz-config-row span {
    font-weight: 600;
    color: #e65100;
}

/* ===================================
   RESULTADOS NEWTON-RAPHSON
   ================================== */
.raiz-newton-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.raiz-newton-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #ff9800;
    justify-content: center;
}

.raiz-newton-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ff9800;
}

.raiz-newton-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #e65100;
    font-family: 'Courier New', monospace;
}

.raiz-newton-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.raiz-newton-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #ff9800;
    font-size: 0.9rem;
}

.raiz-newton-item span:first-child {
    color: #ff9800;
    font-weight: 600;
}

.raiz-newton-item span:last-child {
    color: #e65100;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* ===================================
   CONFIGURAÇÃO ANÁLISE
   ================================== */
.raiz-analysis-setup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e6ed;
}

.raiz-analysis-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #e8f5e8;
    border-radius: 12px;
    border: 2px solid #4caf50;
    min-width: 300px;
}

.raiz-analysis-input h4 {
    color: #4caf50;
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.raiz-analysis-config {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.raiz-analysis-results {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.raiz-analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #4caf50;
}

.raiz-analysis-label {
    font-weight: 600;
    color: #4caf50;
    font-size: 0.95rem;
}

.raiz-analysis-value {
    font-weight: bold;
    color: #2e7d32;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* ===================================
   FÓRMULA ESPECÍFICA RAÍZES
   ================================== */
.raiz-formula {
    background: var(--light-accent);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ===================================
   EXEMPLOS E AJUDA RAÍZES
   ================================== */
.raiz-examples {
    text-align: center;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.raiz-examples.hidden {
    display: none;
}

.raiz-examples p {
    margin-bottom: 1rem;
    color: #5a6c7d;
}

.raiz-example-btn {
    background: var(--light-accent);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.85rem;
}

.raiz-example-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.raiz-help {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    transition: all 0.3s ease;
}

.raiz-help.hidden {
    display: none;
}

/* ===================================
   EXPLICAÇÃO DO CÁLCULO RAÍZES
   ================================== */
.raiz-explanation {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light-accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    animation: slideInUp 0.5s ease;
}

.raiz-explanation h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.raiz-step {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}

.raiz-step h4 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.raiz-step p {
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    color: #444;
}

/* ===================================
   CONTEÚDO EDUCACIONAL RAÍZES
   ================================== */
.raiz-educational-content {
    margin-top: 3rem;
}

.raiz-content-block {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
}

.raiz-content-block h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.5rem;
}

.raiz-content-block p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
}

.raiz-content-block strong {
    color: var(--primary);
}

/* ===================================
   FORMULA DISPLAY RAÍZES
   ================================== */
.raiz-formula-display {
    background: var(--light-accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.raiz-formula-display h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.raiz-formula-display .formula p {
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    color: var(--secondary);
    font-weight: 600;
}

/* ===================================
   GRIDS EXEMPLOS E DICAS RAÍZES
   ================================== */
.raiz-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.raiz-example-item {
    background: var(--light-accent);
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.raiz-example-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.raiz-example-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.raiz-example-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.raiz-example-item p {
    color: #5a6c7d;
    font-size: 0.95rem;
    margin: 0;
}

.raiz-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.raiz-tip-item {
    background: var(--light);
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.raiz-tip-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.raiz-tip-item h4 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.raiz-tip-item p {
    color: var(--secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* ===================================
   EXEMPLO DE SOLUÇÃO RAÍZES
   ================================== */
.raiz-example-solution {
    background: var(--light-accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.raiz-example-solution h4 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.raiz-solution-step {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.raiz-solution-step h5 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.raiz-solution-step p {
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    color: #444;
}

.raiz-solution-final {
    background: #c8e6c9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
}

.raiz-solution-final h5 {
    color: #2e7d32;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.raiz-solution-final p {
    color: #2e7d32;
    margin: 0;
    font-family: inherit;
}

/* ===================================
   FAQ E CREDIBILIDADE
   ================================== */
.faq-container {
    margin-top: 1rem;
}

.faq-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--light);
    overflow: hidden;
}

.faq-question {
    background: var(--light);
    color: var(--primary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--primary);
    color: white;
}

.faq-answer {
    padding: 1rem 1.5rem;
    background: white;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: #444;
}

.credibilidade-container {
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.credibilidade-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.credibilidade-icon {
    font-size: 2rem;
    color: var(--primary);
}

.credibilidade-title {
    color: var(--primary);
    margin: 0;
    font-size: 1.3rem;
}

.credibilidade-content {
    color: #444;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.credibilidade-logo {
    color: var(--primary);
    font-weight: bold;
}

.credibilidade-badges {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.credibilidade-badge {
    background: var(--primary);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===================================
   REFERÊNCIAS
   ================================== */
.referencias-lista {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.referencia-item {
    background: var(--light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 1.5rem;
}

.referencia-item h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.referencia-item ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.referencia-item li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: #444;
}

.referencia-item li:last-child {
    margin-bottom: 0;
}

.referencia-item strong {
    color: var(--secondary);
    font-weight: 600;
}

/* ===================================
   ANIMAÇÕES RAÍZES
   ================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   RESPONSIVIDADE RAÍZES
   ================================== */
@media (max-width: 768px) {
    .raiz-header h1 {
        font-size: 2rem;
    }
    
    .raiz-tabs {
        gap: 0.3rem;
    }
    
    .raiz-tab-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .raiz-polynomial-display {
        gap: 1rem;
        padding: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .raiz-polynomial-equation {
        gap: 0.5rem;
    }
    
    .raiz-polynomial-equation input {
        width: 60px;
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .raiz-operation-symbol {
        font-size: 1.5rem;
        min-width: 30px;
    }
    
    .raiz-result-group {
        min-width: 200px;
    }
    
    .raiz-newton-input,
    .raiz-analysis-input {
        min-width: 250px;
    }
    
    .raiz-config-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .raiz-config-row label {
        min-width: auto;
        text-align: center;
    }
    
    .raiz-examples-grid,
    .raiz-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .credibilidade-badges {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .raiz-header h1 {
        font-size: 1.8rem;
    }
    
    .raiz-container {
        padding: 1rem;
    }
    
    .raiz-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .raiz-tab-btn {
        width: 140px;
    }
    
    .raiz-polynomial-display {
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .raiz-polynomial-equation input {
        width: 50px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .raiz-operation-symbol {
        font-size: 1.3rem;
    }
    
    .raiz-result-value {
        font-size: 1.3rem;
    }
    
    .raiz-newton-value {
        font-size: 1.4rem;
    }
    
    .raiz-example-icon {
        font-size: 2rem;
    }
}