/* --- Shared Menu Styles --- */

.button-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1em;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    padding: 0 1.5em;
    gap: 0.5em;
    box-sizing: border-box;
    z-index: 1050;
}

.attractive-button {
    display: inline-block;
    font-weight: bold;
    color: white;
    text-decoration: none;
    text-align: center;
    font-family: "Poppins", sans-serif;
    border: none;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    padding: clamp(0.4em, 1vw, 0.6em) clamp(0.8em, 2vw, 1.2em);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.attractive-button a:link, .attractive-button a:visited, .attractive-button a:active {
    color: white;
    text-decoration: underline;
    text-align: center;
}

.attractive-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.collapsible-menu {
    position: relative;
}

.menu-toggle-btn {
    padding: clamp(0.5em, 1.2vw, 0.8em);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
}

.menu-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.menu-toggle-btn svg {
    width: clamp(1rem, 1.5vw, 1.2rem);
    height: clamp(1rem, 1.5vw, 1.2rem);
    fill: white;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5em);
    right: 0;
    background: linear-gradient(145deg, #1a1d24, #111317);
    border: 1px solid rgba(100, 120, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 250px; /* Increased width */
    z-index: 1100;
    padding: 0.5em 0;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transform-origin: top right;
}

.menu-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75em;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-dropdown a:hover {
    background-color: rgba(100, 120, 255, 0.1);
    color: #fff;
}

.menu-dropdown a svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    opacity: 0.7;
}

.menu-dropdown .menu-header {
    display: flex;
    align-items: center;
    gap: 0.75em;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    font-family: "Poppins", sans-serif;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.menu-dropdown .menu-header svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    opacity: 0.7;
}

#favourites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 40vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6478ff rgba(0, 0, 0, 0.3);
}

#favourites-list::-webkit-scrollbar {
    width: 8px;
}

#favourites-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#favourites-list::-webkit-scrollbar-thumb {
    background-color: #6478ff;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

#favourites-list::-webkit-scrollbar-thumb:hover {
    background-color: #768eff;
}

#favourites-list .draggable-favourite-item {
    display: flex;
    align-items: center;
    padding: 8px 15px 8px 25px; /* Added left padding for indent */
    color: #e0e0e0;
    border-bottom: 1px solid rgba(100, 120, 255, 0.1);
    transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    cursor: grab;
    position: relative; /* Needed for ::before/::after pseudo-elements */
    width: 100%; /* Ensure the list item takes full width */
}

#favourites-list .draggable-favourite-item:hover {
    background-color: rgba(100, 120, 255, 0.1);
}

#favourites-list .draggable-favourite-item a {
    display: block; /* Crucial for text-overflow: ellipsis to work */
    flex: 1 1 0%; /* Explicitly set flex-grow, flex-shrink, and flex-basis */
    text-decoration: none;
    color: inherit;
    padding: 0;
    border-bottom: none;
    font-size: 0.9em; /* Smaller text */
    white-space: nowrap; /* Truncate with ellipses */
    overflow: hidden; /* Truncate with ellipses */
    text-overflow: ellipsis; /* Truncate with ellipses */
    min-width: 0; /* Allow flex item to shrink below its content size */
}

#favourites-list .draggable-favourite-item a:hover {
    background-color: transparent; /* Prevent hover background from anchor */
    color: #fff;
}

#favourites-list .drag-handle {
    margin-right: 10px;
    cursor: grab;
    font-size: 1.2em;
    color: #6478ff;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#favourites-list .draggable-favourite-item:hover .drag-handle {
    opacity: 1;
}

/* Dragging feedback */
#favourites-list .draggable-favourite-item.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: 0 5px 15px rgba(100, 120, 255, 0.5);
}

/* Drop zone indicators */
#favourites-list .draggable-favourite-item.drag-above::before,
#favourites-list .draggable-favourite-item.drag-below::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px; /* Thickness of the indicator line */
    background-color: #6478ff; /* Color of the indicator line */
    box-shadow: 0 0 8px #6478ff;
    z-index: 10;
    animation: pulseBorder 1s infinite alternate;
}

#favourites-list .draggable-favourite-item.drag-above::before {
    top: 0;
}

#favourites-list .draggable-favourite-item.drag-below::after {
    bottom: 0;
}

@keyframes pulseBorder {
    from {
        opacity: 0.5;
        transform: scaleX(0.8);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.feedback-modal .modal-content {
    background: linear-gradient(145deg, #1a1d24, #111317);
    border: 1px solid rgba(100, 120, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
}

.feedback-modal .modal-header {
    border-bottom: 1px solid rgba(100, 120, 255, 0.2);
}

.feedback-modal .btn-close {
    filter: invert(80%) sepia(100%) saturate(1000%) hue-rotate(200deg);
}

.feedback-modal .modal-body {
    padding: 0;
    height: 70vh;
    overflow: hidden;
}

.feedback-modal iframe {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.initially-hidden {
    display: none;
}
