/* ==========================================================
   Boldmen Fullscreen Toggle — v2.0_TICKER_AWARE
   ========================================================== */

/* Fullscreen Toggle Button */
.bmt-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85), rgba(118, 75, 162, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35), 0 0 40px rgba(102, 126, 234, 0.08);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    color: #fff;
}

/* === AUTO-HIDE TOGGLE BUTTON WHEN IDLE (v2.0) === */
body.bmt-fullscreen-active.bmt-idle .bmt-fullscreen-btn {
    opacity: 0 !important;
    pointer-events: none;
    transform: scale(0.8);
}

.bmt-fullscreen-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.55), 0 0 50px rgba(118, 75, 162, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.bmt-fullscreen-btn:active {
    transform: scale(0.95);
}

.bmt-fullscreen-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

/* Icon toggle on fullscreen state */
body.bmt-fullscreen-active .bmt-fullscreen-btn .expand-icon {
    display: none;
}

/* Animation for entering/exiting fullscreen */
@keyframes fullscreenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body.bmt-fullscreen-active #boldmen-terminal-container {
    animation: fullscreenFadeIn 0.3s ease-out;
}

/* Smart Idle Behavior: Hide scrollbar and cursor when idle */
body.bmt-fullscreen-active.bmt-idle,
body.bmt-fullscreen-active.bmt-idle #boldmen-terminal-container,
body.bmt-fullscreen-active.bmt-idle .boldmen-terminal-wrapper,
body.bmt-fullscreen-active.bmt-idle .bmt-table-wrapper,
body.bmt-fullscreen-active.bmt-idle .bmt-terminal-container,
body.bmt-fullscreen-active.bmt-idle [class*="terminal"] {
    cursor: none;
}

/* Hide scrollbar ONLY when idle */
body.bmt-fullscreen-active.bmt-idle::-webkit-scrollbar,
body.bmt-fullscreen-active.bmt-idle .bmt-terminal-container::-webkit-scrollbar,
body.bmt-fullscreen-active.bmt-idle .bmt-table-wrapper::-webkit-scrollbar,
body.bmt-fullscreen-active.bmt-idle #boldmen-terminal-container::-webkit-scrollbar,
body.bmt-fullscreen-active.bmt-idle [class*="terminal"]::-webkit-scrollbar {
    display: none !important;
}

body.bmt-fullscreen-active.bmt-idle,
body.bmt-fullscreen-active.bmt-idle .bmt-terminal-container,
body.bmt-fullscreen-active.bmt-idle .bmt-table-wrapper,
body.bmt-fullscreen-active.bmt-idle #boldmen-terminal-container,
body.bmt-fullscreen-active.bmt-idle [class*="terminal"] {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* === HEADER & INDICES ALWAYS VISIBLE (v2.0) === */
body.bmt-fullscreen-active .bmt-terminal-container.bmt-fullscreen-mode .bmt-header-container,
body.bmt-fullscreen-active .bmt-terminal-container.bmt-fullscreen-mode.bmt-toolbar-hidden .bmt-header-container {
    opacity: 1 !important;
    max-height: 500px !important;
    visibility: visible !important;
    display: block !important;
    overflow: visible !important;
    transition: opacity 0.5s ease;
    margin-bottom: 20px !important;
}

body.bmt-fullscreen-active .bmt-terminal-container.bmt-fullscreen-mode .bmt-indices-bar,
body.bmt-fullscreen-active .bmt-terminal-container.bmt-fullscreen-mode.bmt-toolbar-hidden .bmt-indices-bar {
    opacity: 1 !important;
    max-height: 500px !important;
    visibility: visible !important;
    display: flex !important;
    overflow: visible !important;
    transition: opacity 0.5s ease;
    margin-bottom: 15px !important;
}

body.bmt-fullscreen-active .bmt-header-container .bmt-eyebrow,
body.bmt-fullscreen-active .bmt-header-container .bmt-brand-name {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Toolbar fade */
.bmt-terminal-container.bmt-fullscreen-mode .bmt-toolbar {
    transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease, padding 0.5s ease;
    overflow: hidden;
}

body.bmt-fullscreen-active .bmt-terminal-container.bmt-fullscreen-mode.bmt-toolbar-hidden .bmt-toolbar {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* ==========================================================
   TICKER-AWARE TABLE HEIGHT (v2.0)
   When ticker is visible in fullscreen, shrink table to make room.
   When ticker is hidden, table gets full height.
   ========================================================== */

/* Default: ticker hidden — full height */
.bmt-terminal-container.bmt-fullscreen-mode .bmt-table-wrapper {
    max-height: calc(100vh - 120px) !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bmt-terminal-container.bmt-fullscreen-mode.bmt-toolbar-hidden .bmt-table-wrapper {
    max-height: calc(100vh - 60px) !important;
}

/* Ticker visible: reduce table height by ticker bar (45px) */
body.bmt-fullscreen-active.bmt-ticker-fs-visible .bmt-terminal-container.bmt-fullscreen-mode .bmt-table-wrapper {
    max-height: calc(100vh - 165px) !important;
}

body.bmt-fullscreen-active.bmt-ticker-fs-visible .bmt-terminal-container.bmt-fullscreen-mode.bmt-toolbar-hidden .bmt-table-wrapper {
    max-height: calc(100vh - 105px) !important;
}

/* ==========================================================
   TICKER REOPEN BUTTON — FULLSCREEN VISIBILITY (v2.0)
   Non-intrusive pill at bottom center, always accessible.
   Fades on idle to stay out of the way.
   ========================================================== */

/* In fullscreen, ensure reopen button sits above everything */
body.bmt-fullscreen-active .bmt-ticker-reopen {
    z-index: 1000001 !important;
    position: fixed !important;
    bottom: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Fade reopen button on idle in fullscreen */
body.bmt-fullscreen-active.bmt-idle .bmt-ticker-reopen {
    opacity: 0.15 !important;
    transition: opacity 0.5s ease !important;
}

body.bmt-fullscreen-active.bmt-idle .bmt-ticker-reopen:hover {
    opacity: 1 !important;
}

/* Ensure ticker container is visible in fullscreen */
body.bmt-fullscreen-active #bmt-ticker-container {
    z-index: 1000000 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Fade ticker close button on idle */
body.bmt-fullscreen-active.bmt-idle #bmt-ticker-container .bmt-ticker-close {
    opacity: 0.15;
    transition: opacity 0.5s ease;
}

body.bmt-fullscreen-active.bmt-idle #bmt-ticker-container .bmt-ticker-close:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bmt-fullscreen-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }

    .bmt-fullscreen-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Keyboard shortcut hint tooltip */
.bmt-fullscreen-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bmt-fullscreen-btn:hover::after {
    opacity: 1;
}
