/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Kanban Board Styles */
.kanban-column {
    min-height: 150px;
    transition: background-color 0.2s ease;
}
.kanban-drop-zone.drag-over {
    background-color: #f1f5f9 !important;
    border-color: #6366f1 !important;
    border-style: dashed !important;
}
.task-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.task-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

/* Sidebar Transitions */
.sidebar-hidden {
    transform: translateX(-100%);
}
.sidebar-visible {
    transform: translateX(0);
}

/* Issue 6 fix: Tailwind CDN classes (e.g. `hidden`) have higher specificity than
   custom media queries. Use !important here to ensure sidebar is always visible
   on desktop regardless of any Tailwind utility class applied. */
@media (min-width: 768px) {
    #sidebar {
        transform: translateX(0) !important;
        position: sticky !important;
        display: flex !important;
    }
    .sidebar-hidden {
        transform: translateX(0) !important;
    }
    /* Mobile header should be hidden on desktop */
    header.md\:hidden {
        display: none !important;
    }
}

/* Sidebar overlay */
#sidebar-overlay.active {
    display: block;
}

/* Toast Notification — positioned at TOP to avoid being covered by modal footer/overlay */
#toast {
    visibility: hidden;
    pointer-events: none;       /* not clickable when hidden */
    min-width: 300px;
    max-width: 90vw;
    background-color: #1f2937;
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    position: fixed;
    z-index: 99999;             /* above everything: modal (z-50), sidebar overlay, etc. */
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    top: 24px;                  /* top of screen — never covered by modal footer */
    font-size: 14px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
#toast.show {
    visibility: visible;
    pointer-events: auto;       /* CRITICAL: buttons inside toast become clickable */
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Status Option Selection */
.status-option.selected {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

/* Mobile RWD — Issue 6 fix: use !important to override Tailwind CDN specificity */
@media (max-width: 767px) {
    #main-content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    /* Board view horizontal scroll on mobile */
    #view-board {
        padding-bottom: 16px;
    }
    /* List/Archive tables scroll horizontally on mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    /* Modal full-width on mobile */
    #task-modal > div {
        margin: 0 !important;
        max-height: 100dvh !important;
        border-radius: 16px 16px 0 0 !important;
    }
    /* Add-task modal full-width on mobile */
    #add-task-modal > div {
        margin: 0 !important;
        max-height: 100dvh !important;
        border-radius: 16px 16px 0 0 !important;
        align-self: flex-end;
    }
}

/* Custom Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}
.animate-pulse-subtle {
    animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}