/* ═══════════════════════════════════════════════════════════ */
/* INDEX PAGE STYLES — The FinTech Grid                       */
/* Extracted from inline <style> + improvements               */
/* ═══════════════════════════════════════════════════════════ */

/* ─── Hero Section ─── */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    min-height: 400px;
}
.hero-main {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
}
.hero-side {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    min-height: 170px;
}
.hero-main img, .hero-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.hero-main:hover img, .hero-side:hover img {
    transform: scale(1.05);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 40%, transparent 70%);
    z-index: 1;
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
}
.hero-side .hero-content {
    padding: 14px;
}
.hero-badge {
    display: inline-block;
    background: #0066FF;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.hero-title {
    color: #fff;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.hero-main .hero-title {
    font-size: 1.55rem;
}
.hero-side .hero-title {
    font-size: 1.25rem;
}
.hero-excerpt {
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 300;
    margin-top: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}
.hero-meta .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0066FF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* ─── Section Headers ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #0066FF;
}
.section-title {
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #0066FF;
    border-radius: 2px;
}

/* ─── Latest Stream — article cards ─── */
.stream-article {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: #f8f9fa;
    border: none;
    transition: all 0.25s ease;
}
.dark .stream-article {
    background: #171717;
}
.stream-article:hover {
    background: #f1f3f5;
    transform: translateX(4px);
}
.dark .stream-article:hover {
    background: #1e1e1e;
}
.stream-thumb {
    width: 280px;
    min-width: 280px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb;
}
.dark .stream-thumb {
    background: #262626;
}
.stream-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.5s ease;
}
.stream-article:hover .stream-thumb img {
    transform: scale(1.05);
}
.stream-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 6px;
}
.stream-topline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stream-category {
    font-size: 11px;
    font-weight: 700;
    color: #0066FF;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.stream-time {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stream-title {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.stream-article:hover .stream-title {
    color: #0066FF;
}
.stream-excerpt {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.stream-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* ─── Most Read Sidebar ─── */
.most-read-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.dark .most-read-item {
    border-bottom-color: #262626;
}
.most-read-item:last-child {
    border-bottom: none;
}
.most-read-item:hover {
    transform: translateX(3px);
}
.most-read-num {
    font-size: 1rem;
    font-weight: 900;
    color: #0066FF;
    margin-right: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.most-read-item:hover .most-read-num {
    opacity: 1;
}
.most-read-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.most-read-item:hover .most-read-title {
    color: #0066FF;
}
.most-read-cat {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* ─── Mini Market Ticker ─── */
.ticker-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.ticker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.dark .ticker-row {
    border-bottom-color: #262626;
}
.ticker-row:last-child {
    border-bottom: none;
}
.ticker-row:hover {
    transform: translateX(3px);
}
.ticker-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.ticker-symbol {
    font-size: 0.8rem;
    font-weight: 800;
    background: rgba(0, 102, 255, 0.1);
    color: #0066FF;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.ticker-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticker-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.ticker-price {
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ticker-change {
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}


/* ─── Load More Button ─── */
.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px auto 0;
    padding: 12px 32px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #6b7280;
}
.dark .load-more-btn {
    border-color: #374151;
    color: #9ca3af;
}
.load-more-btn:hover {
    border-color: #0066FF;
    color: #0066FF;
    background: rgba(0, 102, 255, 0.05);
}

/* ─── Breaking News Ticker ─── */
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.animate-marquee {
    animation: marquee 25s linear infinite;
}
.ticker-wrap:hover .animate-marquee {
    animation-play-state: paused;
}

/* ─── Trending Now Section ─── */
.trending-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    min-height: 220px;
    background: #111;
}
.trending-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform 0.7s ease, opacity 0.5s ease;
    opacity: 0.85;
}
.trending-card:hover img {
    transform: scale(1.08);
    opacity: 1;
}
.trending-card .trending-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    z-index: 1;
}
.trending-card .trending-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
}
.trending-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #0066FF;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    margin-bottom: 8px;
}
.trending-card .trending-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trending-card .trending-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
}

/* ─── Sticky Sidebar ─── */
.sidebar-sticky {
    position: sticky;
    top: 72px;
    align-self: flex-start;
}

/* ─── Scroll Reveal Animation ─── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* Fallback: if JS doesn't run, show everything */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ─── Page Entry Animation ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.anim-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}
.anim-delay-1 { animation-delay: 0.1s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.2s; opacity: 0; }
.anim-delay-3 { animation-delay: 0.3s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ─── Comment Badge ─── */
.comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ─── Read Time Badge ─── */
.read-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: auto;
    }
    .hero-main {
        grid-row: auto;
        grid-column: auto;
        min-height: 300px;
    }
    .hero-side {
        min-height: 200px;
    }
    .hero-main .hero-title {
        font-size: 1.35rem;
    }
    .stream-article {
        padding: 14px;
        gap: 12px;
    }
    .stream-thumb {
        width: 140px;
        min-width: 140px;
        height: 100px;
        border-radius: 10px;
    }
    .stream-title {
        font-size: 1rem;
    }
    .stream-excerpt {
        display: none;
    }
    .trending-card {
        min-height: 180px;
    }
    .sidebar-sticky {
        position: static;
    }
}

@media (max-width: 640px) {
    .hero-main .hero-title {
        font-size: 1.15rem;
    }
    .hero-content {
        padding: 16px;
    }
}

/* ─── Mobile Performance Optimizations ─── */
@media (max-width: 768px) {
    /* Disable GPU-heavy transitions on mobile for smoother scroll */
    .hero-main img, .hero-side img, .trending-card img, .stream-thumb img {
        transition: none;
    }
    .hero-main:hover img, .hero-side:hover img,
    .trending-card:hover img, .stream-article:hover .stream-thumb img {
        transform: none;
    }
    /* Reduce marquee animation to save battery */
    .animate-marquee {
        animation-duration: 40s;
    }
    /* Disable hover transforms on mobile (no hover anyway) */
    .stream-article:hover,
    .most-read-item:hover,
    .ticker-row:hover {
        transform: none;
    }
}

/* Pause animations when page is not visible (saves battery) */
@media (prefers-reduced-motion: reduce) {
    .animate-marquee {
        animation: none;
    }
    .ticker-live-dot {
        animation: none;
    }
    .anim-fade-in {
        animation: none;
        opacity: 1;
    }
}
