/* ======================================
   TRADING DESDE CERO - CSS STYLES
   Optimizado para SEO, velocidad y AdSense
   ====================================== */

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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-gray: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ======================================
   HEADER
   ====================================== */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 0;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.tagline {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.95;
}

/* Navigation */
nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 10px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ======================================
   AD CONTAINERS (AdSense optimized)
   ====================================== */
.ad-container {
    max-width: 1200px;
    margin: 30px auto;
    text-align: center;
    padding: 0 20px;
}

.ad-placeholder {
    background: var(--bg-gray);
    border: 2px dashed var(--border-color);
    padding: 40px 20px;
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ======================================
   MAIN CONTENT
   ====================================== */
main {
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    margin-bottom: 50px;
}

.hero h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Category Sections */
.category-section {
    margin-bottom: 60px;
}

.category-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent-color);
}

.section-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Article Cards */
.article-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.article-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 50px 30px;
    border-radius: 12px;
    text-align: center;
    margin: 60px 0;
}

.cta-section h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* ======================================
   FOOTER
   ====================================== */
footer {
    background-color: #1f2937;
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
}

footer p {
    margin-bottom: 10px;
}

footer small {
    font-size: 0.85rem;
    color: #9ca3af;
}

.footer-nav {
    margin-top: 20px;
}

.footer-nav a {
    color: #93c5fd;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: white;
}

/* ======================================
   ARTICLE PAGE STYLES
   ====================================== */
.article-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.article-meta {
    color: var(--text-light);
    font-size: 0.95rem;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 40px 0 20px;
}

.article-content h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin: 30px 0 15px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin: 20px 0 20px 30px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content strong {
    color: var(--text-color);
    font-weight: 600;
}

.article-content em {
    font-style: italic;
    color: var(--text-light);
}

.highlight-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}

.warning-box {
    background: #fee2e2;
    border-left: 4px solid var(--danger-color);
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}

.info-box {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}

/* Back Button */
.back-button {
    display: inline-block;
    margin-bottom: 30px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: var(--secondary-color);
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        width: 100%;
        text-align: center;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .category-section h2 {
        font-size: 1.5rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.2rem;
    }
}

/* ======================================
   PERFORMANCE OPTIMIZATIONS
   ====================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Print styles */
@media print {
    .ad-container,
    .ad-placeholder,
    nav,
    footer {
        display: none;
    }
}
