/* =========================================
   DYNAMIC THEME ENGINE DEFAULTS
   ========================================= */
:root {
    /* Default Indigo Theme */
    --theme-primary: #6a5acd;
    --theme-hover: #5a4abd;
    --theme-success: #10b981; /* Emerald 500 */
    
    /* Auto-generates the light backgrounds (e.g., bg-[#6a5acd]/10) */
    --theme-light: color-mix(in srgb, var(--theme-primary) 15%, transparent);
}

/* =========================================
   GLOBAL COMPONENT OVERRIDES
   ========================================= */
/* Force DaisyUI to use your dynamic success color */
.badge-success {
    background-color: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
    color: #ffffff !important;
}

/* Make all checkboxes follow the theme engine */
.checkbox {
    border-color: var(--theme-primary);
}

.checkbox:checked {
    background-color: var(--theme-primary) !important;
    --chkbg: var(--theme-primary);
    --chkfg: white;
}

/* Optional: Add a slight glow on hover */
.checkbox:hover {
    border-color: var(--theme-hover);
}

/* =========================================
   CUSTOM SCROLLBARS
   ========================================= */
.custom-scroll::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
}
.custom-scroll::-webkit-scrollbar-track { 
    background: transparent; 
}
.custom-scroll::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 10px; 
    border: 2px solid transparent; 
    background-clip: padding-box; 
}
/* Dark mode scrollbar support */
.dark .custom-scroll::-webkit-scrollbar-thumb {
    background: #475569;
}

/* =========================================
   LAYOUT & ANIMATIONS
   ========================================= */
/* CSS Containment for heavy grids (POS & Inventory) */
.fast-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 200px;
}

/* Smooth sidebar collapsing */
#main-sidebar { 
    transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out; 
}

/* =========================================
   SWEETALERT2 CUSTOMIZATIONS
   ========================================= */
/* Global Overrides */
.swal2-popup .swal2-confirm {
    background-color: var(--theme-primary) !important;
    border: 1px solid var(--theme-primary) !important;
    color: white !important;
    border-radius: 0.75rem !important;
    font-weight: bold !important;
    transition: filter 0.2s;
}

.swal2-popup .swal2-confirm:hover {
    filter: brightness(0.9) !important;
}

.swal2-popup .swal2-cancel {
    background-color: #ef4444 !important;
    color: white !important;
    border-radius: 0.75rem !important;
    font-weight: bold !important;
}

/* Themed Specific Classes */
.swal2-popup.theme-popup { border-radius: 2rem !important; }
.swal2-title.theme-title { color: #1e293b !important; font-weight: 900 !important; }

/* Primary Theme Button */
.swal2-confirm.theme-btn-primary {
    background-color: var(--theme-primary) !important;
    color: white !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 2rem !important;
    font-weight: bold !important;
    border: none !important;
    box-shadow: 0 10px 15px -3px var(--theme-light) !important;
    margin: 0 0.5rem !important;
}
.swal2-confirm.theme-btn-primary:hover { background-color: var(--theme-hover) !important; }

/* Danger/Delete Button */
.swal2-confirm.theme-btn-danger {
    background-color: #f43f5e !important;
    color: white !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 2rem !important;
    font-weight: bold !important;
    border: none !important;
    margin: 0 0.5rem !important;
}
.swal2-confirm.theme-btn-danger:hover { background-color: #e11d48 !important; }

/* Cancel Button */
.swal2-cancel.theme-btn-cancel {
    background-color: white !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: bold !important;
    margin: 0 0.5rem !important;
}
.swal2-cancel.theme-btn-cancel:hover { background-color: #f8fafc !important; }

/* Input Fields */
.swal2-input.theme-input {
    border-radius: 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    margin-top: 1rem !important;
}
.swal2-input.theme-input:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 1px var(--theme-primary) !important;
    outline: none !important;
}

/* =========================================
   SIDEBAR SMART TOOLTIPS
   ========================================= */
/* Hide tooltips completely when the sidebar is expanded */
#main-sidebar.w-64 .sidebar-tooltip::before,
#main-sidebar.w-64 .sidebar-tooltip::after {
    display: none !important;
    opacity: 0 !important;
}

/* Force tooltips to stay on top and match the primary theme color */
.sidebar-tooltip {
    z-index: 100 !important;
    --tooltip-color: var(--theme-primary) !important;
    --tooltip-text-color: #ffffff !important;
}