/*
Theme Name: Crypto Pulse
Theme URI: https://example.com/crypto-pulse
Author: Antigravity
Author URI: https://example.com
Description: A high-performance, dark-mode crypto news theme with live ticker and bento grid layout.
Version: 1.0.0
Text Domain: crypto-pulse
*/

:root {
    /* Colors */
    --bg-deep: #050505;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-green: #00ff9d;
    --accent-pink: #ff0055;
    --accent-blue: #00f3ff;
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Misc */
    --radius-md: 12px;
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-blue);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Glassmorphism Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 243, 255, 0.1);
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    margin-top: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Ticker Styles */
.site-header {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ticker-wrap {
    background: #000;
    border-bottom: 1px solid var(--border-glass);
    overflow: hidden;
    height: 40px;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: flex;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-right: 1px solid var(--border-glass);
}

.coin-name {
    color: var(--text-main);
    font-weight: 700;
    margin-right: 0.5rem;
}

.coin-change.positive {
    color: var(--accent-green);
}

.coin-change.negative {
    color: var(--accent-pink);
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.main-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.site-title a {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.site-title .highlight {
    color: var(--accent-green);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 0;
    display: block;
}

/* Dropdown Support */
.main-navigation ul li {
    position: relative;
}

/* Hide Submenus by default */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
    flex-direction: column;
    gap: 0;
}

/* Show Submenu on Hover */
.main-navigation ul li:hover>ul {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Submenu Links */
.main-navigation ul ul li {
    display: block;
    margin: 0;
}

.main-navigation ul ul a {
    padding: 10px 20px;
    color: #ccc;
    white-space: nowrap;
    font-size: 0.9rem;
}

.main-navigation ul ul a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-green);
    padding-left: 25px;
    /* Slide effect */
}

/* Arrow for items with children */
.menu-item-has-children>a::after {
    content: ' ▼';
    font-size: 0.6em;
    margin-left: 5px;
    opacity: 0.7;
    vertical-align: middle;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Portal Layout (The Block Style) */

.portal-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    /* Fixed Left, Fluid Center, Fixed Right */
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Common Section Titles */
.section-title-sm {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

/* Left Column: Latest News */
.column-latest {
    border-right: 1px solid var(--border-glass);
    padding-right: var(--spacing-md);
}

.latest-item {
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: var(--spacing-sm);
}

.latest-item:last-child {
    border-bottom: none;
}

.latest-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.latest-meta .cat {
    color: var(--accent-green);
    text-transform: uppercase;
    font-weight: 700;
}

.latest-title {
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
    color: #eee;
    margin: 0;
    transition: color 0.2s;
}

.latest-item a:hover .latest-title {
    color: var(--accent-blue);
}

/* Center Column: Hero */
.hero-card {
    margin-bottom: var(--spacing-lg);
}

.hero-img-wrap {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.hero-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-card:hover .hero-img-wrap img {
    transform: scale(1.03);
}

.hero-heading {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Sub-Featured Grid */
.sub-featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-glass);
}

.sub-card .sub-img {
    height: 180px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sub-card .sub-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sub-title {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.3;
}

/* Right Column: Trending */
.column-right {
    padding-left: var(--spacing-md);
    border-left: 1px solid var(--border-glass);
}

.sidebar-block {
    margin-bottom: var(--spacing-xl);
}

.trending-compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-compact li {
    margin-bottom: 1rem;
}

.trending-compact a {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.trending-compact .rank {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
    min-width: 30px;
}

.trending-compact .trend-cat {
    display: block;
    font-size: 0.7rem;
    color: var(--accent-pink);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}

.trending-compact .trend-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: block;
}

/* Sponsored Block */
.sponsored-block .ad-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    /* Removed padding/border/bg to allow ad to fill space naturally */
}

.sponsored-block .ad-placeholder img,
.sponsored-block .ad-placeholder iframe,
.sponsored-block .ad-placeholder video {
    max-width: 100%;
    height: auto;
    display: block;
}

.ad-label {
    align-self: flex-end;
    font-size: 0.7rem;
    color: #555;
    border: 1px solid #333;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .portal-layout {
        grid-template-columns: 1fr;
        /* Stack everything */
    }

    .column-latest,
    .column-right {
        border: none;
        padding: 0;
    }

    .hero-img-wrap {
        height: 300px;
    }

    /* Reorder Columns: Content First */
    .column-center {
        order: 1;
    }

    .column-latest {
        order: 2;
    }

    .column-right {
        order: 3;
    }


    /* Mobile Fixes for Clickability */
    .hero-card>a,
    .sub-card>a {
        display: block;
        width: 100%;
        height: 100%;
        position: relative;
        z-index: 1;
    }

    .hero-body,
    .hero-img-wrap,
    .sub-img {
        pointer-events: none;
        /* Let clicks pass through to the anchor */
    }

    .hero-card,
    .sub-card {
        position: relative;
        z-index: auto;
        /* Reset stacking context if needed */
    }


}

/* Magazine Layout Styles */

/* Hero Section */
.hero-section {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 420px;
}

.hero-post,
.hero-link,
.hero-img-wrap {
    width: 100%;
    height: 100%;
}

.hero-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, #000 90%);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-xl);
    z-index: 10;
}

.category-badge {
    background: var(--accent-blue);
    color: #000;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
    max-width: 800px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-excerpt {
    font-size: 1.2rem;
    color: #ddd;
    max-width: 700px;
    margin-bottom: 1.5rem;
}

.read-more-btn {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Magazine Grid */
.magazine-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Main (2) - Sidebar (1) */
    gap: var(--spacing-xl);
}

/* Main Content */
.section-title {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    margin-bottom: var(--spacing-lg);
}

.post-card-horizontal {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: var(--spacing-lg);
}

.post-card-horizontal:last-child {
    border-bottom: none;
}

.post-link-wrapper {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.post-image {
    flex: 0 0 200px;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-link-wrapper:hover .post-image img {
    transform: scale(1.1);
}

.post-info {
    flex: 1;
}

.post-date {
    font-size: 0.85rem;
    color: var(--accent-blue);
    display: block;
    margin-bottom: 0.3rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Sidebar */
.sidebar-widget {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.widget-title {
    font-size: 1.2rem;
    border-bottom: 2px solid var(--accent-pink);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: trending-counter;
}

.trending-list li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2rem;
}

.trending-list .number {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.trending-list .title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    display: block;
}

.trending-list a:hover .title {
    color: var(--accent-pink);
}

.newsletter-widget input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.btn-full {
    width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .magazine-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        height: 350px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .post-link-wrapper {
        flex-direction: column;
    }

    .post-image {
        width: 100%;
        height: 200px;
        flex: none;
    }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 300px);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.bento-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}

.bento-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bento-item:hover img {
    transform: scale(1.05);
}

.bento-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(to top, #000, transparent);
    z-index: 2;
}

/* Single Post Specific Styles */
.single-article-wrap {
    background: transparent;
}

.single-header {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: var(--spacing-lg);
}

.post-meta-top {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-meta-top .cat-link {
    color: var(--accent-green);
    font-weight: 700;
}

.post-meta-top .sep {
    margin: 0 8px;
    color: #444;
}

.single-title {
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: #fff;
    font-weight: 700;
}

.author-meta {
    font-size: 1rem;
    color: #fff;
}

.author-meta .by {
    color: var(--text-muted);
    font-style: italic;
    margin-right: 5px;
}

.single-featured-image {
    margin-bottom: var(--spacing-xl);
}

.single-featured-image img {
    width: 100%;
    border-radius: var(--radius-md);
}

.caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
    text-align: right;
}

/* Article Typography (The Block Style) */
.article-body {
    font-size: 1.15rem;
    /* Larger for readability */
    line-height: 1.7;
    color: #e0e0e0;
    max-width: 100%;
}

.article-body p {
    margin-bottom: 1.8rem;
}

.article-body h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    border-left: 4px solid var(--accent-blue);
    padding-left: 1rem;
}

.article-body h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.8rem;
    position: relative;
}

.article-body a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
}

.article-body blockquote {
    border-left: 4px solid var(--accent-pink);
    background: linear-gradient(to right, rgba(255, 0, 85, 0.1), transparent);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-style: italic;
    color: #fff;
    border-radius: 4px;
}

.article-body strong {
    color: #fff;
    font-weight: 700;
}

/* Improve Post Image sizing - Full Width */
.article-body img {
    width: 100%;
    /* Full width of container */
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-top: 2rem;
    margin-bottom: 2rem;
    margin-left: 0;
    margin-right: 0;
}

/* Handle specific WordPress blocks */
.article-body .feature-img,
.article-body .wp-block-image {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.article-body .wp-block-image img {
    width: 100%;
    height: auto;
    margin: 0;
}

.article-body .wp-block-image figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Related Posts Widget */
.related-posts-widget {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-glass);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.related-item .related-thumb {
    height: 150px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.related-item .related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-item:hover .related-thumb img {
    transform: scale(1.05);
}

.related-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #eee;
    margin: 0;
}

.related-item:hover .related-title {
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* Ad Label Styles */
.ad-slot {
    margin: 2rem 0;
    text-align: center;
    background: transparent;
}

.ad-text-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Fear & Greed Index - Binance Style */
.fg-section-wrap {
    margin-bottom: var(--spacing-xl);
    border-top: 1px solid var(--border-glass);
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.fg-container {
    background: #181a20;
    /* Binance dark bg */
    border-radius: 16px;
    padding: 2rem;
    color: #fff;
    display: flex;
    /* Restore flex display */
    align-items: stretch !important;
    /* Restore stretch alignment */
    gap: 2rem;
}

.fg-main-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Gauge */
/* Gauge Wrapper - Half Circle Container */
.fg-gauge-wrap {
    width: 260px;
    height: 130px;
    /* Half of width */
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    /* Hide the bottom half of the circle */
}

/* Semi-Circle Gradient Arc */
.fg-gauge-arc {
    width: 260px;
    height: 260px;
    /* Full circle height */
    background: conic-gradient(from 270deg,
            #ff4d4d 0deg 45deg,
            /* Fear (Red) */
            #eeb92e 45deg 135deg,
            /* Neutral (Yellow) */
            #0ecb81 135deg 180deg,
            /* Greed (Green) */
            transparent 180deg);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Inner Mask (The Hole) */
.fg-gauge-arc::after {
    content: "";
    position: absolute;
    top: 20px;
    /* Thickness of ring = 20px */
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: #181a20;
    /* Match container bg */
    border-radius: 50%;
}

/* Needle */
.fg-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 110px;
    /* Length */
    background: #fff;
    border-radius: 4px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg);
    /* Default Start */
    transition: transform 1s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 10;
}

/* Needle Pivot Point */
.fg-needle::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: -3px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

/* Center Text (Score & Label) */
.fg-center-value {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
    padding-bottom: 0;
    /* Align with bottom */
}

.fg-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    margin-bottom: 5px;
}

.fg-label {
    display: block;
    font-size: 1rem;
    color: #848e9c;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    /* Push up slightly */
}

/* History Grid */
.fg-history-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.fg-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hist-label {
    color: #848e9c;
}

.hist-val {
    font-size: 1.25rem;
    font-weight: 600;
}

.hist-data {
    text-align: right;
}

.hist-status {
    display: block;
    font-size: 0.8rem;
    color: #848e9c;
}

.hist-score {
    font-size: 1.25rem;
    font-weight: 600;
}

.fg-desc-small {
    font-size: 0.9rem;
    color: #848e9c;
    line-height: 1.5;
}

.fg-countdown-timer {
    font-family: 'Space Grotesk', monospace;
    color: var(--accent-blue);
}

/* Load More Button */
.btn-load-more {
    background: #181a20;
    color: #fff;
    border: 1px solid var(--border-glass);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #000;
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .fg-container {
        flex-direction: column !important;
    }

    .fg-history-grid {
        width: 100%;
        margin-top: 2rem;
    }
}

/* =========================================
   Coins Page Styles
   ========================================= */

.coins-page-wrap {
    padding: 3rem 0;
    min-height: 80vh;
}

.coins-header {
    margin-bottom: 2rem;
}

.coins-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #848e9c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.coins-header .page-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Table Container with scroll for mobile */
.coins-table-container {
    width: 100%;
    overflow-x: auto;
    background: #181a20;
    /* Binance-like dark card bg */
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
}

.coins-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    /* Prevent wrapping */
}

.coins-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}

