.column {
    background-color: rgba(33, 37, 41, 0.4) !important;
    border: 2px solid var(--bs-primary) !important;
    border-radius: 10px !important;
    padding: 1rem;
    padding-top: 0rem;
    padding-bottom: 2.5rem;
    width: 300px;
    flex: 0 0 auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease;
}

.column:hover {
    box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.3);
}

/* When any card in the column has its menu open, lower the column's z-index */
.column:has(.card .dropdown-menu.show) {
    z-index: 1;
}

/* Cards container should not create a new stacking context */
.cards-container {
    position: relative;
    height: calc(100% - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    transform-style: preserve-3d;
}

/* Ensure dropdowns can escape the cards container */
.cards-container .dropdown-menu {
    position: fixed;
    z-index: 9999;
}

/* Move the column-specific media query from layout.css */
@media (max-width: 768px) {
    html, body {
        overscroll-behavior: none;
        overflow-x: hidden;
        width: 100%;
        position: relative;
        max-width: 100vw;
    }

    #app, #app > div {
        max-width: 100vw;
        width: 100%;
        overflow: hidden;
    }

    /* Board list container */
    #boardList, .board-list-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        max-height: 50vh;
    }

    /* Hide non-active boards by default */
    .non-active-boards {
        display: none !important;
    }

    /* Show when toggled */
    #boardList.show-board-list .non-active-boards {
        display: block !important;
    }

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

    .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);
    }

    /* Individual board items */
    .board-item {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        position: relative;
    }

    #currentBoard {
        overflow: hidden;
        width: 100%;
        max-width: 100vw;
        position: relative;
    }

    .board-content {
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
        position: relative;
    }

    #columns {
        flex-direction: column;
        padding: 0 0.5rem;
        width: 100%;
        max-width: calc(100vw - 1rem);
        box-sizing: border-box;
        overflow: hidden;
        position: relative;
    }

    /* Align board title with other elements */
    #currentBoard > h1 {
        padding-left: 1rem;
        margin-bottom: 1rem;
    }

    .column {
        width: 100% !important;
        min-width: unset;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
        padding: 0.75rem;
        padding-top: 0;
        flex: 1 1 auto;
        box-sizing: border-box;
        overflow: visible;
        background-color: rgba(33, 37, 41, 0.4) !important;
        border: 2px solid var(--bs-primary) !important;
        border-radius: 10px !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
    }

    #columns .add-column {
        width: 100% !important;
        min-height: 60px;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    /* Ensure content doesn't overflow at very narrow widths */
    .column-title-text {
        font-size: calc(1.25rem + 0.5vw);
        padding-right: 2rem;
    }

    .cards-container {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Media query for responsive design - screens under 1200px */
@media (max-width: 1200px) {
    .add-column {
        margin-top: 1rem;
    }
}

/* Column styles from components.css */
.column-drag-handle {
    cursor: grab;
    padding: 0;
    margin-left: 0;
    color: var(--bs-light);
    opacity: 0.5;
    transition: opacity 0.2s;
    font-size: 1.75rem;
    user-select: none;
    align-self: flex-start;
    padding-top: 0rem;
}

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

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

.column-menu-button {
    position: absolute;
    right: 0.1rem; 
    color: var(--bs-light);
    opacity: 0.7;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    transition: opacity 0.2s;
    text-decoration: none !important;
    transform: translateY(4px);
}

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

.column-title-text {
    flex: 1;
    font-size: 1.75rem;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: unset;
    padding-right: 2.5rem;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.column-title-text:active {
    cursor: grabbing;
}

.column-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    position: relative;
    gap: 0.5rem;
}

.cards-container {
    position: relative;
    height: calc(100% - 60px);
    overflow-y: auto;
    overflow-x: hidden;
}

.cards-container .dropdown-menu {
    position: fixed;
    z-index: 1000;
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-card-container {
    width: 100%;
    padding: 0;
    padding-bottom: 1.5rem;
    margin-top: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: var(--bs-primary);
    border: 2px solid var(--bs-primary);
    border-radius: 10px;
    position: relative;
    min-height: 68px;
}

.add-card-container .d-flex {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    z-index: 2;
}

.add-card-container:hover {
    background-color: #1e1e1e;
}

.add-card-container:hover .text-muted {
    color: var(--bs-light) !important;
}

.add-card-container .btn {
    transition: all 0.2s ease;
    white-space: nowrap;
}

.add-card-container:hover .btn {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.add-column {
    width: 300px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(33, 37, 41, 0.4);
    border: 2px solid var(--bs-primary);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.add-column span {
    font-size: 2rem;
    color: var(--bs-light);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.add-column:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.5);
    transform: scale(1.02);
}

.add-column:hover span {
    opacity: 1;
}

/* Update the column drop indicator styles */
.column-drop-indicator {
    position: fixed;
    width: 4px;  /* Thinner width for precision */
    background-color: var(--bs-primary);  /* Use primary color for consistency */
    box-shadow: 0 0 8px var(--bs-primary), 0 0 12px rgba(13, 110, 253, 0.5);  /* Enhanced glow effect */
    border-radius: 2px;
    z-index: 1000;  /* Ensure it appears above other elements */
    opacity: 0.9;  /* Slightly transparent */
    transition: opacity 0.15s ease;  /* Smooth appearance */
    animation: pulse-glow 1.5s infinite alternate;  /* Add pulsing effect */
}

/* Add pulsing animation for the drop indicator */
@keyframes pulse-glow {
    from {
        box-shadow: 0 0 8px var(--bs-primary), 0 0 12px rgba(13, 110, 253, 0.5);
    }
    to {
        box-shadow: 0 0 12px var(--bs-primary), 0 0 20px rgba(13, 110, 253, 0.7);
    }
}

#columnAnalysisModal .modal-dialog {
    max-height: 85vh;
    margin: 1.75rem auto;
}

#columnAnalysisModal .modal-content {
    max-height: 85vh;
}

#columnAnalysisModal .modal-body {
    overflow-y: auto;
}

