/* ===================================================================== */
/*                      📐 CALCULADORA DE REGRA DE 3                    */
/* ===================================================================== */

/* ===================================
   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 REGRA DE 3
   ================================== */
.regra-tres-calculator-section {
    margin-bottom: 3rem;
}

.regra-tres-header {
    text-align: center;
    margin-bottom: 2rem;
}

.regra-tres-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;
}

.regra-tres-header p {
    font-size: 1.2rem;
    color: #5a6c7d;
}

.regra-tres-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
}

.regra-tres-inputs h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ===================================
   VISUALIZAÇÃO DA PROPORÇÃO ESPECÍFICA
   ================================== */
.regra-tres-proportion-display {
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    max-width: 100%;
    overflow: hidden;
}

.regra-tres-proportion-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    min-height: 120px;
}

.regra-tres-proportion-shape {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.regra-tres-proportion-shape svg {
    max-width: 400px;
    max-height: 150px;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

/* ===================================
   INPUTS ESPECÍFICOS REGRA DE 3
   ================================== */
.regra-tres-input-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
}

.regra-tres-input-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.regra-tres-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border: 2px solid #e0e6ed;
    transition: all 0.3s ease;
    text-align: center;
}

.regra-tres-input-group:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.regra-tres-input-group:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.regra-tres-input-group.unknown {
    background: #fff3cd;
    border-color: #ffc107;
}

.regra-tres-input-group.unknown:hover {
    border-color: #ffb300;
    background: #fff8e1;
}

.regra-tres-input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    text-align: center;
    width: 100%;
}

.regra-tres-input-group.unknown label {
    color: #856404;
}

.regra-tres-input-group input {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    padding: 0.8rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
    background: white;
    transition: all 0.3s ease;
}

.regra-tres-input-group.unknown input {
    border-color: #ffc107;
    background: #fff8e1;
}

.regra-tres-input-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: scale(1.03);
    background: var(--light);
}

.regra-tres-input-group.unknown input:focus {
    border-color: #ffb300;
    background: #fff5cc;
}

.regra-tres-input-group input:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background: #f8fff8;
}

.regra-tres-input-group input:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
    background: #fff8f8;
}

.regra-tres-input-group .unit {
    color: #5a6c7d;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    font-style: italic;
}

.regra-tres-input-group.unknown .unit {
    color: #856404;
}

/* ===================================
   SEPARADOR DE PROPORÇÃO ESPECÍFICO
   ================================== */
.regra-tres-proportion-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.regra-tres-equals-sign {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    background: var(--light);
    padding: 1rem;
    border-radius: 50%;
    border: 2px solid var(--primary);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.regra-tres-equals-sign:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.regra-tres-proportion-text {
    font-size: 0.85rem;
    color: #5a6c7d;
    text-align: center;
    font-weight: 600;
}

/* ===================================
   FÓRMULA ESPECÍFICA
   ================================== */
.regra-tres-formula-info {
    background: #e8f4fd;
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin: 1rem 0;
}

/* ===================================
   RESULTADO ESPECÍFICO REGRA DE 3
   ================================== */
.regra-tres-result-display {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-height: 80px;
}

.regra-tres-result-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.2);
}

.regra-tres-result-display.success {
    background: #d4edda;
    border-color: #28a745;
    animation: slideInResult 0.5s ease;
}

.regra-tres-result-display.success .regra-tres-result-icon,
.regra-tres-result-display.success .regra-tres-result-text h4,
.regra-tres-result-display.success .regra-tres-result-value {
    color: #155724;
}

.regra-tres-result-icon {
    font-size: 2rem;
    color: #856404;
    flex-shrink: 0;
}

.regra-tres-result-text {
    flex: 1;
    text-align: center;
}

.regra-tres-result-text h4 {
    color: #856404;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.regra-tres-result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #856404;
    font-family: 'Courier New', monospace;
}

/* ===================================
   EXEMPLOS ESPECÍFICOS
   ================================== */
.regra-tres-examples {
    text-align: center;
    margin-bottom: 2rem;
}

.regra-tres-examples p {
    margin-bottom: 1rem;
    color: #5a6c7d;
}

