:root {
    --bg-color: #000000;
    --card-bg: #0a0a0a;
    --border: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #10b981;
    --accent-red: #ef4444;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --card-glass-bg: rgba(10, 10, 10, 0.5);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.light-mode {
    --bg-color: #f4f4f5;
    --card-bg: #ffffff;
    --border: #e4e4e7;
    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --card-glass-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px; /* Narrower for mobile-first feel like the image */
    margin: 0 auto;
    padding: 0 24px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0 0; /* No bottom padding to allow progress bar to sit at the edge */
    background: var(--card-glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.scroll-progress-container {
    width: 100%;
    height: 3px;
    background: transparent;
    margin-top: 12px;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent), #6366f1);
    transition: width 0.1s ease;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.header-logo-img {
    height: 36px;
    width: auto;
}

body.dark-mode .header-logo-img {
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -1px;
    color: var(--text-primary);
    text-transform: lowercase;
}

.logo span {
    color: var(--accent);
}

.desktop-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.desktop-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

/* Hero Price Cards */
#latest-feed {
    padding-top: 20px;
}

.hero-price-card {
    position: relative;
    padding: 32px;
    margin-bottom: 24px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.hero-price-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent);
}

.hero-price-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.price-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.price-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.price-main {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.price-main h1 {
    font-size: 3.9rem;
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text-primary);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.trend-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.trend-badge.up { 
    background: rgba(16, 185, 129, 0.1);
    color: #10b981; 
}

.trend-badge.down { 
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444; 
}

body.light-mode .trend-badge.up {
    background: #10b98122;
    color: #065f46;
}

body.light-mode .trend-badge.down {
    background: #ef444422;
    color: #991b1b;
}

.price-sub-info {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 5px;
    font-weight: 400;
}

.price-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.price-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-stats b {
    color: var(--text-primary);
    font-weight: 600;
}

/* Glass Cards */
.card-glass {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    margin-top: 24px;
    margin-bottom: 32px;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.card-header-simple h2 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.date-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Schedule List */
.schedule-vertical {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.schedule-item-premium {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.sched-time {
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 65px;
    padding-top: 2px;
}

.sched-info {
    flex: 1;
}

.sched-info h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 2px;
}

.sched-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.watch-btn-pill {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
}

.next-up-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
}

.next-up-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.next-up-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chart Styles */
.chart-header-premium {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fullscreen-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fullscreen-btn:hover {
    border-color: var(--accent);
}

.period-selector {
    display: flex;
    background: var(--bg-color);
    padding: 2px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-container-large {
    position: relative;
    width: 100%;
    height: 250px;
    transition: all 0.3s ease;
}

/* Fullscreen Chart Overlay */
.chart-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: none;
    flex-direction: column;
    padding: 24px;
}

.chart-fullscreen-overlay.active {
    display: flex;
}

.fs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.fs-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.close-fs-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.fs-chart-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
}

/* Auction Cards Grid */
.auction-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.auction-data-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.2s ease;
    box-shadow: var(--card-shadow);
}

.auc-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.auc-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.auc-avg {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auc-card-mid h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.auc-card-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.auc-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auc-stat .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

.auc-stat .val {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Alert Card */
.alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.alert-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

.alert-icon-circle {
    background: #10b98122;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-text h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.alert-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Explore */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

#explore {
    padding-bottom: 40px;
}

.explore-header {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.explore-nav-links, .explore-sub-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.explore-nav-links a, .explore-sub-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* Footer */
.main-footer {
    padding: 60px 0 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-logo-img {
    height: 48px;
    width: auto;
    margin-bottom: 20px;
    opacity: 1;
}

body.dark-mode .footer-logo-img {
    filter: grayscale(1) brightness(2);
}

/* Chart.js overrides */
canvas {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

/* Loading Shimmer */
.loading-shimmer {
    background: linear-gradient(90deg, var(--card-bg) 25%, var(--bg-color) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
