/* Admin Styles */

body {
    font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Toast Animations */
.toast-enter {
    transform: translateX(100%);
    opacity: 0;
}

.toast-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 300ms ease-out;
}

.toast-exit {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 300ms ease-in;
}

/* Sidebar Active State */
.tab-link.active {
    background-color: #4f46e5; /* indigo-600 */
    color: white;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft {
    background-color: #fef3c7; /* amber-100 */
    color: #b45309; /* amber-700 */
}

.badge-published {
    background-color: #d1fae5; /* emerald-100 */
    color: #047857; /* emerald-700 */
}

.badge-archived {
    background-color: #f1f5f9; /* slate-100 */
    color: #475569; /* slate-600 */
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

/* Flow Graph Container with Prominent, Accessible Scrollbars */
.flow-graph-container {
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #f8fafc;
    overflow: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.flow-graph-container::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

.flow-graph-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.flow-graph-container::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 7px;
    border: 3px solid #f1f5f9;
}

.flow-graph-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.flow-graph-container::-webkit-scrollbar-corner {
    background: #e2e8f0;
}

/* Collapsible Sidebars for Flow Design Floor Space Saving */
#sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#fb-node-editor.editor-collapsed {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

#fb-canvas-wrapper.canvas-full-width {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

/* Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.875rem;
}

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

/* Modal Styles */
.modal-overlay {
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

/* =========================================================================
   Mobile Responsiveness & Touch Optimization
   ========================================================================= */
@media (max-width: 768px) {
    /* Touch momentum for horizontal scrollable tables */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* Modal responsiveness on small screens */
    .modal-card, [id$="-modal"] > div, [id$="-modal-container"] > div > div {
        max-height: 92vh !important;
        width: 95% !important;
        margin: 0 auto;
    }

    /* Flow Builder Editor Layout on Mobile */
    #fb-editor-layout {
        flex-direction: column !important;
    }

    #fb-canvas-wrapper {
        width: 100% !important;
        height: 60vh !important;
        min-height: 350px !important;
    }

    #fb-node-editor {
        width: 100% !important;
        max-height: 40vh !important;
        border-left: none !important;
        border-top: 1px solid #e2e8f0 !important;
    }

    /* Floating Floor tools on mobile */
    #fb-canvas-wrapper .absolute.bottom-5.left-5 {
        left: 2 !important;
        right: 2 !important;
        bottom: 2 !important;
        padding: 0.5rem !important;
        flex-wrap: wrap !important;
    }

    /* Sidebar drawer on mobile */
    #sidebar {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }

    /* Touch targets */
    button, a.tab-link, input[type="checkbox"], input[type="button"] {
        touch-action: manipulation;
    }
}

