/* 
 * Board Dropdown Fixes
 * This file contains styles to make non-featured board dropdowns match the featured board dropdowns
 */

/* Fix dark dropdowns in board list - make them match the featured board's dropdown */
#boardList .dropdown-menu-dark,
#boardList .dropdown-menu.dropdown-menu-dark {
    background: rgb(31, 31, 41) !important; /* Completely solid - no alpha transparency */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35) !important;
    /* Ensure dropdown only shows when intended */
    display: none !important;
}

/* Only show dropdown when it has the 'show' class */
#boardList .dropdown-menu-dark.show,
#boardList .dropdown-menu.dropdown-menu-dark.show {
    display: block !important;
}

/* CRITICAL: Force menu to stay visible when it has the 'show' class, regardless of hover state */
#boardList .dropdown-menu-dark.show,
#boardList .dropdown-menu.dropdown-menu-dark.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#boardList .dropdown-menu-dark .dropdown-item {
    color: var(--bs-light) !important;
    opacity: 0.9;
}

#boardList .dropdown-menu-dark .dropdown-item:hover {
    background-color: var(--bs-primary) !important;
    color: var(--bs-light) !important;
    opacity: 1;
}

#boardList .dropdown-menu-dark .dropdown-item .menu-icon {
    opacity: 0.7;
}

#boardList .dropdown-menu-dark .dropdown-item:hover .menu-icon {
    opacity: 1;
}

/* Hide robot icon for non-featured boards */
#boardList button:not(.featured-board) .board-robot-icon {
    display: none !important;
    visibility: hidden !important;
}

/* Hide robot icon on featured boards */
/* #boardList button.featured-board .board-robot-icon {
    display: none !important;
    visibility: hidden !important;
} */

/* Ensure featured board has pointer cursor */
#boardList button.featured-board {
    cursor: pointer !important;
}

/* Add glowing hover effect to featured board - same as chat cards */
/* Using multiple selectors for higher specificity to override column-override.css */
body #boardList button.featured-board:hover,
body #boardList button.list-group-item.featured-board:hover,
body #boardList .list-group-item.featured-board:hover,
body .board-list-section #boardList button.featured-board:hover,
.featured-board:hover,
button.featured-board:hover {
    /* Darker translucent background on hover - maintains transparency while reducing background visibility */
    background: rgba(0, 0, 0, 0.35) !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    /* Remove any purple tint or background images */
    background-image: none !important;
    /* Add left border to match chat cards */
    border-left: 3px solid rgba(255, 255, 255, 0.1) !important;
    /* Very bright but soft purple glowing effect with rounded corners */
    border-radius: 8px !important;
    box-shadow: 0 0 2px rgba(var(--bs-primary-rgb), 1),
                0 0 8px rgba(var(--bs-primary-rgb), 0.9),
                0 0 20px rgba(var(--bs-primary-rgb), 0.7),
                0 0 35px rgba(var(--bs-primary-rgb), 0.5) !important;
    /* Ensure no transform */
    transform: none !important;
    transition: all 0.3s ease !important;
}

/* Ensure board list container doesn't clip the glow effect */
/* COMMENTED OUT - This was breaking board list scrolling and hiding the Quick AI mindboard widget
#boardList {
    overflow: visible !important;
    padding-top: 0 !important;
    position: relative !important;
}
*/

/* Ensure parent containers also don't clip */
/* COMMENTED OUT - This was breaking board list scrolling
.board-list-section {
    overflow: visible !important;
    position: relative !important;
}
*/

/* Add padding to the board list section header to prevent glow cutoff */
.board-list-section h2 {
    padding-top: 8px !important;
    margin-top: -8px !important;
}

/* Shift container up to compensate for featured board's top margin */
.board-list-section {
    margin-top: -10px !important;
}

/* Add margin to featured board to prevent glow cutoff */
#boardList button.featured-board {
    margin-top: 10px !important;
    position: relative !important;
    z-index: 10 !important;
    cursor: pointer !important; /* Ensure pointer cursor */
}

/* Keep only the cursor pointer rule */
/* #boardList button.featured-board {
    cursor: pointer !important; /* Ensure pointer cursor */
/*} */

/* Ensure featured board shows pointer cursor on hover */
body #boardList button.featured-board:hover,
body #boardList button.list-group-item.featured-board:hover,
body #boardList .list-group-item.featured-board:hover {
    cursor: pointer !important;
}

