/* Fullscreen Toggle Button */
.bmt-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
}

.bmt-fullscreen-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.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 cursor */
}

/* 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;
    /* IE and Edge */
    scrollbar-width: none !important;
    /* Firefox */
}

/* 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 (optional tooltip) */
.bmt-fullscreen-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bmt-fullscreen-btn:hover::after {
    opacity: 1;
}