.regra-tres-example-btn {
    background: var(--light);
    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;
}

.regra-tres-example-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.regra-tres-example-btn:active {
    transform: scale(0.95);
}

/* ===================================
   AJUDA E DICAS ESPECÍFICAS
   ================================== */
.regra-tres-help {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

/* ===================================
   RESULTADOS DETALHADOS ESPECÍFICOS
   ================================== */
.regra-tres-results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e6ed;
}

.regra-tres-result-item {
    background: var(--light);
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.regra-tres-result-item.success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.regra-tres-step-solution {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    margin-top: 1rem;
}

.regra-tres-step-solution p {
    margin: 0.8rem 0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    color: #2c3e50;
}

/* ===================================
   CONTEÚDO EDUCACIONAL ESPECÍFICO
   ================================== */
.regra-tres-educational-content {
    margin-top: 3rem;
}

.regra-tres-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;
}

.regra-tres-content-block h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.5rem;
}

.regra-tres-content-block p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
}

.regra-tres-content-block strong {
    color: var(--primary);
}

/* ===================================
   GRIDS ESPECÍFICOS REGRA DE 3
   ================================== */
.regra-tres-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.regra-tres-example-item {
    background: var(--light);
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.regra-tres-example-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.regra-tres-example-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.regra-tres-example-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.regra-tres-example-item p {
    color: #5a6c7d;
    font-size: 0.95rem;
    margin: 0;
}

.regra-tres-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.regra-tres-tip-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.regra-tres-tip-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.regra-tres-tip-item h4 {
    color: #856404;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.regra-tres-tip-item p {
    color: #856404;
    margin: 0;
    font-size: 0.95rem;
}

/* ===================================
   EXEMPLO DE SOLUÇÃO ESPECÍFICO
   ================================== */
.regra-tres-example-solution {
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.regra-tres-example-solution h4 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.regra-tres-solution-step {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.regra-tres-solution-step h5 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.regra-tres-solution-step p {
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    color: #444;
}

.regra-tres-solution-final {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
}

.regra-tres-solution-final h5 {
    color: #155724;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.regra-tres-solution-final p {
    color: #155724;
    margin: 0;
    font-family: inherit;
}

/* ===================================
   TIPOS DE REGRA DE 3
   ================================== */
.regra-tres-type-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.regra-tres-type-btn {
    background: var(--light);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.regra-tres-type-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.regra-tres-type-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ===================================
   FÓRMULA DISPLAY
   ================================== */
.regra-tres-formula-display {
    background: var(--light-accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.regra-tres-formula-display h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.regra-tres-formula-display .formula p {
    margin: 0.3rem 0;
    font-family: 'Courier New', monospace;
    color: var(--secondary);
    font-weight: 600;
}

/* ===================================
   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 ESPECÍFICAS
   ================================== */
@keyframes slideInResult {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   RESPONSIVIDADE ESPECÍFICA
   ================================== */
@media (max-width: 768px) {
    .regra-tres-header h1 {
        font-size: 2rem;
    }
    
    .regra-tres-input-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .regra-tres-proportion-separator {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
    
    .regra-tres-proportion-shape svg {
        max-width: 300px;
        max-height: 120px;
    }
    
    .regra-tres-examples-grid,
    .regra-tres-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .regra-tres-result-display {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
        padding: 1.2rem;
    }
    
    .regra-tres-proportion-display {
        padding: 1rem;
    }
    
    .regra-tres-type-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .credibilidade-badges {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .regra-tres-header h1 {
        font-size: 1.8rem;
    }
    
    .regra-tres-container {
        padding: 1rem;
    }
    
    .regra-tres-proportion-shape {
        padding: 0.5rem;
    }
    
    .regra-tres-proportion-shape svg {
        max-width: 250px;
        max-height: 100px;
    }
    
    .regra-tres-input-group input {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        font-size: 0.9rem;
    }
    
    .regra-tres-result-display {
        padding: 1rem;
    }
    
    .regra-tres-result-value {
        font-size: 1.2rem;
    }
    
    .regra-tres-equals-sign {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}