:root {
    --kanban-bg: #f7f7f7;
    --card-bg: #ffffff;
    --priority-low: #4ade80;
    --priority-medium: #fb923c;
    --priority-high: #ef4444;
    --priority-na: #0d6efd;
    --border-radius: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --btn-height: 38px;
    --column-padding: 1rem;
}

body {
    background-color: var(--kanban-bg);
    min-height: 100vh;
}

/* Fix for keeping modals open when image viewer is shown */
.modal.keep-open {
    display: block;
    background-color: rgba(0, 0, 0, 0.4);
}

/* Ensure the image viewer appears above other modals */
#imageViewerModal {
    z-index: 1060;
}

/* Override Bootstrap's modal backdrop settings when we have nested modals */
.modal-backdrop.show:nth-of-type(2) {
    z-index: 1055;
}

/* Delete confirmation modal - ensure it appears above all other modals */
#deleteConfirmModal {
    z-index: 1070 !important;
}

/* Delete confirmation modal backdrop - ensure it's darker and above other backdrops */
#deleteConfirmModal + .modal-backdrop,
.modal-backdrop.show:nth-of-type(3) {
    z-index: 1065 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Additional styling for delete modal to make it more prominent */
#deleteConfirmModal .modal-content {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    border: 2px solid #dc3545 !important;
}

/* Navbar styles - Force light theme for navbar */
html[data-bs-theme="light"] .main-header,
.main-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

html[data-bs-theme="light"] .navbar,
.navbar {
    background-color: #ffffff !important;
}

html[data-bs-theme="dark"] .main-header {
    background-color: #1a1d23 !important;
    border-bottom: 1px solid #2d3238 !important;
}

html[data-bs-theme="dark"] .navbar {
    background-color: #1a1d23 !important;
}

