/* GEX Heatmap page styles */

.heatmap-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.heatmap-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.heatmap-controls-left,
.heatmap-controls-center,
.heatmap-controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heatmap-select {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.heatmap-select:focus {
    outline: none;
    border-color: #4a9eff;
}

.heatmap-range-group,
.heatmap-mode-group {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 2px;
}

.heatmap-range-btn,
.heatmap-mode-btn {
    background: transparent;
    color: #a0a0a0;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.heatmap-range-btn:hover,
.heatmap-mode-btn:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.1);
}

.heatmap-range-btn.active,
.heatmap-mode-btn.active {
    color: #ffffff;
    background: rgba(74, 158, 255, 0.3);
}

.heatmap-range-btn.locked,
.heatmap-mode-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.heatmap-range-btn.locked::after,
.heatmap-mode-btn.locked::after {
    content: "\1F512";
    font-size: 0.6rem;
    position: absolute;
    top: 2px;
    right: 2px;
}

.heatmap-upgrade-banner {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #ffc107;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.heatmap-upgrade-link {
    color: #ffc107;
    text-decoration: underline;
    font-weight: 600;
}

.heatmap-image-wrapper {
    position: relative;
    background: var(--theme-chart-bg);
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heatmap-img {
    width: 100%;
    height: auto;
    display: block;
}

.heatmap-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.heatmap-footer {
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: #808080;
    text-align: right;
}

/* Checkbox control */
.heatmap-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #a0a0a0;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.heatmap-checkbox input {
    accent-color: #4a9eff;
    cursor: pointer;
}

.heatmap-checkbox:hover span {
    color: #e0e0e0;
}

/* Hover tooltip */
.heatmap-tooltip {
    display: none;
    position: absolute;
    z-index: 20;
    pointer-events: none;
    background: rgba(10, 10, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
    color: #e0e0e0;
    line-height: 1.5;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.heatmap-tooltip b {
    color: #ffffff;
}

.heatmap-tooltip-ts {
    color: #a0a0a0;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

/* ========================================
   OVERLAY ROWS (top of chart)
   ======================================== */

/* Shared row layout — full-width, positioned from top */
.heatmap-overlay-row {
    position: absolute;
    left: 6px;
    right: 6px;
    z-index: 15;
    display: flex;
    align-items: center;
}

/* Row 1: Title + Timestamp */
#heatmap-header-row {
    top: 4px;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
}

.heatmap-overlay-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e0e0e0;
}

[data-bs-theme="light"] .heatmap-overlay-title {
    color: #1a1a1a;
}

.heatmap-overlay-timestamp {
    font-size: 0.68rem;
    opacity: 0.8;
    color: #e0e0e0;
}

[data-bs-theme="light"] .heatmap-overlay-timestamp {
    color: #1a1a1a;
}


/* ========================================
   HEATMAP VIEW — taller chart, no markers/slider
   ======================================== */

/* Heatmap image fills available vertical space */
#gex-heatmap-view {
    display: flex;
    flex-direction: column;
}

#heatmap-image-wrapper {
    flex: 1;
    background: var(--theme-chart-bg);
    border-radius: 8px;
    overflow: hidden;
    min-height: 500px;
}

#heatmap-chart-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Hide palette toolbar control on mobile */
    #heatmap-palette-wrapper {
        display: none !important;
    }

    .heatmap-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .heatmap-controls-left,
    .heatmap-controls-center,
    .heatmap-controls-right {
        justify-content: center;
    }

    .heatmap-overlay-title {
        font-size: 0.7rem;
    }

    .heatmap-overlay-timestamp {
        font-size: 0.6rem;
    }


    .heatmap-overlay-select {
        font-size: 0.75rem;
        padding: 4px 8px;
        min-height: 32px;
    }

    /* Auto-scale heatmap to fill available vertical space on mobile */
    #gex-heatmap-view {
        flex-grow: 1;
        min-height: 0;
    }

    #heatmap-image-wrapper {
        flex: 1;
        min-height: 250px;
        border-radius: 0 !important;
    }

    #heatmap-chart-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
