.dropdown:hover .dropdown-menu {
    display: block;
}
.sidebar-tab.active {
    background-color: #3b82f6;
    color: white;
}
.sidebar-tab:hover {
    background-color: #e5e7eb;
}
.sidebar-tab.active:hover {
    background-color: #2563eb;
}

.kanban-column {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    min-height: 0; /* Important for flex-1 to work properly */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 500px); /* Ensure height constraint for scrolling */
}

.kanban-column::-webkit-scrollbar {
    width: 8px;
}

.kanban-column::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.kanban-column::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.kanban-column::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.kanban-column::-webkit-scrollbar-corner {
    background: transparent;
}

.kanban-card {
    transition: all 0.2s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
}

/* Ultra-compact kanban card styles */
.kanban-card {
    padding: 0.5rem !important; /* Very small padding */
    margin-bottom: 0.5rem !important; /* Very small margin */
    min-height: auto !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.kanban-card h5 {
    font-size: 0.75rem !important; /* Very small font */
    margin-bottom: 0.25rem !important; /* Minimal margin */
    line-height: 1.2 !important;
    white-space: normal !important; /* Allow wrapping */
    word-wrap: break-word !important; /* Break long words */
    overflow-wrap: break-word !important; /* Modern word breaking */
}

.kanban-card p {
    font-size: 0.75rem !important; /* Reduced description text */
    margin-bottom: 0.5rem !important; /* Reduced margin */
    line-height: 1.25 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* Show max 2 lines */
    line-clamp: 2 !important; /* Standard property for compatibility */
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
}

.kanban-card .text-xs {
    font-size: 0.5rem !important; /* Ultra small text */
}

/* Ultra-compact specific overrides */
.kanban-card .text-xs.font-medium {
    font-size: 0.5rem !important;
}

.kanban-card .text-gray-400 {
    font-size: 0.45rem !important;
}

/* Ultra-compact badge and icon styles */
.kanban-card .px-1.py-0\.5 {
    padding: 0.125rem 0.25rem !important;
    font-size: 0.45rem !important;
}

.kanban-card .px-1\.5.py-0\.5 {
    padding: 0.125rem 0.375rem !important;
    font-size: 0.5rem !important;
}

.kanban-card .rounded-full {
    border-radius: 0.375rem !important; /* Slightly less rounded for compact look */
}

/* Ultra-compact hover effects */
.kanban-card:hover {
    transform: translateY(-1px) !important; /* Smaller hover effect */
}

/* ====================================
   NEW TICKET NOTIFICATION POPUP STYLES
   ==================================== */

/* Popup animation classes */
.popup-slide-in {
    animation: slideInFromRight 0.3s ease-out;
}

.popup-slide-out {
    animation: slideOutToRight 0.3s ease-in;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Pulse animation for notification icon */
.notification-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Bounce animation for popup */
.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-10px,0);
    }
    70% {
        transform: translate3d(0,-5px,0);
    }
    90% {
        transform: translate3d(0,-2px,0);
    }
}

/* New ticket popup specific styles */
#newTicketPopup {
    backdrop-filter: blur(10px);
    border: 2px solid #3B82F6;
}

#newTicketPopup .bg-blue-50 {
    background: linear-gradient(135deg, #EBF8FF 0%, #DBEAFE 100%);
}

/* Responsive popup */
@media (max-width: 768px) {
    #newTicketPopup {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
    }
}

.kanban-card .w-4.h-4 {
    width: 1rem !important; /* Ultra small avatar */
    height: 1rem !important;
    font-size: 0.5rem !important;
}

.kanban-card .flex.items-center.space-x-1 {
    gap: 0.125rem !important; /* Ultra small spacing */
}

.kanban-card .flex.items-center.space-x-2 {
    gap: 0.25rem !important; /* Reduced spacing */
}

.kanban-card .flex.items-center.space-x-1 {
    gap: 0.125rem !important; /* Reduced badge spacing */
}

.kanban-card .px-3.py-1\.5 {
    padding: 0.25rem 0.5rem !important; /* Reduced status badge padding */
    font-size: 0.625rem !important;
}

.kanban-card .px-2.py-1 {
    padding: 0.125rem 0.375rem !important; /* Reduced small badge padding */
    font-size: 0.625rem !important;
}

.kanban-card .px-2.py-0\.5 {
    padding: 0.125rem 0.25rem !important; /* Reduced metadata badge padding */
    font-size: 0.625rem !important;
}

.kanban-card .mb-1.pb-1 {
    margin-bottom: 0.25rem !important; /* Ultra small metadata section margin */
    padding-bottom: 0.25rem !important;
}

.kanban-card .mb-1 {
    margin-bottom: 0.25rem !important; /* Ultra small title margin */
}

.kanban-card .mb-3 {
    margin-bottom: 0.5rem !important; /* Reduced general margins */
}

/* Creator name styling - PHP handles truncation */
.kanban-card .flex.items-center.space-x-2 .flex.flex-col span.text-xs.text-gray-700.font-medium {
    white-space: nowrap !important;
    display: inline-block !important;
}