#analysisContent .card-link,
#analysisContent .chat-link {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

#analysisContent .card-link:hover,
#analysisContent .chat-link:hover {
    color: var(--bs-blue);
    text-decoration: underline;
}

#analysisContent .card-link {
    font-weight: 600;
}

#analysisContent .chat-link {
    font-style: italic;
}

/* Analysis Modal Link Styles */
#columnAnalysisModal .modal-body .card-link,
#columnAnalysisModal .modal-body .chat-link {
    color: var(--bs-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

#columnAnalysisModal .modal-body .card-link:hover,
#columnAnalysisModal .modal-body .chat-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
    opacity: 0.9;
}

/* Card title links - bold only */
#columnAnalysisModal .modal-body .card-link {
    font-weight: 700;
    border-bottom: 1px dashed var(--bs-primary);
    font-style: normal;
}

/* Chat suggestion links - italic only */
#columnAnalysisModal .modal-body .chat-link {
    font-style: italic;
    font-weight: normal;
    opacity: 0.9;
}

/* Add some spacing between suggestions */
#suggestedSteps p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Make the links more visible in dark mode */
.dark-mode #columnAnalysisModal .card-link,
.dark-mode #columnAnalysisModal .chat-link {
    color: #5c9eff;
}

.dark-mode #columnAnalysisModal .card-link:hover,
.dark-mode #columnAnalysisModal .chat-link:hover {
    color: #7db1ff;
}

/* Add spacing between activities */
#recentActivities p,
#recentActivities li {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    padding-left: 0;
}

/* Remove bullet points if they appear */
#recentActivities ul {
    list-style: none;
    padding-left: 0;
}

#recentActivities ul li:last-child,
#recentActivities p:last-child {
    margin-bottom: 0;  /* Remove margin from last item */
}

/* Style activity links same as other sections */
#recentActivities .card-link {
    font-weight: 700;
    border-bottom: 1px dashed #5c9eff;
    font-style: normal;
}

/* Add section dividers with larger font size */
#columnAnalysisModal .modal-body h6 {
    color: var(--bs-light);
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    font-size: 20px !important;
}

/* Additional specificity for Bootstrap override */
.modal-body h6.mb-3,
#analysisContent h6 {
    color: var(--bs-light) !important;
    font-size: 20px !important;
}

/* Dropdown menu styling - more specific selectors */
.column .dropdown-menu .dropdown-item {
    padding-left: 15px;
}

/* Icon containers - unified styles */
.column .dropdown-menu .dropdown-item .menu-icon,
.column .dropdown-menu .dropdown-item .ai-robot-icon {
    display: inline-block;
    width: 12px;
    text-align: center;
    margin-right: 1rem;
}

/* Robot icon specific adjustments */
.column .dropdown-menu .dropdown-item .ai-robot-icon {
    font-size: 14px;
    transform: scale(0.8);
    transform-origin: left center;
}

/* Add !important for critical properties if needed */
.column .dropdown-menu .dropdown-item .ai-robot-icon {
    width: 12px !important;
    font-size: 14px !important;
}

/* Column Summary Modal Styles */
#columnSummaryModal .modal-dialog {
    max-height: 85vh;
    margin: 1.75rem auto;
}

#columnSummaryModal .modal-content {
    max-height: 85vh;
}

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

#columnSummaryModal .context-entry {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

#columnSummaryModal .context-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

#columnSummaryModal .context-entry-summary {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

#columnSummaryModal .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Add styles for the AI Summary menu item icon */
.ai-summary-item .menu-icon {
    font-size: 14px;
    transform: scale(0.8);
    transform-origin: left center;
    margin-left: -3px;
}

/* Column menu z-index handling */
.column {
    position: relative;
    z-index: 1;
}

.column:has(.dropdown-menu.show) {
    z-index: 1000;
    position: relative;
}

.column .dropdown-menu.show {
    z-index: 1001 !important;
    position: absolute !important;
}

/* Ensure column menu items are above the menu itself */
.column .dropdown-menu .dropdown-item {
    position: relative;
    z-index: 1002;
}

/* Column z-index handling */
.column {
    position: relative;
    z-index: 1;
}

/* When any card in the column has its menu open, raise the column's z-index */
.column:has(.card .dropdown-menu.show) {
    z-index: 1000;
    position: relative;
}

/* When adjacent column has a menu open, lower this column's z-index */
.column:has(+ .column .card .dropdown-menu.show) {
    z-index: auto;
}

/* Ensure card menus appear above adjacent columns */
.column .card:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1001;
}

.column .card .dropdown-menu.show {
    z-index: 1002 !important;
    position: absolute !important;
}
