/* Core board layout styles */
.board-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0;
    min-width: fit-content;
    position: relative;
    overflow: visible !important; 
}

.board-content-section {
    flex: 1;
    min-width: 0;
    overflow: visible !important;
    position: relative;
    background: transparent !important;
}

/* When any card menu is open, ensure all containers allow overflow */
.container-fluid:has(.card-menu .dropdown-menu.show),
.board-container:has(.card-menu .dropdown-menu.show),
.board-content-section:has(.card-menu .dropdown-menu.show) {
    overflow: visible !important;
    background: transparent !important;
}

#columns {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    align-items: flex-start;
    overflow: visible !important;
    position: relative;
}

/* Board title and menu styles */
#boardTitle {
    display: flex;
    /*   align-items: center; */
    gap: 8px;
    min-height: 36px;
    position: relative;
    padding-left: 0.5rem;
    font-size: 1.75rem;
    font-weight: 500;
}

.board-menu-button {
    color: var(--bs-light);
    opacity: 0.7;
    padding: 0 0.5rem;
    font-size: 2rem;
    line-height: 1;
    transition: opacity 0.2s;
    text-decoration: none !important;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    transform: translateY(-3px);
    padding-left: 0px;
    padding-right: 0px
}

.board-menu-button:hover,
.board-menu-button:focus {
    opacity: 1;
    color: var(--bs-light);
    text-decoration: none !important;
}

/* Board title dropdown styles */
#boardTitle .dropdown-menu {
    min-width: 200px;
    padding: 0.5rem 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#boardTitle .dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#boardTitle .dropdown-item:hover {
    background-color: var(--bs-primary);
}

#boardTitle .menu-icon {
    opacity: 0.7;
    font-size: 1.1rem;
}

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

/* Board icons styling */
.board-icons {
    display: inline-flex;
    gap: 8px;
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    align-items: center;
}

#boardTitle:hover .board-icons {
    opacity: 1;
}

/* Loading overlay styles */
.board-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bs-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#currentBoard {
    position: relative;
    min-height: 200px;
    z-index: 1;
    padding-bottom: 20px;
    background: transparent !important;
}

/* When any card menu is open, lower the board's z-index to allow menus to escape */
#currentBoard:has(.card-menu .dropdown-menu.show) {
    z-index: auto;
    background: transparent !important;
}

/* When any menu is open, ensure the card is above everything */
#currentBoard .card:has(.dropdown-menu.show),
#currentBoard .card:has(.card-menu:hover) {
    position: relative;
    z-index: 1000;
}

#currentBoard.content-loaded .board-loading-overlay {
    display: none;
}

/* Drag and drop styles */
.board-drag-handle {
    cursor: grab;
    padding: 0 8px;
    color: var(--bs-light);
    opacity: 0.5;
    transition: opacity 0.2s;
    font-size: 1.2rem;
    user-select: none;
}

.board-drag-handle:hover {
    opacity: 1;
}

.board-drag-handle:active {
    cursor: grabbing;
}

.list-group-item {
    display: flex;
    align-items: center;
}

.list-group-item.dragging {
    opacity: 0.5;
    background-color: var(--bs-primary);
}

/* Board list toggle button */
.board-list-toggle {
    background-color: var(--bs-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    width: calc(300px - 2rem);
    height: 24px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    color: white !important;
    border: none;
    position: relative;
    left: 1rem;
}

/* Add styles for collapsed state */
.board-list-toggle.collapsed {
    justify-content: flex-end;
    padding-right: 4px;
}

/* Add height for collapsed state */
.board-list-toggle-btn.collapsed {
    height: calc(100vh - 120px);
    background-color: var(--bs-primary);
}

/* Style the icon container */
.board-list-toggle i {
    width: auto;
    transition: margin 0.2s;
    color: white !important;
}

/* Hover state - slightly darker purple */
.board-list-toggle:hover {
    background-color: var(--bs-primary-hover, var(--bs-primary));
}

/* Hide toggle button in mobile view */
@media (max-width: 768px) {
    .board-list-toggle-btn {
        display: none !important;
    }
}

/* Style the icon specifically in collapsed state */
.board-list-toggle-btn.collapsed i {
    color: black !important;
}

/* Update the toggle button styles to better indicate hover interaction */
.board-list-toggle-btn.collapsed {
    cursor: pointer;
    transition: transform 0.3s ease, padding-right 0.3s ease, background-color 0.2s ease;
}

.board-list-toggle-btn.collapsed:hover {
    background-color: var(--bs-secondary);  /* Change from #6528e0 to Bootstrap's secondary */
    box-shadow: 0 0 10px rgba(var(--bs-secondary-rgb), 0.3);  /* Update shadow to match */
}

/* Add a subtle indicator arrow */
.board-list-toggle-btn.collapsed::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 4px solid var(--bs-light);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.board-list-toggle-btn.collapsed:hover::after {
    opacity: 1;
}

/* Enhanced lifesigns wrapper with smooth modal expansion */
.lifesigns-wrapper {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

/* When lifesigns content is present, expand smoothly */
.lifesigns-wrapper:not(:empty) {
    max-height: 300px; /* Increased to accommodate larger error messages */
    opacity: 1;
    padding-top: 0.75rem !important; /* Add some top padding when expanded */
}

/* Handle larger content gracefully */
.lifesigns-wrapper:not(:empty) .alert {
    max-height: 250px;
    overflow-y: auto;
}

.lifesigns-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-10px);
    opacity: 0;
}

