/* css/articles.css - Estilos comunes para todos los artículos */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 2rem 0;
}

/* Contenedor principal */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Navegación de retorno */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-5px);
}

/* Breadcrumbs */
.breadcrumb {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Títulos */
h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color, #667eea);
    padding-bottom: 1rem;
}

h2 {
    color: #34495e;
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem 0;
    border-left: 4px solid var(--primary-color, #667eea);
    padding-left: 1rem;
}

h3 {
    color: #34495e;
    font-size: 1.3rem;
    margin: 2rem 0 1rem 0;
}

h4 {
    color: #34495e;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.8rem 0;
}

/* Meta información */
.meta-info {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    font-style: italic;
    color: #7f8c8d;
}

/* Cajas de contenido */
.highlight-box {
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.formula-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    text-align: center;
    font-size: 1.1rem;
    overflow-x: auto;
}

.example-box {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.warning-box {
    background: #fdf2e9;
    border-left: 4px solid #e67e22;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.danger-box {
    background: #fdebea;
    border-left: 4px solid #e74c3c;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

/* Tablas */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.comparison-table th, 
.comparison-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.comparison-table th {
    background: var(--primary-color, #667eea);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table tr:nth-child(even) {
    background: #f9f9f9;
}

.comparison-table tbody {
    display: table-row-group;
}

/* Calculadoras */
.calculator {
    background: #f1f2f6;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.calculator-tabs {
    display: flex;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    border: none;
    background: #bdc3c7;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.tab-button.active {
    background: var(--primary-color, #667eea);
}

.tab-button:first-child {
    border-radius: 5px 0 0 5px;
}

.tab-button:last-child {
    border-radius: 0 5px 5px 0;
}

.calculator-content {
    display: none;
}

.calculator-content.active {
    display: block;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.input-group {
    margin: 1rem 0;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-group input, 
.input-group select, 
.input-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
}

.input-group textarea {
    height: 100px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.calculate-btn {
    background: var(--primary-color, #667eea);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.calculate-btn:hover {
    background: var(--secondary-color, #764ba2);
    transform: translateY(-2px);
}

.result {
    background: white;
    padding: 1.5rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 2px solid #27ae60;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Medidores y indicadores */
.meter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #2ecc71, #f39c12, #e74c3c);
    height: 30px;
    border-radius: 15px;
    margin: 1rem 0;
    position: relative;
}

.meter-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #2c3e50;
    border-radius: 50%;
    top: 2px;
    transition: left 0.3s ease;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* Código */
.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

.code-block::before {
    content: 'Python';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: #34495e;
    color: #ecf0f1;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

/* Grids de contenido */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid var(--primary-color, #667eea);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card h4 {
    color: var(--primary-color, #667eea);
    margin-bottom: 1rem;
}

/* Navegación entre artículos */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #ddd;
}

.nav-article {
    flex: 1;
    max-width: 45%;
}

.nav-article a {
    display: block;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.nav-article a:hover {
    background: var(--primary-color, #667eea);
    color: white;
}

.nav-article.next {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .article-container {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .calculator-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 5px !important;
        margin-bottom: 0.5rem;
    }
    
    .comparison-table {
        font-size: 0.8rem;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-article {
        max-width: 100%;
    }
    
    .nav-article.next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0;
    }
    
    .article-container {
        padding: 1.5rem 1rem;
        border-radius: 0;
        margin: 0;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .formula-box {
        font-size: 0.9rem;
        padding: 1rem;
    }
}

/* Variables CSS para temas específicos */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --danger-color: #e74c3c;
    --info-color: #3498db;
}

/* Tema para artículos de riesgo */
.theme-risk {
    --primary-color: #e74c3c;
    --secondary-color: #c0392b;
}

/* Tema para artículos de fundamentos */
.theme-fundamentals {
    --primary-color: #f39c12;
    --secondary-color: #e67e22;
}

/* Tema para artículos de correlaciones */
.theme-correlations {
    --primary-color: #8e44ad;
    --secondary-color: #9b59b6;
}

/* Tema para artículos de beta */
.theme-beta {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .article-container {
        box-shadow: none;
        border: none;
    }
    
    .back-link,
    .calculator,
    .article-navigation {
        display: none;
    }
}