/* Dark Mode Styles */
html[data-bs-theme="dark"] {
    --kanban-bg: #0d1117;
    --card-bg: #161b22;
    --column-bg: #21262d;
    --border-color: #30363d;
    --text-color: #e6edf3;
    --text-muted: #7d8590;
    --hover-bg: #262c36;
    --shadow-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

html[data-bs-theme="dark"] body {
    background-color: var(--kanban-bg);
    color: var(--text-color);
}

/* Dark mode kanban board */
html[data-bs-theme="dark"] .kanban-board {
    background-color: var(--kanban-bg);
}

/* Dark mode columns */
html[data-bs-theme="dark"] .kanban-column {
    background-color: var(--column-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-dark);
}

html[data-bs-theme="dark"] .kanban-column-title {
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

html[data-bs-theme="dark"] .column-name {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .edit-column-btn,
html[data-bs-theme="dark"] .add-card-btn {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .edit-column-btn:hover,
html[data-bs-theme="dark"] .add-card-btn:hover {
    color: var(--text-color);
    background-color: var(--hover-bg);
}

/* Dark mode cards */
html[data-bs-theme="dark"] .kanban-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-dark);
    transition: all 0.2s ease;
}

html[data-bs-theme="dark"] .kanban-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

html[data-bs-theme="dark"] .kanban-card-title {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .kanban-card-description {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .kanban-card-meta {
    color: var(--text-muted);
}

/* Dark mode cards container */
html[data-bs-theme="dark"] .kanban-cards {
    background-color: rgba(33, 38, 45, 0.3);
    border: 1px dashed var(--border-color);
}

html[data-bs-theme="dark"] .kanban-cards:empty::after {
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* Dark mode buttons and controls */
html[data-bs-theme="dark"] .btn-primary {
    background-color: #238636;
    border-color: #238636;
}

html[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

html[data-bs-theme="dark"] .btn-secondary {
    background-color: #6e7681;
    border-color: #6e7681;
    color: #ffffff;
}

html[data-bs-theme="dark"] .btn-secondary:hover {
    background-color: #7c8590;
    border-color: #7c8590;
}

html[data-bs-theme="dark"] .btn-info {
    background-color: #0969da;
    border-color: #0969da;
}

html[data-bs-theme="dark"] .btn-info:hover {
    background-color: #0860ca;
    border-color: #0860ca;
}

html[data-bs-theme="dark"] .btn-warning {
    background-color: #fb8500;
    border-color: #fb8500;
}

html[data-bs-theme="dark"] .btn-warning:hover {
    background-color: #f77f00;
    border-color: #f77f00;
}

html[data-bs-theme="dark"] .btn-success {
    background-color: #238636;
    border-color: #238636;
}

html[data-bs-theme="dark"] .btn-success:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

html[data-bs-theme="dark"] .btn-light {
    background-color: var(--column-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .btn-light:hover {
    background-color: var(--hover-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Dark mode board info */
html[data-bs-theme="dark"] .board-title {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .board-description {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .edit-board-btn {
    color: #6c757d;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.edit-board-btn:hover {
    color: #0d6efd;
}

/* Focus toggle button styling */
#focusToggleBtn {
    transition: all 0.3s ease;
}

#focusToggleBtn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

#focusToggleBtn.active:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: white;
}

/* Styles for when focus mode is active */
.board-focused .kanban-card:not(.assigned-to-me) {
    display: none;
}

.board-focused .kanban-cards:empty::after {
    content: "No tasks assigned to you in this column";
    color: #6c757d;
    font-style: italic;
}

/* Styles for when priority filter is active */
.board-priority-filtered .kanban-card:not(.high-priority-card) {
    display: none;
}

.board-priority-filtered .kanban-cards:empty::after {
    content: "No high priority tasks in this column";
    color: #ef4444;
    font-style: italic;
}

/* Styles for when both filters are active */
.board-focused.board-priority-filtered .kanban-card:not(.assigned-to-me.high-priority-card) {
    display: none;
}

.board-focused.board-priority-filtered .kanban-cards:empty::after {
    content: "No high priority tasks assigned to you in this column";
    color: #ef4444;
    font-style: italic;
}

/* Dark mode add column */
html[data-bs-theme="dark"] .add-column-container {
    background-color: rgba(33, 38, 45, 0.5);
    border: 1px dashed var(--border-color);
}

html[data-bs-theme="dark"] .add-column-container:hover {
    background-color: rgba(33, 38, 45, 0.8);
    border-color: #58a6ff;
}

html[data-bs-theme="dark"] .add-column-container button {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .add-column-container:hover button {
    color: #58a6ff;
}

/* Dark mode modals */
html[data-bs-theme="dark"] .modal-content {
    background-color: var(--column-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .modal-header {
    border-bottom: 1px solid var(--border-color);
}

html[data-bs-theme="dark"] .modal-footer {
    border-top: 1px solid var(--border-color);
}

html[data-bs-theme="dark"] .modal-title {
    color: var(--text-color);
}

/* Dark mode forms */
html[data-bs-theme="dark"] .form-control {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .form-control:focus {
    background-color: var(--card-bg);
    border-color: #58a6ff;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .form-select {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .form-select:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

html[data-bs-theme="dark"] .form-label {
    color: var(--text-color);
}

/* Dark mode list groups */
html[data-bs-theme="dark"] .list-group-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .list-group-item:hover {
    background-color: var(--hover-bg);
}

html[data-bs-theme="dark"] .list-group-item.active {
    background-color: #0969da;
    border-color: #0969da;
}

/* Dark mode cards and badges */
html[data-bs-theme="dark"] .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

html[data-bs-theme="dark"] .card-header {
    background-color: var(--column-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .card-body {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .badge {
    color: #ffffff;
}

/* Dark mode checklist items */
html[data-bs-theme="dark"] .checklist-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

html[data-bs-theme="dark"] .checklist-item-text {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .checklist-item-date {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Dark mode top scroll bar */
html[data-bs-theme="dark"] .top-scroll-bar {
    background-color: rgba(33, 38, 45, 0.8);
    border: 1px solid var(--border-color);
}

html[data-bs-theme="dark"] .top-scroll-bar:hover {
    background-color: rgba(33, 38, 45, 0.95);
}

html[data-bs-theme="dark"] .top-scroll-bar::-webkit-scrollbar-track {
    background: rgba(30, 35, 42, 0.8);
}

html[data-bs-theme="dark"] .top-scroll-bar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #58a6ff, #316dca);
    border-radius: 6px;
    transition: background 0.2s ease;
}

html[data-bs-theme="dark"] .top-scroll-bar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #316dca, #1f2937);
}

/* Dark mode text colors */
html[data-bs-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

html[data-bs-theme="dark"] .text-secondary {
    color: var(--text-muted) !important;
}

/* Dark mode borders */
html[data-bs-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

html[data-bs-theme="dark"] .border-top {
    border-top-color: var(--border-color) !important;
}

html[data-bs-theme="dark"] .border-bottom {
    border-bottom-color: var(--border-color) !important;
}

/* Dark mode alerts */
html[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
    color: #ff7b72;
}

html[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(251, 133, 0, 0.1);
    border-color: rgba(251, 133, 0, 0.3);
    color: #fb8500;
}

html[data-bs-theme="dark"] .alert-success {
    background-color: rgba(35, 134, 54, 0.1);
    border-color: rgba(35, 134, 54, 0.3);
    color: #3fb950;
}

html[data-bs-theme="dark"] .alert-info {
    background-color: rgba(9, 105, 218, 0.1);
    border-color: rgba(9, 105, 218, 0.3);
    color: #58a6ff;
}

/* Dark mode file attachments */
html[data-bs-theme="dark"] .file-attachment {
    background-color: var(--card-bg);
    border-left-color: var(--border-color);
}

html[data-bs-theme="dark"] .file-attachment:hover {
    background-color: var(--hover-bg);
}

html[data-bs-theme="dark"] .drag-drop-zone {
    border-color: var(--border-color);
    background-color: rgba(33, 38, 45, 0.3);
}

html[data-bs-theme="dark"] .drag-drop-zone.active-drop-zone {
    border-color: #58a6ff !important;
    background-color: rgba(88, 166, 255, 0.1) !important;
}

html[data-bs-theme="dark"] .drop-instruction {
    color: var(--text-muted);
}

/* Dark mode transitions for smooth theme switching */
html[data-bs-theme="dark"] * {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.kanban-board {
    display: flex;
    gap: 1rem;
    padding: 0 1rem 4rem 1rem; /* Extra bottom padding for fixed bottom scroll bar */
    overflow-x: auto;
    min-height: calc(100vh - 150px);
}

/* Container for draggable columns */
.kanban-columns-container {
    display: flex;
    gap: 1rem;
    min-height: calc(100vh - 150px);
}

.kanban-column {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    min-width: 300px;
    max-width: 300px;
    padding: var(--column-padding);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

/* Styles for column being dragged */
.kanban-column.gu-mirror {
    background-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Styles for column drag handle */
.column-drag-handle {
    cursor: grab;
    padding: 5px;
    margin-right: 5px;
    display: flex;
    align-items: center;
}

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

.column-drag-handle .fa-grip-vertical {
    transition: color 0.2s ease;
}

.column-drag-handle:hover .fa-grip-vertical {
    color: #666 !important;
}

.kanban-column-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 0;
}

.column-actions {
    display: flex;
    align-items: center;
}

.edit-column-btn, .add-card-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 2px 5px;
    transition: color 0.2s ease;
    cursor: pointer;
}

.edit-column-btn:hover, .add-card-btn:hover {
    color: #343a40;
}

.column-edit-input {
    border: none;
    border-bottom: 2px solid #0d6efd;
    border-radius: 0;
    padding: 2px 4px;
    background-color: rgba(13, 110, 253, 0.05);
}

.column-edit-input:focus {
    box-shadow: none;
    outline: none;
}

.kanban-cards {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

/* Enhanced drag and drop styles for entire column */
.kanban-column {
    transition: all 0.2s ease;
}

.kanban-column.drag-over-column {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3) !important;
    background-color: rgba(0, 123, 255, 0.02) !important;
    border: 2px solid rgba(0, 123, 255, 0.4) !important;
}

.drag-operation-in-progress .kanban-column:hover {
    background-color: rgba(0, 123, 255, 0.02);
    border: 1px solid rgba(0, 123, 255, 0.2);
    cursor: copy;
}

.drag-operation-in-progress .kanban-cards {
    background-color: rgba(0, 123, 255, 0.05);
    border: 1px dashed rgba(0, 123, 255, 0.3);
}

/* Empty state for columns */
.kanban-cards:empty::after {
    content: "Drop cards here";
    color: #adb5bd;
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: block;
}

.kanban-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    position: relative;
    cursor: grab;
}

.kanban-card:active {
    cursor: grabbing;
}

.priority-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.priority-low {
    background-color: var(--priority-low);
}

.priority-medium {
    background-color: var(--priority-medium);
}

.priority-high {
    background-color: var(--priority-high);
}

.kanban-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.kanban-card-description {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    /* Limit description to 4 lines max with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 5em;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #666;
    padding-left: 0.5rem;
}

/* Card image styles in inline styles */
.kanban-card-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 0.25rem;
    margin: 0.5rem auto;
    display: block;
}

.board-selector {
    position: relative;
    display: inline-block;
}

/* Custom select styling */
.board-selector select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    height: var(--btn-height);
}

.board-selector select:hover {
    border-color: #adb5bd;
}

.board-selector select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* Override Bootstrap's smaller select */
.form-select-sm {
    padding: 0.25rem 2rem 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.add-board-btn, .add-column-btn, .add-card-btn {
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.add-board-btn:hover, .add-column-btn:hover, .add-card-btn:hover {
    color: #000;
}

/* Modal styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

/* Board title styling */
.board-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #333;
    padding-left: var(--column-padding);
}

/* Board description styling */
.board-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-left: var(--column-padding);
}

/* Header area styling */
.header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.board-info {
    flex: 1;
}

.controls-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Button styling */
.btn {
    height: var(--btn-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 6px;
    padding-left: 1rem;
    padding-right: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(13, 110, 253, 0.15);
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(23, 162, 184, 0.25);
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.25);
}

.btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Edit button styling */
.edit-board-btn {
    color: #6c757d;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.edit-board-btn:hover {
    color: #0d6efd;
}

/* Board list styling */
.board-list {
    max-height: 400px;
    overflow-y: auto;
}

.board-list-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.board-list-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.list-group-item.active {
    color: #000 !important;
    background-color: #dcdcdc !important;
    border-color: #dcdcdc;
}

.board-list-item.active {
    border-left: 4px solid #0d6efd; 
    background-color: rgba(13, 110, 253, 0.05);
}

.board-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.board-item-description {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Add column button styling */
.add-column-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius);
    min-width: 300px;
    max-width: 300px;
    height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 33px;
}

.add-column-container button {
    color: #6c757d;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-column-container:hover button {
    color: #000;
}

.checklist-item {
    transition: all 0.2s ease;
    border-left: 3px solid #6c757d;
}

.checklist-item-complete:checked + .checklist-item-details .checklist-item-text {
    text-decoration: line-through;
    color: #6c757d;
}

.checklist-progress {
    height: 8px;
    margin-top: 6px;
    margin-bottom: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.checklist-progress .progress-bar {
    background-color: #0d6efd;
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.kanban-card-checklist {
    margin-top: 8px;
    margin-bottom: 4px;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.kanban-card-checklist .progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
}

.kanban-card-checklist .progress-bar {
    background-color: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.checklist-item-complete:checked ~ .checklist-item-details .checklist-item-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.checklist-overdue {
    border-left-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05);
}

.checklist-due-today {
    border-left-color: #fb923c !important;
    background-color: rgba(251, 146, 60, 0.05);
}

.checklist-completed {
    border-left-color: #4ade80 !important;
    background-color: rgba(74, 222, 128, 0.05);
}

/* Tag System Styles */
.color-option {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-option.selected {
    border-color: #000;
    transform: scale(1.1);
}

.color-option:hover {
    transform: scale(1.1);
}

.tag-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-block;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: #fff;
    margin-right: 4px;
    margin-bottom: 4px;
    user-select: none;
}

.card-tag .tag-remove {
    margin-left: 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.card-tag .tag-remove:hover {
    opacity: 1;
}

.kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0.5rem;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Last Activity styles */
.card-last-activity {
    font-size: 0.7rem;
    color: #999;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    gap: 0.3rem;
}

.card-last-activity i {
    opacity: 0.7;
    font-size: 0.65rem;
}

.card-last-activity .activity-text {
    font-weight: 600;
    color: #666;
}

.card-last-activity .activity-details {
    margin-left: auto;
    font-size: 0.65rem;
    color: #aaa;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-last-activity .activity-details:hover {
    color: #666;
}

/* Dark mode for last activity */
html[data-bs-theme="dark"] .card-last-activity {
    color: var(--text-muted);
    border-top-color: var(--border-color);
}

html[data-bs-theme="dark"] .card-last-activity .activity-text {
    color: #8b949e;
}

html[data-bs-theme="dark"] .card-last-activity .activity-details {
    color: #6e7681;
}

html[data-bs-theme="dark"] .card-last-activity .activity-details:hover {
    color: #8b949e;
}

/* Assignee styles */
.card-assignee {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    margin-top: 5px;
}

.assignee-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Custom CSS styles for file uploads */
.drag-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
    margin-bottom: 15px;
}

.drag-drop-zone.active-drop-zone {
    border-color: #1890ff !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
    border-style: solid !important;
}

.drop-instruction {
    color: #6c757d;
    font-size: 0.9rem;
    padding: 20px 0;
}

.drop-instruction i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #adb5bd;
}

/* Hide drop instructions when content is present */
.drag-drop-zone:has(#editImagePreview[src]:not([src=""]), .file-attachment) .drop-instruction,
.drag-drop-zone:has(#imagePreview[src]:not([src=""]), .file-attachment) .drop-instruction {
    display: none;
}

/* File attachments container styles */
.files-container {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* File attachment styles */
.file-attachment {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    border-left: 3px solid #ccc;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.file-attachment:hover {
    background-color: #e9ecef;
}

.file-attachment.uploading {
    border-left-color: #007bff;
    background-color: #f0f7ff;
}

.file-attachment.complete {
    border-left-color: #28a745;
    background-color: #f0fff4;
}

.file-attachment.upload-failed {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.file-attachment.reused {
    border-left-color: #0dcaf0;
    background-color: #f0fbff;
}

.highlight-file {
    animation: pulse-highlight 2s ease;
}

@keyframes pulse-highlight {
    0% { background-color: rgba(13, 202, 240, 0.1); }
    50% { background-color: rgba(13, 202, 240, 0.3); }
    100% { background-color: rgba(13, 202, 240, 0.1); }
}

.file-icon {
    font-size: 24px;
    margin-right: 10px;
    width: 30px;
    text-align: center;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    font-size: 0.8rem;
    color: #6c757d;
}

.file-size {
    margin-right: 10px;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.files-header {
    margin-top: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.files-container:empty + .files-header {
    display: none;
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

/* Rich text editor styles */
.ql-toolbar.ql-snow {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    background-color: #f8f9fa;
}

.ql-container.ql-snow {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    background-color: #fff;
}

.ql-editor {
    min-height: 200px;
}

.ql-editor p {
    margin-bottom: 0.5rem;
}

/* Make sure editor is visible in dark mode */
html[data-bs-theme="dark"] .ql-container.ql-snow {
    background-color: #2b3035;
    color: #fff;
}

html[data-bs-theme="dark"] .ql-toolbar.ql-snow {
    background-color: #343a40;
    color: #fff;
}

html[data-bs-theme="dark"] .ql-editor {
    color: #fff;
}

/* Modal styles */
#editCardModal .modal-dialog {
    max-width: 980px; /* Wider than modal-lg (800px) but not as wide as modal-xl (1140px) */
}

/* Bottom Fixed Horizontal Scroll Bar Styles */
.bottom-scroll-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bottom-scroll-container.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.bottom-scroll-bar {
    height: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    margin: 8px 0;
}

.bottom-scroll-bar:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.bottom-scroll-content {
    height: 1px;
    background: transparent;
}

/* Custom scrollbar styling for bottom scroll */
.bottom-scroll-bar::-webkit-scrollbar {
    height: 12px;
}

.bottom-scroll-bar::-webkit-scrollbar-track {
    background: rgba(240, 240, 240, 0.6);
    border-radius: 8px;
    margin: 2px;
}

.bottom-scroll-bar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0d6efd, #0056d3);
    border-radius: 8px;
    transition: background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bottom-scroll-bar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056d3, #004085);
}

/* Firefox scrollbar styling */
.bottom-scroll-bar {
    scrollbar-width: thin;
    scrollbar-color: #0d6efd rgba(240, 240, 240, 0.6);
}

/* Hide when not needed */
.bottom-scroll-container.hidden {
    display: none;
}

/* Dark mode support for bottom scroll bar */
html[data-bs-theme="dark"] .bottom-scroll-container {
    background: rgba(33, 38, 45, 0.95);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

html[data-bs-theme="dark"] .bottom-scroll-bar:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

html[data-bs-theme="dark"] .bottom-scroll-bar::-webkit-scrollbar-track {
    background: rgba(30, 35, 42, 0.6);
}

html[data-bs-theme="dark"] .bottom-scroll-bar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #58a6ff, #316dca);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

html[data-bs-theme="dark"] .bottom-scroll-bar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #316dca, #1f2937);
}

html[data-bs-theme="dark"] .bottom-scroll-bar {
    scrollbar-color: #58a6ff rgba(30, 35, 42, 0.6);
}

/* Templates System Styles */
.template-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.template-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.2);
}

.template-item.active {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    border-left: 4px solid #0d6efd;
}

.template-editor-container {
    min-height: 400px;
}

.template-editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

.template-editor-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Dark mode templates styles */
html[data-bs-theme="dark"] .template-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .template-item:hover {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
}

html[data-bs-theme="dark"] .template-item.active {
    background-color: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
    border-left: 4px solid #58a6ff;
}

html[data-bs-theme="dark"] .template-editor-placeholder {
    color: var(--text-muted);
}

/* Template selection modal styles */
.template-selection-item {
    transition: all 0.2s ease;
}

.template-selection-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

html[data-bs-theme="dark"] .template-selection-item:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

/* Template form styles */
.template-form .form-check {
    margin-bottom: 0.5rem;
}

.template-form .form-check-label {
    cursor: pointer;
    user-select: none;
}

.template-form .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Template tags container */
.template-tags-container {
    min-height: 40px;
    border: 1px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

html[data-bs-theme="dark"] .template-tags-container {
    border-color: var(--border-color);
    background-color: rgba(33, 38, 45, 0.3);
}

.template-tags-container:empty::after {
    content: "No tags selected";
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

html[data-bs-theme="dark"] .template-tags-container:empty::after {
    color: var(--text-muted);
}

/* Focus Toggle Section Styles */
.focus-toggle-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0 1rem 1rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.focus-toggle-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.focus-toggle-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
    user-select: none;
}

.focus-toggle-switch {
    width: 3rem !important;
    height: 1.5rem !important;
    cursor: pointer !important;
    background-color: #6c757d !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.focus-toggle-switch:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.focus-toggle-switch:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.focus-status-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 0.5rem;
    transition: color 0.3s ease;
    user-select: none;
}

.focus-toggle-switch:checked + .form-check-label .focus-status-text {
    color: #0d6efd;
    font-weight: 500;
}

/* Dark mode focus toggle */
html[data-bs-theme="dark"] .focus-toggle-section {
    background: linear-gradient(135deg, var(--column-bg) 0%, var(--hover-bg) 100%);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .focus-toggle-label {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .focus-status-text {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .focus-toggle-switch:checked + .form-check-label .focus-status-text {
    color: #58a6ff;
}

/* Animation for the toggle state change */
.focus-toggle-section.switching {
    animation: focusTogglePulse 0.6s ease;
}

@keyframes focusTogglePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Global Search Styles */
.global-search-input {
    border-radius: 0.5rem;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.global-search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.search-results-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.search-query-display {
    font-size: 0.875rem;
    color: #6c757d;
}

.search-category {
    margin-bottom: 2rem;
}

.search-category-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.search-results-list {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #e3f2fd;
    border-color: #0d6efd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.search-result-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    font-size: 0.75rem;
    color: #868e96;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-board {
    background: #e7f3ff;
    color: #0d6efd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.search-result-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.7rem;
}

.search-result-priority.high {
    background: #ffe6e6;
    color: #ef4444;
}

.search-result-priority.medium {
    background: #fff3e6;
    color: #fb923c;
}

.search-result-priority.low {
    background: #e6ffe6;
    color: #4ade80;
}

.search-highlight {
    background: #fff59d;
    font-weight: 600;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* Comments System Styles */
.comments-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    padding: 0.75rem;
}

.comment-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
}

.comment-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1);
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.comment-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.comment-text {
    color: #495057;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0;
    word-wrap: break-word;
}

.comment-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.comment-item:hover .comment-actions {
    opacity: 1;
}

.comment-edit-btn, .comment-delete-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.comment-edit-btn:hover {
    color: #0d6efd;
}

.comment-delete-btn:hover {
    color: #dc3545;
}

.comment-edit-form {
    margin-top: 0.5rem;
}

.comment-edit-textarea {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    resize: none;
}

.comment-edit-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.comment-typing-indicator {
    font-style: italic;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 0.5rem;
    text-align: center;
}

/* Dark mode comments */
html[data-bs-theme="dark"] .comments-container {
    background-color: var(--column-bg);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .comment-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .comment-item:hover {
    border-color: #58a6ff;
    box-shadow: 0 2px 4px rgba(88, 166, 255, 0.1);
}

html[data-bs-theme="dark"] .comment-author {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .comment-time {
    color: var(--text-muted);
}

html[data-bs-theme="dark"] .comment-text {
    color: var(--text-color);
}

html[data-bs-theme="dark"] .comment-edit-btn:hover {
    color: #58a6ff;
}

html[data-bs-theme="dark"] .comment-delete-btn:hover {
    color: #ff7b72;
}

html[data-bs-theme="dark"] .comment-edit-textarea {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-bs-theme="dark"] .comment-typing-indicator {
    color: var(--text-muted);
}

/* Comment image styles */
.comment-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px dashed #dee2e6;
}

.comment-image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.comment-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-image-preview-item .remove-preview-image {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.comment-image-preview-item .remove-preview-image:hover {
    background: #dc3545;
}

.comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-image-item {
    position: relative;
    max-width: 200px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-image-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comment-image-item img {
    width: 100%;
    height: auto;
    display: block;
}

.comment-image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* Dark mode for comment images */
html[data-bs-theme="dark"] .comment-image-preview {
    background: var(--card-bg);
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .comment-image-preview-item {
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .comment-image-item {
    border-color: var(--border-color);
}

html[data-bs-theme="dark"] .comment-image-loading {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Card comment indicator */
.card-comments-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0 4px;
    box-sizing: border-box;
    line-height: 1;
}

html[data-bs-theme="dark"] .card-comments-indicator {
    background: #58a6ff;
}

/* Auto-refresh styles */
.auto-refresh-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

html[data-bs-theme="dark"] .auto-refresh-indicator {
    background-color: #4ade80;
}

/* Firefox Compatibility Fixes */

/* 1. Firefox scrollbar styling (Firefox doesn't support webkit scrollbars) */
@-moz-document url-prefix() {
    .top-scroll-bar {
        scrollbar-width: thin;
        scrollbar-color: #ccc #f0f0f0;
    }
    
    html[data-bs-theme="dark"] .top-scroll-bar {
        scrollbar-color: #6e7681 #21262d;
    }
}

/* 2. Firefox text ellipsis support (fallback for webkit-line-clamp) */
@-moz-document url-prefix() {
    .kanban-card-description {
        display: block !important;
        max-height: 4.8em; /* approximately 4 lines */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        /* Firefox alternative to webkit-line-clamp */
        position: relative;
    }
    
    .kanban-card-description::after {
        content: "...";
        position: absolute;
        bottom: 0;
        right: 0;
        background: var(--card-bg);
        padding-left: 1rem;
        background: linear-gradient(to right, transparent, var(--card-bg) 50%);
    }
    
    .search-results-content .unified-item-description {
        display: block !important;
        max-height: 2.4em; /* approximately 2 lines */
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 3. Firefox flexbox fixes */
@-moz-document url-prefix() {
    .kanban-board {
        display: -moz-flex;
        display: flex;
    }
    
    .kanban-column {
        display: -moz-flex;
        display: flex;
        -moz-flex-direction: column;
        flex-direction: column;
    }
    
    .controls-area {
        display: -moz-flex;
        display: flex;
    }
    
    .header-area {
        display: -moz-flex;
        display: flex;
    }
}

/* 4. Firefox drag and drop visual feedback improvements */
@-moz-document url-prefix() {
    .kanban-column.drag-over-column {
        background-color: rgba(59, 130, 246, 0.1);
        border: 2px dashed #3b82f6;
        -moz-transform: scale(1.02);
        transform: scale(1.02);
    }
    
    .drag-operation-in-progress .kanban-column {
        -moz-transition: all 0.2s ease;
        transition: all 0.2s ease;
    }
}

/* 5. Firefox form control styling fixes */
@-moz-document url-prefix() {
    .form-check-input {
        -moz-appearance: none;
        appearance: none;
    }
    
    .btn {
        -moz-user-select: none;
        user-select: none;
    }
}

/* 6. Firefox animation performance improvements */
@-moz-document url-prefix() {
    .auto-refresh-indicator {
        will-change: box-shadow;
    }
    
    .kanban-card {
        will-change: transform, box-shadow;
    }
    
    .kanban-column.drag-over-column {
        will-change: transform, background-color, border;
    }
}

/* 7. Firefox-specific focus improvements */
@-moz-document url-prefix() {
    .form-check-input:focus {
        outline: 2px solid #0066cc;
        outline-offset: 2px;
    }
    
    .btn:focus {
        outline: 2px solid #0066cc;
        outline-offset: 2px;
    }
    
    /* Remove default Firefox button focus styling */
    .btn::-moz-focus-inner {
        border: 0;
        padding: 0;
    }
}

/* 8. Firefox responsive improvements */
@-moz-document url-prefix() {
    @media screen and (max-width: 768px) {
        .kanban-board {
            -moz-flex-direction: column;
            flex-direction: column;
        }
        
        .kanban-column {
            margin-bottom: 1rem;
            width: 100% !important;
        }
    }
}

/* 9. Firefox text selection improvements */
@-moz-document url-prefix() {
    .kanban-card-title,
    .kanban-card-description {
        -moz-user-select: text;
        user-select: text;
    }
    
    .column-drag-handle {
        -moz-user-select: none;
        user-select: none;
    }
}

/* 10. Firefox modal and z-index fixes */
@-moz-document url-prefix() {
    .modal {
        position: fixed;
        z-index: 1050;
    }
    
    .modal-backdrop {
        position: fixed;
        z-index: 1040;
    }
    
    #imageViewerModal {
        z-index: 1060;
    }
    
    #deleteConfirmModal {
        z-index: 1070 !important;
    }
}

/* 11. Firefox touch interaction improvements */
@-moz-document url-prefix() {
    .kanban-card.touch-active {
        background-color: rgba(59, 130, 246, 0.1);
        transform: translateY(-2px);
        transition: all 0.15s ease;
    }
    
    .btn.touch-active {
        transform: translateY(1px);
    }
}

/* 12. Firefox-specific button and input improvements */
@-moz-document url-prefix() {
    input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .form-check-input:checked {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }
    
    .btn:active {
        transform: translateY(1px);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

/* 13. Firefox print media query fixes */
@media print {
    @-moz-document url-prefix() {
        .kanban-board {
            display: block !important;
        }
        
        .kanban-column {
            display: block !important;
            break-inside: avoid;
            page-break-inside: avoid;
            margin-bottom: 1rem;
        }
        
        .auto-refresh-indicator {
            display: none !important;
        }
    }
}