.coins-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #eaecef;
    font-size: 0.95rem;
    font-weight: 500;
}

.coins-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.coins-table tr:last-child td {
    border-bottom: none;
}

/* Columns Config */
.col-rank {
    width: 50px;
    text-align: center;
    color: var(--text-muted) !important;
}

.col-coin {
    min-width: 200px;
}

.col-price {
    text-align: right;
    font-family: 'Space Grotesk', monospace;
}

.col-change {
    text-align: right;
}

.col-mcap,
.col-vol {
    text-align: right;
    color: var(--text-muted) !important;
    font-family: 'Space Grotesk', monospace;
}

.col-chart {
    width: 150px;
    padding: 0.5rem !important;
}

/* Coin Cell */
.coin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.coin-name-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.coin-symbol {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Utils */
.text-green {
    color: #0ecb81 !important;
}

.text-red {
    color: #f6465d !important;
}

/* Sparkline SVG */
.sparkline {
    width: 140px;
    height: 40px;
    display: block;
}

.sparkline path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .coins-header .page-title {
        font-size: 2rem;
    }

    /* Hide less important columns on mobile if needed, or just let it scroll horizontal */
    /* .col-mcap, .col-vol { display: none; } */
}

/* Header Search */
.header-actions {
    display: flex;
    align-items: center;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2px 5px 2px 15px;
    transition: all 0.3s ease;
}

