/* Base column styles */
.column {
    position: relative;
    z-index: 1;
    background-color: var(--bs-primary);
    border-radius: 0.25rem;
    padding: 1rem;
    padding-top: 0rem;
    width: 300px;
    flex: 0 0 auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    padding-bottom: 2.25rem;
}

/* Cards container - ensure menus can escape */
.cards-container {
    position: relative;
    height: calc(100% - 60px);
    overflow: visible !important;
    transform-style: preserve-3d;
}

/* Column with active menu */
.column:has(.dropdown-menu.show) {
    z-index: 1000;
    position: relative;
}

/* Card base styles */
.card {
    position: relative;
    z-index: 1;
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    overflow: visible !important;
}

/* Card menu styles */
.card .card-menu {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    z-index: 1001;
}

.card .card-menu .dropdown-menu {
    position: absolute !important;
    margin: 0;
    z-index: 1001 !important;
    min-width: 160px;
    background-color: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
    display: none;
}

/* Show dropdown when active */
.card .card-menu .dropdown-menu.show {
    display: block;
    position: absolute !important;
}

/* Card with active menu */
.card:has(.card-menu .dropdown-menu.show) {
    z-index: 2000;
    position: relative;
    transform: translate3d(0, 0, 0);
}

/* Card submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    z-index: 1002 !important;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Update submenu toggle arrow to point right */
.card .card-menu .dropdown-submenu > .dropdown-item::after {
    display: inline-block;
    margin-left: auto;
    content: "▶";
    font-size: 0.7em;
    opacity: 0.7;
    margin-left: 8px;
}

/* When any menu is open, ensure proper stacking */
.card:has(.dropdown-menu.show),
.card:has(.dropdown-submenu:hover) {
    z-index: 1000;
    position: relative;
}

/* Ensure submenus stay on top and positioned correctly */
.card .card-menu .dropdown-submenu .dropdown-menu {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    z-index: 1001 !important;
}

/* Card appearance */
.card {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.card.chat-card {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none !important;
    background-image: none !important;
    background-color: var(--bs-dark) !important;
}

.card.chat-card:hover {
    box-shadow: 0 0 1px rgba(255, 255, 255, 1),
                0 0 24px rgba(255, 255, 255, 0.6),
                0 0 32px rgba(255, 255, 255, 0.4) !important;
    background-color: var(--bs-dark) !important;
}

/* Make sure the pointer cursor is applied to all card elements except the drag handle */
.chat-card,
.chat-card .card-body,
.chat-card .card-title,
.chat-card .card-text {
    cursor: pointer !important;
}

/* Drag handle styles - more specific to override other cursor styles */
.chat-card .drag-handle {
    cursor: grab !important;
    user-select: none;
    display: inline-block;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.15s ease-in-out;
}

.chat-card .drag-handle:hover {
    color: var(--bs-light);
}

.chat-card .drag-handle:active {
    cursor: grabbing !important;
}

.chat-card.dragging .drag-handle {
    cursor: grabbing !important;
}

/* Card text styles */
.card .card-title .title-text {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

.card .card-title .title-text:hover {
    color: var(--bs-light);
    text-decoration: none;
}

.card .card-text {
    margin-top: 0.75rem;
    color: var(--bs-secondary-text);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Active chat styling */
.card.active-chat {
    border-color: rgba(255, 255, 255, 0.7);
    background-image: 
        radial-gradient(circle at 10px center, rgba(255, 255, 255, 0.25) 2px, transparent 2px),
        radial-gradient(circle at calc(100% - 10px) center, rgba(255, 255, 255, 0.25) 2px, transparent 2px) !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5),
                0 0 16px rgba(255, 255, 255, 0.25);
}

.card.active-chat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(255, 255, 255, 1);
    border-radius: 4px 0 0 4px;
    box-shadow: 0 0 1px rgba(255, 255, 255, 1),
                0 0 24px rgba(255, 255, 255, 0.7),
                0 0 32px rgba(255, 255, 255, 0.5);
}

/* Previously visited card styling - only add background image here */
.card.previously-visited {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(33, 37, 41, 0.5) !important; /* Increased opacity for more pronounced effect */
    background-image: none !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5),
                0 0 16px rgba(255, 255, 255, 0.25);
}

.card.previously-visited::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(200, 200, 200, 0.6);
    border-radius: 2px 0 0 2px;
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.5),
                0 0 16px rgba(200, 200, 200, 0.25);
}

/* Color styles for cards */
.card.card-color-green {
    border-color: rgba(40, 255, 100, 0.8);
    background-color: var(--bs-dark);
    box-shadow: 0 0 10px rgba(40, 255, 100, 0.5),
                0 0 24px rgba(40, 255, 100, 0.3);
}