/* Animate in the lifesigns container */
.lifesigns-wrapper:not(:empty) .lifesigns-container {
    transform: translateY(0);
    opacity: 1;
}

/* Add smooth height transitions to modal content for expansion */
.modal-content {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Smooth transitions for Bootstrap modals during resize */
.modal.show .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ensure modal body can expand smoothly */
.modal-body {
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specific styles for quick AI modals to handle expansion */
#quickAIBoardModal .modal-content,
#quickAIBoardProModal .modal-content,
#quickAIChatsModal .modal-content,
#quickAIChatsProModal .modal-content,
#quickAITopicModal .modal-content,
#quickAITopicProModal .modal-content {
    overflow: visible;
}

/* Disable transitions during dynamic injection to prevent layout shifts */
.lifesigns-wrapper.no-transition,
.lifesigns-container.no-transition {
    transition: none !important;
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.lifesigns-container .progress {
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    position: relative;
}

.lifesigns-container .progress-bar {
    background: var(--bs-primary);
    transition: width 0.5s ease;
}

.lifesigns-container .status-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-style: italic;
    padding: 0 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 1;
    white-space: nowrap;
}

/* Card drag and drop styles */
.card {
    cursor: grab;
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drag-handle {
    cursor: grab;
    color: #666;
    user-select: none;
}

.drag-handle:hover {
    color: #333;
}

.drag-handle:active {
    cursor: grabbing;
}

.drop-indicator {
    position: absolute;
    height: 4px;
    background-color: #007bff;
    border-radius: 2px;
    z-index: 1000;
    pointer-events: none;
}

.drop-indicator.horizontal {
    width: calc(100% - 32px);
    margin: 0 16px;
}

/* Ensure cards are positioned relative for accurate drop indicators */
.cards {
    position: relative;
}

.card {
    position: relative;
    z-index: 1;
}

.card.dragging {
    z-index: 1000;
}

#boardTitle .ai-chat-icon {
    background-color: var(--bs-primary);
    color: var(--bs-light);
    opacity: 0.85;
    font-size: 1.2rem;
    transition: all 0.2s;
    text-decoration: none !important;
    transform: translateY(-1px);
    padding: 0.5em 0.85em;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    border: none;
    font-weight: 500;
}

#boardTitle .ai-chat-icon:hover,
#boardTitle .ai-chat-icon:focus {
    opacity: 1;
    color: var(--bs-light);
    text-decoration: none !important;
    background-color: var(--bs-primary);
    box-shadow: 0 0 8px var(--bs-primary);
}

#boardTitle .badge.bg-primary {
    transition: all 0.2s;
}

#boardTitle .badge.bg-primary:hover {
    background-color: var(--bs-primary-hover, var(--bs-primary)) !important;
    opacity: 0.9;
}

.board-list-section .add-column-container {
    height: 68px;
    border: 2px solid var(--bs-primary);
    border-radius: 10px;
    margin: 2.25rem 0 2.25rem 0.5rem;
    width: 97%;
    background: var(--bs-dark);
    transition: all 0.2s ease;
    position: relative;
}

.board-list-section .add-column-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px 0 0 2px;
    transition: background-color 0.2s ease;
    opacity: 0;
}

