/* Header Controls */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 30px; */
    margin-bottom: 2px;
}

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

/* Stats Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.02);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}

body.dark-mode .stat-card {
    background: rgba(255, 255, 255, 0.03);
}

.stat-card h4 {
    margin: 0 0 8px;
    color: var(--dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

#news-ticker-container{
    /* border-top: 1px solid #e2e8f0; */
    border-top: 1px solid var(--border);
    /* background: #f1f5f9; */
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
}

body.dark-mode #news-ticker-container{
    border-top: 1px solid var(--border);
    /* background: #1e293b; */
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
}

@keyframes scroll-news {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

#news-ticker-container:hover #ticker-scroll {
    animation-play-state: paused; /* Pause on hover to read better */
    cursor: pointer;
}

#ticker-scroll {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%; /* Start the news from off-screen right */
    animation: scroll-news 100s linear infinite; /* Increased time for smoother read */
}

@keyframes scroll-news {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Scroll only half-way because we doubled the string */
}

#ticker-scroll {
    display: flex;
    white-space: nowrap;
    width: max-content; /* Critical: allows the div to be as wide as the links */
    animation: scroll-news 80s linear infinite;
}

#ticker-scroll:hover {
    animation-play-state: paused; /* Allows users to click easily */
}

@keyframes scroll-news {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Halfway through the doubled list */
}



/* Wrapper to allow horizontal scrolling */
#table-wrapper,
#stats-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
}

.monthly-mode th,
.monthly-mode td {
    /* padding: 4px 4px !important; */
    padding: 3px 4px !important;
    /* Balanced padding for daily numbers */
    font-size: 15px;
    font-weight: bold;
}


/* Specific Styles for Daily Mode */
.daily-mode table {
    table-layout: auto;
    min-width: 1200px;
    /* Wider than screen but narrower than weekly */
}

.daily-mode th,
.daily-mode td {
    padding: 10px 4px !important;
    /* Balanced padding for daily numbers */
    font-size: 11px;
    /* font-size: 12px;
    font-weight: bold;*/
}

/* Specific Styles for Weekly Mode */
.weekly-mode table {
    table-layout: auto;
    /* Allows table to expand past container width */
    min-width: 2500px;
    /* Ensures all 52 weeks have space to breathe */
}

.weekly-mode th,
.weekly-mode td {
    padding: 8px 2px !important;
    /* Your requested smaller padding */
}

#capture-zone {
    position: relative;
    overflow: hidden;
    /* Keeps the watermark inside the container */
}

#capture-zone::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 670px;
    /* Adjust size to match your logo */
    height: 400px;
    background-image: url('/assets/images/footer-logo-dark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    /* The "Theme-Aware" Magic */
    opacity: 0.45;
    /* Very faint so it doesn't block numbers */
    filter: grayscale(100%);
    /* Makes it look professional */

    pointer-events: none;
    /* Allows clicking through to the table */
    z-index: 10;
    /* Sits behind the table rows */
}

#main-table,
#stats-table {
    position: relative;
    z-index: 1;
    /* Ensures table is on top of watermark */
    background: transparent !important;
    /* Allow watermark to show through */
}

#capture-zone::after {
    content: "BitcoinMonthlyReturn.com";
    position: absolute;
    top: calc(50% + 160px);
    /* Positioned below the 400px logo */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    font-size: 34px;
    color: var(--text);
    opacity: 0.3;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 10;
}

/* Normal state: Watermark is visible */
#capture-zone::before,
#capture-zone::after {
    /*content: "BitcoinMonthlyReturn.com";*/
    /* or your website URL */
    /* ... your existing watermark CSS ... */
    display: block;
}

/* Capturing state: Hide the CSS watermark so the JS can draw the high-res one */
.is-capturing#capture-zone::before,
.is-capturing#capture-zone::after {
    display: none !important;
}

/* table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  position: relative;
  z-index: 2;
} */

@keyframes pulse-glow {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.live-pulse {
    animation: pulse-glow 2s infinite;
    font-weight: 800 !important;
    border: 1px solid var(--blue) !important;
}




@keyframes live-pulse-cycle-table {
    0% {
        box-shadow: inset 0 0 0 2px rgba(2, 192, 118, 0.4);
    }

    50% {
        box-shadow: inset 0 0 0 2px rgba(2, 192, 118, 0.9);
    }

    100% {
        box-shadow: inset 0 0 0 2px rgba(2, 192, 118, 0.4);
    }
}

.live-cell-cycle-table {
    animation: live-pulse-cycle-table 2s infinite ease-in-out;
    border: 2px solid #02c076 !important;
    position: relative;
}

.live-cell-cycle-table::after {
    content: "LIVE";
    position: absolute;
    top: -8px;
    right: 2px;
    background: #02c076;
    color: white;
    font-size: 7px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 900;
}

/* --- FLEX FILL HELPER --- */
/* This ensures the row child (column) stretches the card inside it */
.row-equal-height {
    display: flex;
    flex-wrap: wrap;
}

.row-equal-height > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.row-equal-height > [class*="col-"] > .glass-card {
    flex: 1 0 auto; /* This forces the card to grow to fill the column height */
}

/* 1. Default state (Mobile/Extra Small) */
.sticky-sm-up {
    position: static !important; /* Forces it to stay in the normal flow on phones */
}

@media (min-width: 576px) {
  .sticky-sm-up {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0; /* Or your preferred offset */
    z-index: 1020; /* Bootstrap's default sticky z-index */
  }
}

/* Ensure the zone is fully expanded during capture */
#capture-zone.is-capturing {
    width: fit-content !important;
    min-width: 1200px; /* Or whatever width your desktop table usually is */
    display: block !important;
}