.card.card-color-green::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(40, 255, 100, 1);
    box-shadow: 0 0 8px rgba(40, 255, 100, 0.8),
                0 0 16px rgba(40, 255, 100, 0.5);
    border-radius: 4px 0 0 4px;
}

.card.card-color-yellow {
    border-color: rgba(255, 233, 40, 0.8);
    background-color: var(--bs-dark);
    box-shadow: 0 0 10px rgba(255, 233, 40, 0.5),
                0 0 24px rgba(255, 233, 40, 0.3);
}

.card.card-color-yellow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(255, 233, 40, 1);
    box-shadow: 0 0 8px rgba(255, 233, 40, 0.8),
                0 0 16px rgba(255, 233, 40, 0.5);
    border-radius: 4px 0 0 4px;
}

.card.card-color-red {
    border-color: rgba(255, 40, 80, 0.8);
    background-color: var(--bs-dark);
    box-shadow: 0 0 10px rgba(255, 40, 80, 0.5),
                0 0 24px rgba(255, 40, 80, 0.3);
}

.card.card-color-red::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(255, 40, 80, 1);
    box-shadow: 0 0 8px rgba(255, 40, 80, 0.8),
                0 0 16px rgba(255, 40, 80, 0.5);
    border-radius: 4px 0 0 4px;
}

/* Visited status styles for cards - most recently visited (white) */
.card.card-color-most-recent {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: var(--bs-dark);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                0 0 24px rgba(255, 255, 255, 0.3);
}

.card.card-color-most-recent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.7) 100%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
                0 0 16px rgba(255, 255, 255, 0.5);
    border-radius: 4px 0 0 4px;
}

/* Visited status styles for cards - previously visited (gray) */
.card.card-color-visited {
    border-color: rgba(200, 200, 200, 0.8);
    background-color: var(--bs-dark);
    box-shadow: 0 0 10px rgba(200, 200, 200, 0.5),
                0 0 24px rgba(200, 200, 200, 0.3);
}

.card.card-color-visited::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, rgba(200, 200, 200, 1) 0%, rgba(200, 200, 200, 0.6) 100%);
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.6),
                0 0 16px rgba(200, 200, 200, 0.3);
    border-radius: 4px 0 0 4px;
}

/* Hover effects for all card types - including shared board cards */
/* Using higher specificity to override inline styles */
/* Multiple selectors to ensure it works in all contexts */
.card.card-color-green:hover,
.card:hover.card-color-green,
div.card.card-color-green:hover,
#currentBoard .card.card-color-green:hover,
.columns-container .card.card-color-green:hover {
    box-shadow: 0 0 1px rgba(40, 255, 100, 1),
                0 0 24px rgba(40, 255, 100, 0.6),
                0 0 32px rgba(40, 255, 100, 0.4) !important;
    background: rgba(15, 15, 15, 1) !important;
    background-color: rgba(15, 15, 15, 1) !important;
    transform: translateY(-1px);
    /* Force override of inline styles with higher specificity */
    background-image: none !important;
}

.card.card-color-yellow:hover,
.card:hover.card-color-yellow,
div.card.card-color-yellow:hover,
#currentBoard .card.card-color-yellow:hover,
.columns-container .card.card-color-yellow:hover {
    box-shadow: 0 0 1px rgba(255, 233, 40, 1),
                0 0 24px rgba(255, 233, 40, 0.6),
                0 0 32px rgba(255, 233, 40, 0.4) !important;
    background: rgba(15, 15, 15, 1) !important;
    background-color: rgba(15, 15, 15, 1) !important;
    transform: translateY(-1px);
    /* Force override of inline styles with higher specificity */
    background-image: none !important;
}

.card.card-color-red:hover,
.card:hover.card-color-red,
div.card.card-color-red:hover,
#currentBoard .card.card-color-red:hover,
.columns-container .card.card-color-red:hover {
    box-shadow: 0 0 1px rgba(255, 40, 80, 1),
                0 0 24px rgba(255, 40, 80, 0.6),
                0 0 32px rgba(255, 40, 80, 0.4) !important;
    background: rgba(15, 15, 15, 1) !important;
    background-color: rgba(15, 15, 15, 1) !important;
    transform: translateY(-1px);
    /* Force override of inline styles with higher specificity */
    background-image: none !important;
}

