/* E Travel Solutions - Loco.rs + HTMX Modern Stylesheet */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --accent: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-page: #f8fafc;
    --card-border: #e2e8f0;
}

body {
    background-color: var(--bg-page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

/* HTMX Indicator & Progress Bar */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
    z-index: 9999;
    transition: width 250ms ease-out, opacity 350ms;
}

.htmx-request #top-progress-bar {
    width: 75%;
    opacity: 1;
}

/* ==========================================================================
   Responsive Mobile Navigation Drawer & Backdrop
   ========================================================================== */

#sidebar-backdrop {
    display: none;
}

@media (max-width: 767.98px) {
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        inset-inline-start: 0 !important;
        height: 100% !important;
        z-index: 50 !important;
        width: 17rem !important;
        max-width: calc(100vw - 3rem) !important;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
    }

    [dir="rtl"] #sidebar {
        transform: translateX(100%);
    }

    body.sidebar-open #sidebar {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    #sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.sidebar-open #sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden !important;
    }
}

@media (min-width: 768px) {
    #sidebar {
        transform: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Modal Overlay & Animation */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 150ms ease-out;
}

.modal-content {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 38rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleUp 150ms ease-out;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-content {
        max-height: 94vh;
        border-radius: 0.5rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Touch Scrolling */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Kanban Board Columns */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    min-height: calc(100vh - 200px);
    -webkit-overflow-scrolling: touch;
}

.kanban-column {
    flex: 0 0 300px;
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

@media (max-width: 640px) {
    .kanban-column {
        flex: 0 0 min(290px, 82vw);
    }
}

.kanban-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: transform 150ms, box-shadow 150ms;
    cursor: grab;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-green { background-color: #d1fae5; color: #065f46; }
.badge-yellow { background-color: #fef3c7; color: #92400e; }
.badge-red { background-color: #fee2e2; color: #991b1b; }
.badge-gray { background-color: #f1f5f9; color: #475569; }
.badge-purple { background-color: #f3e8ff; color: #6b21a8; }
.badge-cyan { background-color: #cffafe; color: #155e75; }

/* Interactive Table Hover */
.table-interactive tbody tr {
    transition: background-color 100ms;
}

.table-interactive tbody tr:hover {
    background-color: #f8fafc;
}

/* Tab active state */
.tab-active {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}
