/* General Styling */
main {
    margin: 2px;
    border: 5px solid rgba(209, 204, 207, 0.8);
    border-radius: 10px;
    padding: 10px;


}
body {
    padding-top: 70px;
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    margin-bottom: 60px;
}

#floatingBtn {
    display: none;
}
/* Navbar */
.navbar-nav .nav-link {
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

    .navbar-nav .nav-link:hover {
        color: #ffc107;
        text-decoration: none;
        border-bottom: 4px solid rgba(209, 204, 207, 0.8);
        padding-bottom: 3px;
        transition: all 0.3s ease;
    }

.navbar-brand {
    font-size: 1.5rem;
}

/* Active Links */
.navbar-nav .nav-link.active {
    background-color: yellow !important;
    color: black !important;
    border-radius: 5px;
    padding: 5px 10px;
}

.sidebar .nav-link.active {
    font-weight: bold;
    color: #007bff !important;
}

.genai-menu {
    background: linear-gradient(135deg, #b100a4, #79005c);
    box-shadow: 0 10px 25px rgba(121, 0, 92, 0.25);
}

.genai-menu .nav-link {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.genai-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: #fff !important;
}

.genai-menu .nav-link.active {
    background-color: #fff !important;
    color: #77005b !important;
}

/* Sidebar */
#sidebarMenu {
    height: 85vh;
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    border-radius: 10px;
    padding: 10px;
}

    #sidebarMenu h5 {
        font-weight: 600;
        color: #343a40;
        font-size: 1.1rem;
    }

    #sidebarMenu ul {
        list-style: none;
        padding-left: 0;
    }

    #sidebarMenu .nav-link {
        color: #007bff;
        text-decoration: none;
        font-size: 0.86rem;
        padding: 0.4rem 0.8rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

        #sidebarMenu .nav-link:hover {
            background-color: #e9ecef;
            color: #0056b3;
        }

        #sidebarMenu .nav-link.active {
            background-color: #e9ecef;
            color: #fff;
        }

    #sidebarMenu .collapse {
        padding-left: 1rem;
    }

        #sidebarMenu .collapse .nav-link {
            font-size: 0.75rem; /* Even smaller for dropdown items */
            padding: 0.3rem 0.7rem; /* Less padding */
        }

/* Dropdown Icon Animation */
.dropdown-icon {
    transition: transform 0.3s ease;
}

.dropdown-icon.rotate {
    transform: rotate(90deg);
}

/* Scrollable navbar scrollbar styling (visible on lg and above only) */
@media screen and (min-width: 992px) {
    /* 1. Scrollbar appearance */
    .scrollable-navbar {
        scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
        scrollbar-width: thin;
        overflow-x: auto;
        white-space: nowrap;
        padding: 4px 6px;
        margin-right: 10px;
        margin-left: 10px;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

        .scrollable-navbar::-webkit-scrollbar {
            height: 6px;
        }

        .scrollable-navbar::-webkit-scrollbar-thumb {
            background-color: rgba(255, 255, 255, 0.4);
            border-radius: 5px;
        }

        .scrollable-navbar::-webkit-scrollbar-track {
            background: transparent;
        }

        /* 2. Spacing between nav items */
        .scrollable-navbar .nav-item {
            margin-right: 10px;
        }

        /* 3. Subtle background & active styling */
        .scrollable-navbar .nav-link {
            background-color: rgba(255, 255, 255, 0.02);
            padding: 6px 12px;
            border-radius: 4px;
            transition: background-color 0.3s ease;
        }

            .scrollable-navbar .nav-link:hover {
                background-color: rgba(255, 255, 255, 0.15);
                padding:6px 10px 0px 10px;
            }

            .scrollable-navbar .nav-link.active {
                background-color: yellow !important;
                color: black !important;
            }

        /* 4. Optional visual divider between items */
        .scrollable-navbar .nav-item:not(:last-child) {
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            padding-right: 10px;
        }
}


@media screen and (max-width: 991px){
    #navbarNav {
        position: fixed; /* Keeps it visible */
        right: 5px; /* Slight margin */
        top: 11vh; /* Adjusted dynamically for visibility */
        width: 40vw; /* Keeps it responsive */
        height: auto; /* Allows natural expansion */
        max-height: 40vh; /* Adjusted to prevent hiding */
        overflow-y: auto; /* Enables scrolling */
        background: rgba(0, 0, 0, 0.9); /* Ensures contrast */
        border-radius: 10px;
        padding: 5px;
        transition: all 0.3s ease-in-out;
        z-index: 1500; /* Ensures it's above other elements */
    }

        /* Ensure visibility of first items */
        #navbarNav .nav-item:first-child {
            margin-top: 10px; /* Prevents top cut-off */
        }
}