.card.card-color-most-recent:hover,
div.card.card-color-most-recent:hover,
#currentBoard .card.card-color-most-recent:hover,
.columns-container .card.card-color-most-recent:hover {
    box-shadow: 0 0 1px rgba(255, 255, 255, 1),
                0 0 24px rgba(255, 255, 255, 0.6),
                0 0 32px rgba(255, 255, 255, 0.4) !important;
    background: rgba(15, 15, 15, 1) !important;
    background-color: rgba(15, 15, 15, 1) !important;
    transform: translateY(-1px);
    /* Force override of inline styles with higher specificity */
    background-image: none !important;
}

.card.card-color-visited:hover,
div.card.card-color-visited:hover,
#currentBoard .card.card-color-visited:hover,
.columns-container .card.card-color-visited:hover {
    box-shadow: 0 0 1px rgba(200, 200, 200, 1),
                0 0 24px rgba(200, 200, 200, 0.6),
                0 0 32px rgba(200, 200, 200, 0.4) !important;
    background: rgba(15, 15, 15, 1) !important;
    background-color: rgba(15, 15, 15, 1) !important;
    transform: translateY(-1px);
    /* Force override of inline styles with higher specificity */
    background-image: none !important;
}

/* Color preview styles in dropdown */
.color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.color-preview.none-color {
    background: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.color-preview.green-color {
    background: rgba(40, 255, 100, 0.8);
    box-shadow: 0 0 8px rgba(40, 255, 100, 0.5);
}

.color-preview.yellow-color {
    background: rgba(255, 233, 40, 0.8);
    box-shadow: 0 0 8px rgba(255, 233, 40, 0.5);
}

.color-preview.red-color {
    background: rgba(255, 40, 80, 0.8);
    box-shadow: 0 0 8px rgba(255, 40, 80, 0.5);
}

/* Ensure colors work with active and previously visited states */
.card.active-chat.card-color-green,
.card.active-chat.card-color-yellow,
.card.active-chat.card-color-red {
    background-image: none;
}

.card.previously-visited.card-color-green,
.card.previously-visited.card-color-yellow,
.card.previously-visited.card-color-red {
    background-image: none;
}

/* Color option hover effects */
.dropdown-menu .color-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active color indicator */
.dropdown-menu .color-option.active {
    background-color: rgba(255, 255, 255, 0.2);
} 

.card.chat-card.card-color-green {
    border: none;
    border-top: 1px solid #28a745;
    border-right: 1px solid #28a745;
    border-bottom: 1px solid #28a745;
    box-shadow: none;
}

.card.chat-card.card-color-green:hover {
    box-shadow: 0 0 1px rgba(40, 167, 69, 1),
                0 0 24px rgba(40, 167, 69, 0.6),
                0 0 32px rgba(40, 167, 69, 0.4) !important;
}

.card.chat-card.card-color-yellow {
    border: none;
    border-top: 1px solid #ffc107;
    border-right: 1px solid #ffc107;
    border-bottom: 1px solid #ffc107;
    box-shadow: none;
}

.card.chat-card.card-color-yellow:hover {
    box-shadow: 0 0 1px rgba(255, 193, 7, 1),
                0 0 24px rgba(255, 193, 7, 0.6),
                0 0 32px rgba(255, 193, 7, 0.4) !important;
}

.card.chat-card.card-color-red {
    border: none;
    border-top: 1px solid #dc3545;
    border-right: 1px solid #dc3545;
    border-bottom: 1px solid #dc3545;
    box-shadow: none;
}

.card.chat-card.card-color-red:hover {
    box-shadow: 0 0 1px rgba(220, 53, 69, 1),
                0 0 24px rgba(220, 53, 69, 0.6),
                0 0 32px rgba(220, 53, 69, 0.4) !important;
}

/* Most recently visited card styling */
.card.most-recently-visited {
    border-color: rgba(255, 255, 255, 0.8);
    background-image: 
        radial-gradient(circle at 10px center, rgba(255, 255, 255, 0.25) 2px, transparent 2px),
        radial-gradient(circle at calc(100% - 10px) center, rgba(255, 255, 255, 0.25) 2px, transparent 2px) !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6),
                0 0 24px rgba(255, 255, 255, 0.3);
}

.card.most-recently-visited::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: rgba(255, 255, 255, 1);
    border-radius: 4px 0 0 4px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9),
                0 0 30px rgba(255, 255, 255, 0.6);
}

/* Ensure colors work with most recently visited state */
.card.most-recently-visited.card-color-green,
.card.most-recently-visited.card-color-yellow,
.card.most-recently-visited.card-color-red {
    background-image: none;
}

/* Hide robot icon from chat cards in all views */
/* .board-robot-icon,
.card-body .board-robot-icon {
    display: none !important;
    visibility: hidden !important;
} */ 