.board-list-section .add-column-container:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.2) !important;
    box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.5) !important;
    transform: scale(1.02) !important;
    cursor: pointer;
}

.board-list-section .add-column-container:hover::before {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.board-list-section .add-column-container:hover .text-muted {
    color: var(--bs-light) !important;
}

#boardList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    padding-top: 0.05rem;
    padding-left: 0.5rem;
    padding-right: 8px;
    margin-right: -8px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: auto;
    scrollbar-color: transparent var(--bs-dark);
    -webkit-overflow-scrolling: touch;
}

#boardList::-webkit-scrollbar {
    width: 16px;
    background-color: transparent;
}

#boardList::-webkit-scrollbar-track {
    background: rgba(var(--bs-dark-rgb), 0.5); /* Lighter shade of dark */
    border-radius: 10px;
}

#boardList::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 10px;
    min-height: 100px;
    border: 2px solid var(--bs-primary);
    transition: all 0.2s ease;
}

#boardList::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.25);
    border-width: 2px;
}

.add-column-container {
    margin-top: 1.5rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    padding: 0.75rem;
    padding-right: 1.25rem;
    width: 97%;
    color: var(--bs-secondary);
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    background-color: var(--bs-dark);
}

.board-list-section .add-column-container:hover {
    background-color: var(--bs-dark-text-emphasis);
    color: var(--bs-light);
}

.board-list-section .add-column-container:hover .text-muted {
    color: var(--bs-light) !important;
}

/* Media queries for mobile */
@media (max-width: 768px) {
    .board-container {
        flex-direction: column;
    }

    .board-list-section {
        flex: none;
        width: 100%;
        padding-right: 0.5rem;
    }

    #columns {
        flex-direction: column;
        padding-bottom: 0;
    }

    .add-column-container {
        width: 97%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Mobile accordion-like behavior */
    .non-active-boards {
        display: none !important;
    }

    #boardList.show-board-list .non-active-boards {
        display: block !important;
    }

    /* Toggle button for board list */
    .board-list-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.5rem;
        margin-top: -0.5rem;
        background: transparent;
        border: none;
        color: var(--bs-light);
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .board-list-toggle:hover {
        opacity: 1;
    }

    .board-list-toggle i {
        transition: transform 0.2s;
    }

    #boardList.show-board-list .board-list-toggle i {
        transform: rotate(180deg);
    }
}

/* Delete Board Modal Styles */
#deleteBoardModal .modal-content {
    background: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#deleteBoardModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteBoardModal .modal-body {
    padding: 1.5rem 1rem;
}

#deleteBoardModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteBoardModal .modal-title {
    color: var(--bs-dark);
    font-size: 1.25rem;
    margin: 0;
}

#deleteConfirmationInput {
    margin-top: 1rem;
    font-size: 1rem;
    padding: 0.5rem;
}

#deleteBoardModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#deleteBoardModal .btn-danger:disabled {
    background-color: #dc354580;
    border-color: #dc354580;
}

/* Delete Column/Topic Modal Styles - Match Board Modal Styling */
#deleteColumnModal .modal-content {
    background: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#deleteColumnModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteColumnModal .modal-body {
    padding: 1.5rem 1rem;
}

#deleteColumnModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteColumnModal .modal-title {
    color: var(--bs-dark);
    font-size: 1.25rem;
    margin: 0;
}

#deleteColumnConfirmationInput {
    margin-top: 1rem;
    font-size: 1rem;
    padding: 0.5rem;
}

#deleteColumnModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#deleteColumnModal .btn-danger:disabled {
    background-color: #dc354580;
    border-color: #dc354580;
}

/* Delete Card Modal Styles - Match Board Modal Styling */
#deleteCardModal .modal-content {
    background: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#deleteCardModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteCardModal .modal-body {
    padding: 1.5rem 1rem;
}

#deleteCardModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

#deleteCardModal .modal-title {
    color: var(--bs-dark);
    font-size: 1.25rem;
    margin: 0;
}

#deleteCardConfirmInput {
    margin-top: 1rem;
    font-size: 1rem;
    padding: 0.5rem;
}

#deleteCardModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#deleteCardModal .btn-danger:disabled {
    background-color: #dc354580;
    border-color: #dc354580;
}

/* Ensure non-active boards container always uses flex column with uniform spacing */
#boardList .non-active-boards {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
} 