/* =========================================
   CUSTOM DROPDOWN UI
========================================= */

/* The outer container */
.custom-dropdown {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    outline: none; /* Removes the blue outline when clicked */
}

/* The visible button */
.custom-dropdown-btn {
    background-color: var(--md-default-bg-color);
    color: var(--md-default-fg-color);
    border: 1px solid var(--md-default-fg-color--light);
    padding: 0.4rem 0.8rem; /* Reduced padding here for a smaller button */
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

/* Add the dropdown arrow automatically via CSS */
.custom-dropdown-btn::after {
    content: "▼";
    font-size: 0.9em;
    margin-left: 8px;
    opacity: 0.7; 
    transition: transform 0.2s ease; /* Smooth rotation */
    display: inline-block; /* Required for the rotation transform to work */
}

/* Button Hover State */
.custom-dropdown-btn:hover {
    border-color: var(--md-primary-fg-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* The hidden menu box */
.custom-dropdown-content {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background-color: var(--md-default-bg-color);
    min-width: 190px; /* Reduced from 240px to make the box narrower */
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid var(--md-default-fg-color--light);
    z-index: 100;
    overflow: hidden;
}

/* Show the menu ONLY when clicked (managed by JS class) */
.custom-dropdown.open .custom-dropdown-content {
    display: flex;
    flex-direction: column;
}

/* Rotate the arrow upwards when the menu is open */
.custom-dropdown.open .custom-dropdown-btn::after {
    transform: rotate(180deg); /* Point up when open */
}

/* Style the individual links */
.custom-dropdown-content a {
    color: var(--md-default-fg-color);
    padding: 0.5rem 0.8rem; /* Reduced padding to make the menu items vertically tighter */
    text-decoration: none;
    font-size: 0.8rem; /* Slightly smaller text size */
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover effect for the links inside the menu */
.custom-dropdown-content a:hover,
.custom-dropdown-content a:focus {
    background-color: var(--md-primary-fg-color);
    color: var(--md-primary-bg-color);
    outline: none;
}

/* The visual separator line */
.dropdown-divider {
    height: 1px;
    background-color: var(--md-default-fg-color--light);
    margin: 0.2rem 0;
    opacity: 0.4;
}

/* =========================================
   FOOTER ALIGNMENT
========================================= */

.md-footer-meta__inner {
    justify-content: center !important;
}

.md-copyright {
    text-align: center;
    margin: auto;
    line-height: 1.5;
}