/**
 * Floating Action Button (FAB) - Create Thread
 * Twitter-style mobile/tablet only FAB
 */

/* FAB Container - Hidden by default, shown only on mobile/tablet homepage */
.fab-create-thread {
    display: none;
    position: fixed;
    bottom: 80px; /* Above mobile nav bar */
    right: 20px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    align-items: center;
    justify-content: center;
}

.fab-create-thread:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: var(--primary-hover, var(--primary-color));
}

.fab-create-thread:active {
    transform: scale(0.95);
}

.fab-create-thread img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Make icon white */
}

/* Show FAB only on mobile and tablet when body has .fab-visible class */
@media (max-width: 1024px) {
    body.fab-visible .fab-create-thread {
        display: flex;
    }
}

/* Adjust position when there's no bottom nav (smaller screens might not have it) */
@media (max-width: 480px) {
    .fab-create-thread {
        bottom: 75px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
    
    .fab-create-thread img {
        width: 22px;
        height: 22px;
    }
}

/* Hide on desktop */
@media (min-width: 1025px) {
    .fab-create-thread {
        display: none !important;
    }
}

/* Animation for entrance */
@keyframes fab-entrance {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

body.fab-visible .fab-create-thread {
    animation: fab-entrance 0.3s ease-out;
}

/* Dark mode adjustments */
[data-theme="dark"] .fab-create-thread {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .fab-create-thread:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