.header-search-form:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: #5d6675;
}

.header-search-form .search-field {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    width: 150px;
    /* Compact width */
    height: 32px;
    outline: none;
}

.header-search-form .search-field::placeholder {
    color: #5d6675;
}

.header-search-form .search-submit {
    background: transparent;
    border: none;
    color: #848e9c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.3s ease;
}

.header-search-form .search-submit:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .header-search-form .search-field {
        width: 100px;
    }
}

/* Live Price Title Badge */
.live-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 2px 10px;
    margin-left: 15px;
    vertical-align: middle;
    font-size: 0.6em;
    /* Relative to h1 */
    font-weight: 500;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.5s ease;
}

.live-title-badge.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Colors for changes */
.price-change.up {
    color: #0ecb81;
}

.card-change.up {
    color: #0ecb81;
}

.price-change.down {
    color: #f6465d;
}

.card-change.down {
    color: #f6465d;
}


/* Live Coin Card (In Content) */
.live-coin-card {
    background: #181a20;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: none;
    /* JS toggles this */
}

.live-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.card-price {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Space Grotesk', monospace;
}

.card-change {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Fixed Logo Styles */
.card-coin-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.card-header-flex {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Remove margin bottom from label since it is now flexed */
.card-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.btn-check-market {
    color: #fff;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-check-market:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #000;
}

@media (max-width: 600px) {
    .live-title-badge {
        display: none;
    }

    /* Hide in title on mobile if too cramped */
    .live-card-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* =========================================
   Mobile Navigation
   ========================================= */

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    margin: 4px 0;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .main-nav-bar {
        position: relative;
        flex-wrap: wrap;
        /* Allow wrap so menu drops down if we want, or absolute positioning */
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
        /* Push to right if flex */
        margin-right: 15px;
    }

    .header-actions {
        order: 2;
        /* Ensure actions stay visible or adjust order */
    }

    /* Mobile Menu Container */
    .main-navigation {
        display: none;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        border-top: 1px solid var(--border-glass);
        position: absolute;
        top: 70px;
        /* Header height */
        left: 0;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .main-navigation.toggled {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-navigation ul li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: 15px 0;
        font-size: 1.1rem;
    }

    /* Mobile Submenus */
    .main-navigation ul ul {
        position: static;
        /* Stack naturally on mobile */
        display: none;
        background: rgba(255, 255, 255, 0.03);
        box-shadow: none;
        padding-left: 20px;
        border: none;
    }

    .main-navigation ul li.menu-item-has-children:hover>ul,
    .main-navigation ul li.menu-item-has-children.focus>ul {
        display: block;
    }

    /* Adjust Ticker for Mobile */
    .ticker-item {
        padding: 0 1rem;
        font-size: 0.8rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}