.kanban-column.drag-over {
    background-color: #f3f4f6;
    border: 2px dashed #9ca3af;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Kanban board grid container - Dynamic columns based on status count */
.kanban-board-container {
    display: grid;
    /* Grid columns will be set dynamically via inline styles */
    gap: 1rem; /* Reduced gap */
    height: calc(100vh - 420px); /* Fixed height accounting for filters */
    min-height: 500px; /* Increased minimum height */
    max-height: calc(100vh - 370px); /* Increased max height */
}

/* Filters section stable layout */
.filters-section {
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.filters-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filters-header:hover {
    background-color: #f9fafb;
}

.filters-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.filters-content.expanded {
    max-height: 300px; /* Fixed maximum height */
}

.filters-content-inner {
    padding: 1.5rem;
}

/* Kanban column container */
.kanban-column-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden; /* Ensure proper containment */
}

/* Kanban column header */
.kanban-column-header {
    flex-shrink: 0;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Kanban column content area */
.kanban-column-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Critical for flex child to shrink properly */
}

/* Responsive breakpoints - grid columns will be set dynamically */
@media (max-width: 1024px) {
    .kanban-board-container {
        height: auto;
        max-height: none;
    }
}

@media (max-width: 950px) {
    .kanban-board-container {
        height: auto;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .kanban-board-container {
        height: auto;
        max-height: none;
    }
}

/* DataTables Custom Styling */
.dataTables_wrapper {
    font-family: inherit;
}

/* DataTables Header Layout */
.dataTables_wrapper > div:first-child {
    background-color: white;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter label {
    margin-bottom: 0;
}

/* Top controls container */
.dataTables_wrapper .dataTables_length {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Form controls styling */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    background-color: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z'/%3e%3c/svg%3e");
    background-position: left 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    padding-left: 2.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Table styling */
.dataTables_wrapper table.dataTable {
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dataTables_wrapper table.dataTable thead th {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.dataTables_wrapper table.dataTable tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: #f9fafb;
}

.dataTables_wrapper table.dataTable tbody tr:last-child {
    border-bottom: none;
}

/* Pagination styling */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 2.5rem;
    text-align: center;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background-color: white !important;
    border-color: #e5e7eb !important;
    color: #6b7280 !important;
}

/* Info text styling */
.dataTables_wrapper .dataTables_info {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        min-width: 150px;
    }
    
    .dataTables_wrapper .dataTables_info {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        flex-wrap: wrap;
        gap: 0.125rem;
        justify-content: center;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.375rem 0.5rem;
        min-width: 2rem;
        font-size: 0.8125rem;
    }
}

/* Loading state */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #374151;
    font-weight: 500;
}

/* Kanban Card Department and Metadata Section */
.kanban-card .flex.flex-wrap.items-center.gap-1 {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.kanban-card .flex.flex-wrap.items-center.gap-1 > * {
    flex-shrink: 0;
}

/* Department badge styles */
.kanban-card .text-xs.px-2.py-0\.5.rounded-full {
    font-weight: 500;
    white-space: nowrap;
}

/* Comment and file count badge styles */
.kanban-card .flex.items-center.space-x-1 {
    align-items: center;
    white-space: nowrap;
}

/* Status colors are now dynamic and handled via inline styles */

/* Responsive adjustments for department/metadata section */
@media (max-width: 768px) {
    .kanban-card .flex.flex-wrap.items-center.gap-1 {
        gap: 0.125rem;
    }
    
    .kanban-card .text-xs.px-2.py-0\.5.rounded-full,
    .kanban-card .flex.items-center.space-x-1 {
        font-size: 0.65rem;
        padding: 0.125rem 0.375rem;
    }
}

/* Remove conflicting bottom container styling since we use specific classes */

/* Bottom controls layout improvements */
.dataTables_wrapper .dataTables_length label {
    color: #6b7280;
    font-weight: 400;
    gap: 0.25rem;
}

.dataTables_wrapper .dataTables_length label::before {
    content: "Show ";
}

.dataTables_wrapper .dataTables_length label::after {
    content: " per page";
}

.dataTables_wrapper .dataTables_length select {
    min-width: auto;
    width: auto;
    padding: 0.375rem 0.5rem;
}

/* ====================================
   SIDEBAR COLLAPSE/EXPAND STYLES
   ==================================== */

/* Sidebar base styles with transitions */
.sidebar {
    position: relative;
    transition: all 0.3s ease-in-out;
    overflow: visible;
}

/* Collapsed sidebar styles - very narrow, only showing toggle button */
.sidebar.sidebar-collapsed {
    width: 3rem !important; /* Very narrow - just enough for the toggle button */
}

/* Hide all sidebar content when collapsed */
.sidebar.sidebar-collapsed .sidebar-content {
    display: none;
}

/* Toggle button container positioning */
.sidebar-toggle-container {
    position: absolute;
    right: -1rem;
    top: 1.5rem;
    z-index: 20;
    transition: all 0.3s ease-in-out;
}

/* When collapsed, center the toggle button in the narrow sidebar */
.sidebar.sidebar-collapsed .sidebar-toggle-container {
    position: relative;
    right: auto;
    top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

/* Toggle button styles */
.sidebar-toggle-btn {
    transition: all 0.3s ease-in-out;
}

/* When collapsed, make the button more prominent */
.sidebar.sidebar-collapsed .sidebar-toggle-btn {
    width: 2rem;
    height: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Toggle button icon animation */
#toggleIcon {
    transition: transform 0.3s ease-in-out;
}

/* Main content area adjustment */
.main-content-area {
    transition: margin-left 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 40;
        transform: translateX(0);
    }
    
    .sidebar.sidebar-collapsed {
        transform: translateX(-100%);
        width: 0 !important;
    }
    
    /* Show a small toggle button at the edge when completely collapsed on mobile */
    .sidebar.sidebar-collapsed .sidebar-toggle-container {
        position: fixed;
        left: 0;
        top: 1.5rem;
        width: auto;
        height: auto;
        transform: translateX(0);
        z-index: 50;
    }
    
    .sidebar.sidebar-collapsed .sidebar-toggle-btn {
        width: 2.5rem;
        height: 2.5rem;
        margin-left: 0.5rem;
    }
}

/* Ensure smooth transitions */
.sidebar * {
    transition: all 0.3s ease-in-out;
}
