/* CSS/menuwidget.css */

/* 1. Hide the entire widget on desktop */
.floating-menu-container {
    display: none;
}

/* 2. Show and style the widget only on mobile (screens 900px and smaller) */
@media (max-width: 900px) {
    .floating-menu-container {
        display: block;
        position: fixed;
        bottom: 25px;
        right: 25px;
        z-index: 9999; /* Keeps it above everything */
    }

    /* Hide the actual checkbox, we just use it for its 'checked' state */
    .floating-menu-toggle {
        display: none;
    }

    /* The main floating button */
    .floating-menu-button {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 60px;
        height: 60px;
        background-color: #2c5364; /* Goal Finance Dark Blue */
        color: white;
        border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        cursor: pointer;
        font-size: 28px;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy animation */
        position: relative;
        z-index: 10000;
    }

    /* Hide the 'close' icon by default */
    .floating-menu-button .close-icon {
        display: none;
    }

    /* When clicked (checkbox checked), rotate and turn red */
    .floating-menu-toggle:checked + .floating-menu-button {
        transform: rotate(90deg);
        background-color: #dc3545; 
    }

    /* Swap the icons when open */
    .floating-menu-toggle:checked + .floating-menu-button .open-icon {
        display: none;
    }
    .floating-menu-toggle:checked + .floating-menu-button .close-icon {
        display: block;
    }

    /* The hidden menu items container */
    .floating-menu-items {
        position: absolute;
        bottom: 80px; /* Pushes it above the main button */
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
        visibility: hidden;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
    }

    /* Reveal the menu items when the button is clicked */
    .floating-menu-toggle:checked ~ .floating-menu-items {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    /* Individual menu links */
    .floating-menu-items a {
        display: flex;
        align-items: center;
        background-color: white;
        color: #2c5364;
        padding: 10px 20px;
        border-radius: 30px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.15);
        text-decoration: none;
        font-weight: bold;
        font-size: 15px;
        white-space: nowrap;
        border: 1px solid #e9ecef;
        transition: background-color 0.2s;
    }
    
    .floating-menu-items a:active {
        background-color: #f0f2f5;
    }
}