/* Floating Action Button (FAB) for Mobile */

.fab-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    /* Hide on desktop (>768px) */
    display: block;
}

@media (min-width: 768px) {
    .fab-container {
        display: none;
    }
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Pixel style border */
    outline: 3px solid rgba(255, 255, 255, 0.3);
    outline-offset: -3px;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.fab-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* Pulse animation on first appearance */
@keyframes fabPulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4), 0 0 0 0 rgba(108, 92, 231, 0.4);
    }

    50% {
        box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4), 0 0 0 10px rgba(108, 92, 231, 0);
    }
}

.fab-btn.pulse {
    animation: fabPulse 2s ease-in-out 3;
}

/* Icon rotation on hover */
.fab-btn .fab-icon {
    transition: transform 0.3s ease;
    display: block;
    line-height: 1;
}

.fab-btn:hover .fab-icon {
    transform: rotate(90deg);
}

/* Tooltip */
.fab-tooltip {
    position: absolute;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    background: #2d3436;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.fab-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #2d3436;
}

.fab-container:hover .fab-tooltip {
    opacity: 1;
}

/* Dark mode support */
.dark-mode .fab-btn {
    background: linear-gradient(135deg, #5b4cdb 0%, #8b7ff0 100%);
    box-shadow: 0 4px 15px rgba(91, 76, 219, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dark-mode .fab-tooltip {
    background: #4a4a5e;
}

.dark-mode .fab-tooltip::after {
    border-left-color: #4a4a5e;
}