/* ===================================
   CALCULADORA DE CONCENTRAÇÃO - CSS
   =================================== */

/* ===================================
   CALCULADORA DE CONCENTRAÇÃO - CSS ISOLADO
   =================================== */

/* ===== SEÇÃO DA CALCULADORA ===== */
.concentracao-calculator-section {
    margin-bottom: 3rem;
}

.concentracao-calculator-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: none;
}

/* ===== HEADER DA CALCULADORA ===== */
.concentracao-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.concentracao-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.concentracao-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.concentracao-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== WRAPPER DA CALCULADORA ===== */
.concentracao-calculator-wrapper {
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* ===== COMPATIBILIDADE COM GRID LAYOUT ===== */
/* Garante que o conteúdo se adapte ao grid sem criar barras horizontais */
.content {
    min-width: 0; /* Previne overflow no grid */
    overflow-x: hidden; /* Previne scroll horizontal */
}

.concentracao-calculator-section,
.concentracao-educational-content {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Adapta suavemente quando sidebar colapsa/expande */
.main-container.sidebar-collapsed .concentracao-calculator-wrapper {
    /* Aproveita o espaço extra quando sidebar colapsa (de 250px para 60px) */
    transition: all 0.4s ease;
}

.main-container .concentracao-calculator-wrapper {
    /* Transição suave quando sidebar expande */
    transition: all 0.4s ease;
}

/* Desktop: Otimização para sidebar colapsado */
@media (min-width: 769px) {
    .main-container.sidebar-collapsed .concentracao-type-buttons {
        /* Mais espaço = mais colunas quando sidebar colapsa */
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .main-container.sidebar-collapsed .concentracao-input-grid {
        /* Melhor distribuição dos inputs quando há mais espaço */
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* ===== SELETOR DE TIPO ===== */
.concentracao-type-selector {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
}

.concentracao-type-selector h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.concentracao-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.concentracao-type-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.concentracao-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
    border-color: #007bff;
    background: linear-gradient(145deg, #f8f9ff 0%, #e3f2fd 100%);
}

.concentracao-type-btn.active {
    background: linear-gradient(145deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #0056b3;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.concentracao-type-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

/* ===== CONTAINERS DE FORMULÁRIO ===== */
.concentracao-form-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.concentracao-form-container:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.concentracao-form-container.hidden {
    display: none;
}

/* ===== DISPLAY DE FÓRMULAS ===== */
.concentracao-formula-display {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 5px solid #007bff;
    width: 100%;
    box-sizing: border-box;
}

.concentracao-formula-display h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.concentracao-formula-display .formula {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-align: center;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 2px solid #e3f2fd;
}

.concentracao-formula-display p {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

/* ===== GRID DE INPUTS ===== */
.concentracao-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.concentracao-input-group {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Previne overflow */
}

.concentracao-input-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.concentracao-input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-width: 0; /* Previne overflow */
}

.concentracao-input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: #f8f9ff;
}

.concentracao-input-group input:invalid {
    border-color: #dc3545;
}

.concentracao-input-group input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* ===== BOTÃO CALCULAR ===== */
.concentracao-calculate-btn {
    width: 100%;
    background: linear-gradient(145deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.concentracao-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    background: linear-gradient(145deg, #218838 0%, #1e7e34 100%);
}

.concentracao-calculate-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.concentracao-calculate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== RESULTADO ===== */
.concentracao-result {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 5px solid #28a745;
    animation: slideInUp 0.5s ease-out;
}

.concentracao-result h3 {
    color: #155724;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.concentracao-result-content {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #b8daff;
}

.concentracao-result-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.concentracao-result-details {
    color: #495057;
    line-height: 1.6;
}

/* ===== AVISO LEGAL ===== */
.concentracao-legal-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.concentracao-legal-notice p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* ===== EXPLICAÇÃO DO CÁLCULO ===== */
.concentracao-explanation {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 5px solid #17a2b8;
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.concentracao-explanation h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.concentracao-step {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #17a2b8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.concentracao-step h4 {
    color: #17a2b8;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.concentracao-step .formula-calculation {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: #495057;
}

/* ===== EXEMPLOS RÁPIDOS ===== */
.concentracao-examples {
    text-align: center;
    margin-bottom: 2rem;
}

.concentracao-examples p {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.concentracao-example-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    margin: 0.3rem;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.concentracao-example-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
    background: linear-gradient(145deg, #f8f9ff 0%, #e3f2fd 100%);
}

.concentracao-example-btn:active {
    transform: translateY(0);
}

/* ===== HELP SECTION ===== */
.concentracao-help {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #bbdefb;
}

.concentracao-help p {
    margin: 0;
    color: #1565c0;
    font-size: 0.9rem;
}

/* ===== CONTEÚDO EDUCACIONAL ===== */
.concentracao-educational-content {
    margin-top: 2rem;
}

.concentracao-content-block {
    background: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
}

.concentracao-content-block h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    border-bottom: 3px solid #007bff;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.concentracao-content-block p {
    color: #495057;
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ===== GRIDS DE TIPOS E DICAS ===== */
.concentracao-tipos-grid,
.concentracao-dicas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.concentracao-tipo-item,
.concentracao-dica-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 1px solid #e3f2fd;
    transition: all 0.3s ease;
    min-width: 0; /* Previne overflow */
    box-sizing: border-box;
}

.concentracao-tipo-item:hover,
.concentracao-dica-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.15);
    border-color: #007bff;
}

.concentracao-tipo-icon,
.concentracao-dica-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.concentracao-tipo-item h4,
.concentracao-dica-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.concentracao-tipo-item p,
.concentracao-dica-item p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.concentracao-tipo-item em {
    color: #007bff;
    font-weight: 600;
    font-style: normal;
}

/* ===== CONTAINER DE FÓRMULAS ===== */
.concentracao-formulas-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.concentracao-formula-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid #e3f2fd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-width: 0; /* Previne overflow */
    box-sizing: border-box;
}

.concentracao-formula-item h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.formula-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #bbdefb;
}

.formula-main {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.formula-detail {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #495057;
    text-align: center;
    margin-bottom: 1rem;
}

.formula-box p {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.formula-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.formula-box li {
    color: #495057;
    margin-bottom: 0.3rem;
    padding-left: 1rem;
    position: relative;
}

.formula-box li::before {
    content: '•';
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ===== REFERÊNCIAS ===== */
.referencias-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid #dee2e6;
}

.referencias-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.referencias-list li {
    color: #495057;
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.referencias-list li::before {
    content: '📚';
    position: absolute;
    left: 0;
    top: 0;
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVIDADE ESPECÍFICA DA CALCULADORA ===== */

/* Tablet - Adapta ao grid 220px 1fr 280px */
@media (max-width: 1024px) {
    .concentracao-calculator-wrapper {
        padding: 1.5rem;
    }
    
    .concentracao-type-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .concentracao-content-block {
        padding: 2rem 1.5rem;
    }
    
    .concentracao-input-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .concentracao-formulas-container {
        grid-template-columns: 1fr;
    }
}

/* Mobile - Layout single column */
@media (max-width: 768px) {
    .concentracao-calculator-wrapper {
        padding: 1rem;
    }
    
    .concentracao-type-buttons {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .concentracao-type-btn {
        padding: 1rem;
        font-size: 0.9rem;
        min-height: 50px;
    }
    
    .concentracao-form-container {
        padding: 1.5rem;
    }
    
    .concentracao-input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .concentracao-content-block {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .concentracao-content-block h2 {
        font-size: 1.6rem;
    }
    
    .concentracao-tipos-grid,
    .concentracao-dicas-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .concentracao-formulas-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .concentracao-formula-item {
        padding: 1.5rem;
    }
    
    .formula-main {
        font-size: 1.5rem;
    }
    
    .concentracao-example-btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        padding: 1rem;
    }
    
    /* Garante que em mobile o conteúdo não cause overflow */
    .concentracao-calculator-section,
    .concentracao-educational-content {
        overflow-x: hidden;
    }
}