/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Base transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* HTMX element transition animation */
.htmx-fade-in {
    animation: htmxAppear 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes htmxAppear {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Smooth check button animation */
.task-check-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-check-btn:active {
    transform: scale(0.85);
}

.task-check-btn:hover {
    transform: scale(1.08);
}

/* Progress bar animated width */
.progress-bar-fill {
    transition: width 0.65s cubic-bezier(0.34, 1.25, 0.64, 1);
}

/* Subtle Overdue pulse */
.overdue-indicator-dot {
    position: relative;
}

.overdue-indicator-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    background-color: rgba(244, 63, 94, 0.2);
    animation: subtleGlow 3s ease-in-out infinite;
}

@keyframes subtleGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.35);
        opacity: 0.9;
    }
}

/* Custom minimal scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
}

/* Pure Pitch Black Dark Mode Styling (OLED Black) */
html.dark {
    color-scheme: dark;
    background-color: #000000 !important;
}

html.dark body {
    background-color: #000000 !important;
    color: #f4f4f5 !important;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   SMOOTH DRAG & DROP ENGINE (SORTABLEJS)
   ========================================================================== */
.column-drag-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.column-drag-handle:active {
    cursor: grabbing;
}

/* Ghost placeholder for dragged columns */
.sortable-column-ghost {
    opacity: 0.35;
    transform: scale(0.98);
    border: 2px dashed #10b981 !important;
    background: rgba(16, 185, 129, 0.04) !important;
    border-radius: 1rem !important;
}

.sortable-column-chosen {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.sortable-column-drag {
    opacity: 0.95;
    transform: rotate(0.5deg);
}

/* Ghost placeholder for dragged tasks */
.task-drag-ghost {
    opacity: 0.4;
    border: 2px dashed #10b981 !important;
    background: rgba(16, 185, 129, 0.04) !important;
    border-radius: 0.75rem !important;
}

/* ==========================================================================
   MODAL & DIALOG LAYER SYSTEM
   ========================================================================== */
/* Modal Dialog Layer (Luôn nằm trên cùng, không bị bất kỳ thành phần nào đè) */
[role="dialog"] {
    z-index: 9999 !important;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENGINE (Màn hình < 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
    #app-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 18rem !important; /* 288px drawer */
        max-width: 85vw !important;
        z-index: 50 !important;
    }
}