/* Remove focus ring/box-shadow from the three-dot menu anchor */
#boardList .board-list-menu,
#boardList .board-list-menu:focus,
#boardList .board-list-menu:focus-visible,
#boardList .board-list-menu:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* Removed submenu overflow overrides to avoid board list layout side effects */

/* Animation for the loading gradient */
@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bi-arrow-clockwise.spin {
    animation: spin 1s linear infinite;
}

/* Add default left border to featured board with high specificity */
body #boardList button.featured-board,
body #boardList button.list-group-item.featured-board,
body #boardList .list-group-item.featured-board,
body .board-list-section #boardList button.featured-board {
    border-left: 3px solid transparent !important;
    box-sizing: border-box !important;
}

/* Loading state for featured board */
body.board-loading {
    cursor: wait !important;
}

/* Only apply wait cursor to specific interactive elements, not all elements */
body.board-loading a,
body.board-loading button,
body.board-loading input,
body.board-loading select,
body.board-loading textarea,
body.board-loading [role="button"],
body.board-loading [onclick],
body.board-loading [tabindex]:not([tabindex="-1"]) {
    cursor: wait !important;
}

body #boardList button.featured-board.loading,
body #boardList button.list-group-item.featured-board.loading,
body #boardList .list-group-item.featured-board.loading {
    cursor: wait !important;
}

/* Prevent any font size or text property changes during loading - only for non-featured boards */
body.board-loading #boardList button:not(.featured-board),
body.board-loading #boardList .list-group-item:not(.featured-board) {
    font-size: 1.2rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    transition: none !important; /* Disable all transitions during loading */
}

/* Target the text spans specifically */
body.board-loading #boardList button:not(.featured-board) > span,
body.board-loading #boardList .list-group-item:not(.featured-board) > span {
    font-size: 1.2rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    transition: none !important;
}

/* Also prevent changes when featured board has loading class - only for non-featured boards */
#boardList:has(button.featured-board.loading) button:not(.featured-board),
#boardList:has(button.featured-board.loading) .list-group-item:not(.featured-board) {
    font-size: 1.2rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Target the text spans specifically when featured board has loading class */
#boardList:has(button.featured-board.loading) button:not(.featured-board) > span,
#boardList:has(button.featured-board.loading) .list-group-item:not(.featured-board) > span {
    font-size: 1.2rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
}

/* FIX: Adjust scrollbar track to align handle correctly */
#boardList::-webkit-scrollbar-track {
    margin-top: 10px !important;
}

/* Chrome-specific scrollbar styling is now handled via JavaScript in board-dropdown-fix.js */
/* This prevents any CSS media query conflicts with Safari */

/* Card loading state - same as featured board */
body.card-loading {
    cursor: wait !important;
}

/* Apply wait cursor to interactive elements when card is loading */
body.card-loading a,
body.card-loading button,
body.card-loading input,
body.card-loading select,
body.card-loading textarea,
body.card-loading [role="button"],
body.card-loading [onclick],
body.card-loading [tabindex]:not([tabindex="-1"]) {
    cursor: wait !important;
}

/* Specific loading state for cards */
.card.loading {
    cursor: wait !important;
}

/* Ensure all clickable areas of a loading card show wait cursor */
.card.loading,
.card.loading * {
    cursor: wait !important;
}

/* Usage alert darkening effect for board list - subtle unhovered state */
#boardList.usage-alert-darkened {
    pointer-events: none !important;
    transition: all 0.3s ease !important;
}

/* Override hover effects to maintain unhovered state */
#boardList.usage-alert-darkened button:hover,
#boardList.usage-alert-darkened .list-group-item:hover {
    background: rgba(33, 37, 41, 0.2) !important;
    background-color: rgba(33, 37, 41, 0.2) !important;
    box-shadow: none !important;
    transform: none !important;
}

#boardList.usage-alert-darkened button:hover > span,
#boardList.usage-alert-darkened .list-group-item:hover > span {
    color: var(--bs-dark-border-subtle) !important;
}

/* Ensure featured board also stays in unhovered state */
#boardList.usage-alert-darkened button.featured-board:hover {
    background: rgba(33, 37, 41, 0.2) !important;
    background-color: rgba(33, 37, 41, 0.2) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
} 