/* ===================================
   GASES-IDEAIS.CSS
   Estilos específicos seguindo padrão rescisão
=================================== */

/* Garantir que todo o conteúdo se adapte ao layout principal */
.content {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.content > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* ===================================
   SEÇÃO PRINCIPAL DA CALCULADORA
   ================================== */
.gases-calculator-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gases-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.gases-header h1 {
    color: #333;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.gases-header p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.gases-container {
    max-width: 100%;
    overflow-x: hidden; /* Evita scroll horizontal */
}

/* ===================================
   SISTEMA DE TABS
   ================================== */
.gases-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: hidden; /* Remove scroll horizontal */
    gap: 5px;
    flex-wrap: wrap; /* Permite quebra de linha em mobile */
}

.gases-tab-btn {
    background: #f8f9fa;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px; /* Largura mínima adequada */
    max-width: 200px; /* Evita botões muito largos */
    font-size: 14px;
    flex: 1; /* Distribui espaço igualmente */
}

.gases-tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.gases-tab-btn.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border-bottom: 2px solid #22c55e;
}

.gases-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.gases-tab-content.active {
    display: block;
}

/* ===================================
   INPUTS DA CALCULADORA
   ================================== */
.gases-inputs {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gases-inputs h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3em;
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.gases-law-description {
    text-align: center;
    color: #16a34a;
    font-style: italic;
    margin-bottom: 1.5rem;
    padding: 10px;
    background: #f0fdf4;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

.gases-input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gases-input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gases-input-group label {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.gases-input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gases-input-group input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.gases-input-group input:invalid {
    border-color: #dc3545;
}

/* ===================================
   SELETOR DE CÁLCULO
   ================================== */
.gases-calculate-what {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

.gases-calculate-what label {
    color: #16a34a;
    font-weight: 600;
    font-size: 1rem;
}

.gases-calculate-what select {
    padding: 0.5rem 1rem;
    border: 2px solid #bbf7d0;
    border-radius: 6px;
    background: white;
    color: #16a34a;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gases-calculate-what select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* ===================================
   CONVERSOR DE TEMPERATURA
   ================================== */
.gases-temp-converter {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.gases-temp-converter p {
    margin: 0;
    color: #92400e;
    font-size: 0.95rem;
}

/* ===================================
   BOTÕES DE EXEMPLO
   ================================== */
.gases-example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.gases-btn-example {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.gases-btn-example:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

/* ===================================
   BOTÃO CALCULAR
   ================================== */
.gases-calculate-section {
    text-align: center;
    margin: 1.5rem 0;
}

.gases-calculate-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.gases-calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.gases-calculate-btn:active {
    transform: translateY(-1px);
}

/* ===================================
   BOTÃO LIMPAR
   ================================== */
.gases-clear-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.gases-clear-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.gases-clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* ===================================
   RESULTADO DOS GASES
   ================================== */
.gases-resultado {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1.5rem;
    animation: slideInUp 0.5s ease;
}

.gases-resultado h4 {
    color: #16a34a;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.gases-result-highlight {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}

.gases-result-details {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.gases-result-details h4 {
    color: #495057;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.gases-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.gases-result-item:last-child {
    border-bottom: none;
}

.gases-result-label {
    font-weight: 500;
    color: #6c757d;
}

.gases-result-value {
    font-weight: bold;
    color: #495057;
}

/* Comparação de Estados */
.gases-comparison {
    background: linear-gradient(135deg, #ddd6fe 0%, #c7d2fe 100%);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #a78bfa;
}

.gases-comparison h4 {
    color: #5b21b6;
    margin-bottom: 10px;
}

.gases-state-before,
.gases-state-after {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin: 8px 0;
    border-left: 3px solid #22c55e;
}

/* ===================================
   EXPLICAÇÃO DOS CÁLCULOS
   ================================== */
.gases-explanation-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gases-explanation-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.gases-calculation-steps {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.gases-calculation-steps h4 {
    color: #16a34a;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.gases-step {
    background: white;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.gases-step:last-child {
    margin-bottom: 0;
}

.gases-formula-highlight {
    background: #dbeafe;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1e40af;
    margin: 10px 0;
    text-align: center;
    border: 1px solid #93c5fd;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===================================
   CONTEÚDO EDUCACIONAL
   ================================== */
.gases-educational-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gases-educational-content h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.gases-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gases-content-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.gases-content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.gases-content-card h3 {
    color: #22c55e;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.gases-content-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

.gases-content-card ul {
    color: #666;
    line-height: 1.6;
    padding-left: 1.2rem;
}

.gases-content-card li {
    margin-bottom: 0.5rem;
}

.gases-formula-box {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.gases-formula-box p {
    margin: 8px 0;
    font-size: 1.1em;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color:#fff;
}

.gases-formula-box ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
    color: #fff;
}

.gases-formula-box li {
    margin: 5px 0;
    font-size: 0.95em;
}

/* ===================================
   AVISO LEGAL E REFERÊNCIAS
   ================================== */
.gases-legal-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #ffc107;
}

.gases-legal-notice p {
    color: #856404;
    margin: 0;
    line-height: 1.6;
}

.gases-references {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.gases-references h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.gases-references ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.gases-references li {
    background: white;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ===================================
   ANIMAÇÕES
   ================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================
   RESPONSIVIDADE MOBILE
   ================================== */
@media (max-width: 768px) {
    .gases-calculator-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .gases-header h1 {
        font-size: 1.8rem;
    }
    
    .gases-tabs {
        flex-direction: column;
        gap: 8px;
        border-bottom: none;
        overflow-x: hidden;
    }
    
    .gases-tab-btn {
        min-width: auto;
        width: 100%;
        border-radius: 8px;
        margin-bottom: 0;
        font-size: 16px; /* Melhor para mobile */
        padding: 14px 16px; /* Mais área de toque */
    }
    
    .gases-tab-btn.active {
        border-bottom: none;
        border-left: 4px solid #22c55e;
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    }
    
    .gases-input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gases-calculate-what {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .gases-calculate-what select {
        width: 100%;
    }
    
    .gases-example-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .gases-btn-example {
        width: 100%;
        border-radius: 8px;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .gases-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .gases-content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gases-educational-content {
        padding: 1.5rem;
    }
    
    .gases-explanation-section {
        padding: 1.5rem;
    }
}

/* Mobile muito pequeno */
@media (max-width: 480px) {
    .gases-header h1 {
        font-size: 1.5rem;
    }
    
    .gases-inputs {
        padding: 1.5rem;
    }
    
    .gases-inputs h3 {
        font-size: 1.1em;
        padding: 12px;
    }
    
    .gases-tab-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Desktop - Adaptação ao sidebar */
@media (min-width: 769px) {
    .gases-tabs {
        justify-content: flex-start;
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .gases-tab-btn {
        flex: 0 1 auto; /* Não cresce, mas pode encolher */
        min-width: 140px;
        max-width: 180px;
    }
    
    /* Quando sidebar está colapsado, mais espaço para tabs */
    .main-container.sidebar-collapsed .gases-tab-btn {
        min-width: 160px;
        max-width: 200px;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .gases-tabs {
        overflow-x: hidden;
        flex-wrap: nowrap;
    }
    
    .gases-tab-btn {
        min-width: 120px;
        max-width: 150px;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* ===================================
   ESTADOS DE LOADING
   ================================== */
.gases-loading {
    opacity: 0.7;
    pointer-events: none;
}

.gases-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Melhorias visuais específicas */
.gases-highlight {
    background: #f0fdf4;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    margin: 10px 0;
}

/* Tooltips específicos para gases */
.gases-tooltip {
    position: relative;
    cursor: help;
    color: #22c55e;
    font-weight: bold;
}

.gases-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.gases-tooltip:hover::after {
    opacity: 1;
}