/* ==================== BLOG 2 - LIGHT MODERN THEME ==================== */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Light Theme Colors */
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Brand Colors - Trading Theme */
    --accent-primary: #0ea5e9;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    --accent-glow: rgba(14, 165, 233, 0.4);
    
    /* Success/Error */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Grid Colors */
    --grid-line: rgba(14, 165, 233, 0.08);
    --grid-point: rgba(14, 165, 233, 0.3);
    --grid-point-active: rgba(14, 165, 233, 0.8);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Spacing */
    --nav-height: 56px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== PARALLAX BACKGROUND ==================== */
#trading-grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    filter: blur(40px);
}

/* ==================== NAVIGATION ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    z-index: 1000;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.navbar.scrolled {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform var(--transition-base);
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 10px;
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
    transition: transform var(--transition-spring), box-shadow var(--transition-base);
}

.brand-icon svg {
    width: 24px;
    height: 24px;
}

.nav-brand:hover .brand-icon {
    transform: rotate(-5deg) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all var(--transition-base);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: transform var(--transition-base);
}

.nav-link:hover {
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.05);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
    color: var(--accent-primary);
}

.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* Language Switch */
.language-switch {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
    margin-left: 16px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.lang-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.lang-btn:hover:not(.active) {
    color: var(--text-secondary);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    padding: calc(var(--nav-height) + 60px) 2rem 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeSlideDown 0.8s ease backwards;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeSlideUp 0.8s ease 0.1s backwards;
}

/* ==================== BLOG SECTION ==================== */
.blog-section {
    padding: 40px 2rem 80px;
    position: relative;
    z-index: 1;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== STATE DISPLAYS ==================== */
.loading-state, .error-state, .empty-state {
    text-align: center;
    padding: 80px 20px;
}

.loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p, .error-state p, .empty-state p {
    color: var(--text-secondary);
    font-size: 18px;
}

.error-icon, .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.btn-retry {
    margin-top: 24px;
    padding: 14px 32px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-retry:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ==================== BLOG GRID ==================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.blog-card {
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: 20px;
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: var(--shadow-md);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.15s; }
.blog-card:nth-child(3) { animation-delay: 0.2s; }
.blog-card:nth-child(4) { animation-delay: 0.25s; }
.blog-card:nth-child(5) { animation-delay: 0.3s; }
.blog-card:nth-child(6) { animation-delay: 0.35s; }
.blog-card:nth-child(7) { animation-delay: 0.4s; }
.blog-card:nth-child(8) { animation-delay: 0.45s; }
.blog-card:nth-child(9) { animation-delay: 0.5s; }

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
}

.blog-card-content {
    padding: 24px;
}

.blog-card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.blog-card-date svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color var(--transition-base);
}

.blog-card:hover .blog-card-title {
    color: var(--accent-primary);
}

.blog-card-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--bg-tertiary);
}

.blog-card-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.blog-card-views svg {
    width: 16px;
    height: 16px;
}

.blog-card-read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-base);
}

.blog-card-read-more:hover {
    gap: 8px;
}

.blog-card-read-more svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-base);
}

.blog-card:hover .blog-card-read-more svg {
    transform: translateX(4px);
}

/* ==================== LOAD MORE ==================== */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.btn-load-more {
    padding: 14px 40px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    color: var(--accent-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-load-more:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ==================== BLOG MODAL ==================== */
.blog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.blog-modal-overlay.active {
    display: flex;
}

.blog-modal {
    background: var(--bg-secondary);
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: sticky;
    top: 20px;
    float: right;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    margin: 20px 20px 0 0;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

.modal-content {
    padding: 50px 32px 32px;
}

.modal-header {
    margin-bottom: 28px;
}

.modal-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}

.modal-date svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-primary);
}

.modal-title {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.3;
}

.modal-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-body h2 {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 36px 0 16px;
}

.modal-body h3 {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 12px;
}

.modal-body p {
    margin-bottom: 20px;
}

.modal-body ul, .modal-body ol {
    margin: 20px 0 20px 24px;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--accent-primary);
}

.modal-body pre {
    background: var(--text-primary);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

.modal-body pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
}

/* ==================== FEATURED IMAGE ==================== */
.modal-featured-image {
    width: 100%;
    margin: 0 0 32px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.modal-featured-image img,
.modal-featured-image video {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.featured-caption {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* ==================== INLINE IMAGES ==================== */
.inline-image {
    margin: 24px 0;
    display: block;
}

.inline-image img {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: block;
}

.inline-image img:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.inline-image figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.inline-image-small img { max-width: 400px; width: 100%; }
.inline-image-medium img { max-width: 600px; width: 100%; }
.inline-image-large img { max-width: 100%; width: 100%; }

.inline-image-left {
    float: left;
    margin: 8px 24px 16px 0;
    max-width: 50%;
}

.inline-image-right {
    float: right;
    margin: 8px 0 16px 24px;
    max-width: 50%;
}

.inline-image-center {
    text-align: center;
    margin: 24px auto;
}

.inline-image-center img {
    margin: 0 auto;
}

.modal-body::after {
    content: "";
    display: table;
    clear: both;
}

/* ==================== GALLERY ==================== */
.modal-gallery {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--bg-tertiary);
}

.gallery-title {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
    transition: all var(--transition-base);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    pointer-events: none;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.gallery-caption {
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== LIGHTBOX ==================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 600px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--error);
    border-color: var(--error);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

/* ==================== FOOTER ==================== */
.footer {
    width: 100%;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

.footer-content p,
.footer p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero-section {
        padding: calc(var(--nav-height) + 40px) 1rem 30px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .blog-section {
        padding: 30px 1rem 60px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        padding: 40px 20px 24px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-body {
        font-size: 15px;
    }
    
    .modal-body h2 {
        font-size: 1.5rem;
    }
    
    .modal-body h3 {
        font-size: 1.25rem;
    }
    
    .inline-image-left,
    .inline-image-right {
        float: none;
        max-width: 100%;
        margin: 16px 0;
    }
    
    .nav-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .language-switch {
        margin-left: 8px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