.custom-toggle-btn {
    max-width: 150px; /* Prevents button from growing too wide */
    font-size: clamp(12px, 2vw, 16px); /* Auto scales font between 12px-16px */
    padding: 6px 10px;
    white-space: nowrap; /* Prevents text from wrapping to a new row */
    overflow: hidden;
    text-overflow: ellipsis; /* Truncates text if it's too long */
}


/* Mobile View */
@media screen and (max-width: 767px) {
    #navbarNav {
        position: fixed; /* Keeps it visible */
        right: 5px; /* Slight margin */
        top: 10vh; /* Adjusted dynamically for visibility */
        width: 40vw; /* Keeps it responsive */
        height: auto; /* Allows natural expansion */
        max-height: 40vh; /* Adjusted to prevent hiding */
        overflow-y: auto; /* Enables scrolling */
        background: rgba(0, 0, 0, 0.9); /* Ensures contrast */
        border-radius: 10px;
        padding: 5px;
        transition: all 0.3s ease-in-out;
        z-index: 1500; /* Ensures it's above other elements */
    }

        /* Ensure visibility of first items */
        #navbarNav .nav-item:first-child {
            margin-top: 10px; /* Prevents top cut-off */
        }


    #sidebarMenu {
        width: 95%;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
        z-index: 1000;
        margin: 10px 5px 0 10px;
        border-radius: 10px;
    }

    #contentdropdownbtn {
        display: block;
        position: relative;
        width: 100%;
        border: none;
        border-radius: 0px;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: bold;
        background: linear-gradient(45deg, #007bff, #6610f2);
        color: white;
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.5s ease-in-out; /* Smooth shrinking transition */
        text-align: center;
        margin: 0;
    }
    /* Floating Button Styling */
    .floating-button {
        position: fixed;
        top: 80px;
        left: 10px;
        width: 40px;
        height: 40px;
        background: linear-gradient(45deg, #007bff, #6610f2);
        color: white;
        font-size: 18px;
        font-weight: bold;
        border: none;
        border-radius: 50%;
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
    }

        .floating-button:hover {
            background: linear-gradient(45deg, #6610f2, #007bff);
            box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.4);
        }


        #contentdropdownbtn:hover {
            background: linear-gradient(45deg, #6610f2, #007bff);
            box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.3);
        }

    /* Slow shrinking when sidebar is open */
    .sidebar-open #contentdropdownbtn {
        position: fixed;
        top: 60px;
        left: 50%;
        width: 80%;
        max-width: 250px;
        transform: translateX(-50%);
        border-radius: 10px;
        z-index: 1050;
        transition: width 0.7s ease-in-out, transform 0.7s ease-in-out, top 0.5s ease-in-out;
    }

    /* Sidebar smooth opening */
    .sidebar-open #sidebarMenu {
        position: fixed;
        top: 70px;
        left: 10%;
        height: 100vh;
        width: 100%;
        max-width: 80%;
        z-index: 1000;
        overflow-y: auto;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transition: all 0.6s ease-in-out; /* Smooth transition */
    }

    /* Prevent button jump when clicked */
    #contentdropdownbtn:active {
        background: linear-gradient(45deg, #0056b3, #4b0082);
        transform: translateX(-50%);
        box-shadow: none;
    }

    /* Smooth closing transition */
    .sidebar-closed #contentdropdownbtn {
        position: relative;
        width: 100%;
        transition: all 0.6s ease-in-out; /* Slow return to full width */
    }

    /* Ensure button does not flicker */
    #contentdropdownbtn .navbar-toggler-icon {
        filter: invert(1);
    }


    .custom-toggle-btn {
            max-width: 120px; /* Reduce width for smaller screens */
            font-size: 12px; /* Smaller font size for mobile */
        }
}


/* Snackbar styles */
#snackbar {
    visibility: hidden;
    min-width: 150px; 
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 8px;
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 12px;
    z-index: 1800;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, bottom 0.5s ease-in-out;
}

    /* Show the snackbar */
    #snackbar.show {
        visibility: visible;
        opacity: 1;
        bottom: 50px;
    }