/* ===================================================================== */
/*                    📚 PÁGINA TODAS CALCULADORAS                      */
/* ===================================================================== */

/* ===================================
   VARIÁVEIS DE COR - ÁREA GERAL
   ================================== */
:root {
    --primary: #667eea;        /* Azul principal */
    --secondary: #764ba2;      /* Roxo secundário */
    --accent: #22c55e;         /* Verde destaque */
    --light: #f8f9ff;          /* Fundo claro */
    --gradient: linear-gradient(135deg, #667eea, #764ba2);
    --success: #22c55e;        /* Verde sucesso */
    --warning: #f59e0b;        /* Amarelo aviso */
    --danger: #dc2626;         /* Vermelho erro */
}

/* ===================================
   PREVENIR SCROLL HORIZONTAL
   ================================== */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.todas-calculadoras-section,
.todas-calculadoras-container,
.filter-buttons,
.calculadoras-grid {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===================================
   LAYOUT PRINCIPAL
   ================================== */
.todas-calculadoras-section {
    margin-bottom: 3rem;
}

.todas-calculadoras-header {
    text-align: center;
    margin-bottom: 2rem;
}

.todas-calculadoras-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;
}

.todas-calculadoras-header p {
    font-size: 1.2rem;
    color: #5a6c7d;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.todas-calculadoras-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;
    overflow-x: hidden;
    max-width: 100%;
}

/* ===================================
   FILTROS DE CATEGORIA
   ================================== */
.category-filters {
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.category-filters h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.filter-btn {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border: 2px solid transparent;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.filter-btn.active {
    background: var(--gradient);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ===================================
   CONTROLES DE PAGINAÇÃO
   ================================== */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.results-info {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.page-btn:hover {
    background: var(--primary);
    color: white;
}

.page-btn.active {
    background: var(--gradient);
    color: white;
    border-color: var(--secondary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

/* ===================================
   GRID DE CALCULADORAS
   ================================== */
.calculadoras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.calc-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.calc-card:hover::before {
    transform: scaleX(1);
}

.calc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
}

.calc-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calc-card-icon {
    background: var(--gradient);
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-size: 1.5rem;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.calc-card-info h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.calc-card-category {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-top: 0.5rem;
    display: inline-block;
}

.calc-card-desc {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin: 1rem 0;
}

.calc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.calc-card-price {
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

.calc-card-button {
    background: var(--gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-card-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===================================
   LOADER E ESTADOS
   ================================== */
.grid-loader {
    text-align: center;
    padding: 4rem;
    grid-column: 1 / -1;
}

.loader-spinner {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.grid-loader p {
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* ===================================
   CONTEÚDO EDUCACIONAL - VISUAL OBRIGATÓRIO
   ================================== */
.educational-content {
    margin-top: 3rem;
}

.educational-content h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
}

/* Cards educacionais */
.content-block {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
    transition: all 0.3s ease;
}

.content-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.content-block h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-block h4 {
    color: #2c3e50;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.content-block p {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Classes duplas obrigatórias - como pressão arterial */
.explanation.calc-explanation {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
}

.legal-explanation.calc-legal {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Passos numerados */
.steps-list {
    margin: 1.5rem 0;
}

.step-item {
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.step-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Grid de aplicações */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.application-item {
    background: linear-gradient(135deg, var(--light) 0%, rgba(102, 126, 234, 0.08) 100%);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.application-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.application-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.application-item h4 {
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* Lista de dicas estilizada */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.tips-list li {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.tips-list li:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateX(5px);
}

.tips-list strong {
    color: var(--primary);
    font-weight: 600;
}

/* ===================================
   RESPONSIVIDADE
   ================================== */
@media (max-width: 768px) {
    .todas-calculadoras-header h1 {
        font-size: 2rem;
    }
    
    .todas-calculadoras-container {
        padding: 1.5rem;
    }
    
    .filter-buttons {
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    .filter-btn {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
    }
    
    .calculadoras-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .calc-card {
        padding: 1.2rem;
    }
    
    .calc-card-header {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .calc-card-icon {
        margin: 0 auto;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .applications-grid {
        grid-template-columns: 1fr;
    }
    
    .content-block {
        padding: 1.5rem;
    }
    
    .educational-content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .todas-calculadoras-container {
        padding: 1rem;
    }
    
    .filter-btn {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
    }
    
    .calc-card {
        padding: 1rem;
    }
    
    .calc-card-info h3 {
        font-size: 1.1rem;
    }
    
    .page-btn {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 0.9rem;
    }
}


/* ===================================
   VER MAIS CATEGORIAS
   ================================== */
.ver-mais-container {
    text-align: center;
    margin: 1rem 0;
}

.ver-mais-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.ver-mais-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.filter-extra.hidden {
    display: none;
}

.filter-extra.show {
    display: flex;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================
   REMOVER SIDEBAR APENAS DESTA PÁGINA
   ================================== */
body[data-page="todas-calculadoras"] #sidebar-container {
    display: none !important;
}

body[data-page="todas-calculadoras"] .main-container {
    grid-template-columns: 1fr 320px !important;
    gap: 20px !important;
}

body[data-page="todas-calculadoras"] .content {
    max-width: 100% !important;
    margin: 0;
    padding: 2rem;
    margin-right: 0 !important;
}

body[data-page="todas-calculadoras"] #ads-sidebar-container {
    position: static !important;
    width: 300px !important;
    max-height: fit-content;
}

/* ===================================
   MOBILE: REMOVER ADS SIDEBAR TOTALMENTE
   ================================== */
@media (max-width: 1200px) {
    body[data-page="todas-calculadoras"] .main-container {
        grid-template-columns: 1fr !important;
    }
    
    body[data-page="todas-calculadoras"] #ads-sidebar-container {
        display: none !important;
    }
    
    body[data-page="todas-calculadoras"] .content {
        margin-right: 0 !important;
        max-width: 100% !important;
    }
}