/* Custom CSS for Rayan Enterprise Multi-Business Website & POS */

:root {
    --brand-blue: #00457A;
    --brand-blue-dark: #072C4C;
    --brand-green: #25AD49;
    --brand-green-hover: #1E9E43;
    --brand-teal: #19A39E;
    --brand-bg-light: #F4F8FA;
    --brand-text-dark: #0E3144;

    /* Five Business Division Theme Tokens */
    --theme-pharmacy: #10B981;
    --theme-pharmacy-dark: #064E3B;
    --theme-pharmacy-glow: rgba(16, 185, 129, 0.25);

    --theme-garments: #06B6D4;
    --theme-garments-dark: #164E63;
    --theme-garments-glow: rgba(6, 182, 212, 0.25);

    --theme-less-peco: #F59E0B;
    --theme-less-peco-dark: #78350F;
    --theme-less-peco-glow: rgba(245, 158, 11, 0.25);

    --theme-cosmetics: #F43F5E;
    --theme-cosmetics-dark: #881337;
    --theme-cosmetics-glow: rgba(244, 63, 94, 0.25);

    --theme-clothes: #6366F1;
    --theme-clothes-dark: #312E81;
    --theme-clothes-glow: rgba(99, 102, 241, 0.25);
}

.bg-brand-blue { background-color: var(--brand-blue); }
.bg-brand-blue-dark { background-color: var(--brand-blue-dark); }
.bg-brand-green { background-color: var(--brand-green); }
.bg-brand-teal { background-color: var(--brand-teal); }
.text-brand-blue { color: var(--brand-blue); }
.text-brand-green { color: var(--brand-green); }
.text-brand-teal { color: var(--brand-teal); }
.border-brand-blue { border-color: var(--brand-blue); }
.border-brand-green { border-color: var(--brand-green); }
.border-brand-teal { border-color: var(--brand-teal); }

/* ==========================================================
   UI / UX ELEVATION: CARD HOVER, GLOWS & SMOOTH TRANSITIONS
   ========================================================== */

/* Universal smooth card hover lift */
.card-hover-lift {
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.15s ease;
    will-change: transform, box-shadow;
}

.card-hover-lift:hover {
    transform: translateY(-5px);
}

/* Division-specific hover glow accents */
.hover-glow-pharmacy:hover {
    box-shadow: 0 16px 32px -8px var(--theme-pharmacy-glow);
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.hover-glow-garments:hover {
    box-shadow: 0 16px 32px -8px var(--theme-garments-glow);
    border-color: rgba(6, 182, 212, 0.5) !important;
}

.hover-glow-amber:hover {
    box-shadow: 0 16px 32px -8px var(--theme-less-peco-glow);
    border-color: rgba(245, 158, 11, 0.5) !important;
}

.hover-glow-rose:hover {
    box-shadow: 0 16px 32px -8px var(--theme-cosmetics-glow);
    border-color: rgba(244, 63, 94, 0.5) !important;
}

.hover-glow-indigo:hover {
    box-shadow: 0 16px 32px -8px var(--theme-clothes-glow);
    border-color: rgba(99, 102, 241, 0.5) !important;
}

/* Product Card Image Container */
.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #030712;
    border: 1px solid rgba(51, 65, 85, 0.6);
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .product-image-container img {
    transform: scale(1.05);
}

/* Hero Storefront Image Card */
.storefront-hero-frame {
    position: relative;
    width: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.storefront-hero-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.storefront-hero-frame:hover img {
    transform: scale(1.03);
}

/* Glassmorphic elements */
.glass-panel {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-pill {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Subtle pulsating live dot */
@keyframes subtlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.animate-subtle-pulse {
    animation: subtlePulse 2s ease-in-out infinite;
}

/* Text Truncation Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scanner flash animation */
@keyframes scanHighlight {
    0% { background-color: rgba(16, 185, 129, 0.35); transform: scale(1.008); }
    100% { background-color: transparent; transform: scale(1); }
}

.row-scan-highlight {
    animation: scanHighlight 0.25s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.8);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 1);
}

/* Light Theme Scrollbars */
html.light-theme ::-webkit-scrollbar-track {
    background: #F1F5F9;
}
html.light-theme ::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
html.light-theme ::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Dedicated High-Contrast Vertical Scrollbar for Admin Sidebar */
#sidebar-menu {
    overflow-y: scroll !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin !important;
    scrollbar-color: #475569 #0f172a !important;
}

#sidebar-menu::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
    display: block !important;
}

#sidebar-menu::-webkit-scrollbar-track {
    background: #0b132b !important;
    border-left: 1px solid rgba(51, 65, 85, 0.35) !important;
}

#sidebar-menu::-webkit-scrollbar-thumb {
    background: #334155 !important;
    border-radius: 6px !important;
    border: 1.5px solid #0b132b !important;
}

#sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Light Theme Admin Sidebar Scrollbar */
html.light-theme #sidebar-menu {
    scrollbar-color: #94a3b8 #f8fafc !important;
}

html.light-theme #sidebar-menu::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

html.light-theme #sidebar-menu::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 6px !important;
    border: 1.5px solid #f8fafc !important;
}

html.light-theme #sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Visible, High-Contrast Vertical Scrollbar for Main Admin Content Area */
main,
.admin-main-scroll {
    display: block !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin !important;
    scrollbar-color: #475569 #0f172a !important;
}

main::-webkit-scrollbar,
.admin-main-scroll::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
    display: block !important;
}

main::-webkit-scrollbar-track,
.admin-main-scroll::-webkit-scrollbar-track {
    background: #0b132b !important;
    border-left: 1px solid rgba(51, 65, 85, 0.35) !important;
}

main::-webkit-scrollbar-thumb,
.admin-main-scroll::-webkit-scrollbar-thumb {
    background: #334155 !important;
    border-radius: 6px !important;
    border: 2px solid #0b132b !important;
}

main::-webkit-scrollbar-thumb:hover,
.admin-main-scroll::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Light Theme Main Content Scrollbar */
html.light-theme main,
html.light-theme .admin-main-scroll {
    scrollbar-color: #94a3b8 #f1f5f9 !important;
}

html.light-theme main::-webkit-scrollbar-track,
html.light-theme .admin-main-scroll::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

html.light-theme main::-webkit-scrollbar-thumb,
html.light-theme .admin-main-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 6px !important;
    border: 2px solid #f8fafc !important;
}

html.light-theme main::-webkit-scrollbar-thumb:hover,
html.light-theme .admin-main-scroll::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Dedicated High-Contrast Vertical Scrollbar for Inventory Data Tables */
.table-scrollbar {
    overflow-y: scroll !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin !important;
    scrollbar-color: #475569 #0b132b !important;
}

.table-scrollbar::-webkit-scrollbar {
    width: 9px !important;
    height: 9px !important;
    display: block !important;
}

.table-scrollbar::-webkit-scrollbar-track {
    background: #0b132b !important;
    border-left: 1px solid rgba(51, 65, 85, 0.4) !important;
}

.table-scrollbar::-webkit-scrollbar-thumb {
    background: #334155 !important;
    border-radius: 6px !important;
    border: 2px solid #0b132b !important;
}

.table-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Light Theme Table Scrollbar */
html.light-theme .table-scrollbar {
    scrollbar-color: #94a3b8 #f1f5f9 !important;
}

html.light-theme .table-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

html.light-theme .table-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 6px !important;
    border: 2px solid #f8fafc !important;
}

html.light-theme .table-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #059669 !important;
}

/* Sticky Data Table Headers */
.table-scrollbar table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.table-scrollbar table thead th {
    background-color: #020617 !important;
}

html.light-theme .table-scrollbar table thead th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

/* Print Styles for Receipts */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-area, #printable-area * {
        visibility: visible;
    }
    #printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
}

/* Thermal 80mm & 58mm sizing */
.receipt-80mm {
    width: 76mm;
    max-width: 76mm;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #000;
    font-size: 12px;
    line-height: 1.3;
}

.receipt-58mm {
    width: 48mm;
    max-width: 48mm;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #000;
    font-size: 10px;
    line-height: 1.25;
}

/* ==========================================================
   UNIVERSAL THEME SYSTEM: SMOOTH TRANSITIONS & LOGO SWITCHING
   ========================================================== */

body, header, nav, aside, main, footer, 
.card-hover-lift, .glass-panel, input, textarea, select, table {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Automatic logo switching based on theme */
html.light-theme .brand-logo-dark {
    display: none !important;
}
html.light-theme .brand-logo-light {
    display: inline-block !important;
}
html:not(.light-theme) .brand-logo-dark {
    display: inline-block !important;
}
html:not(.light-theme) .brand-logo-light {
    display: none !important;
}

/* Universal Horizontal Scrollbar Prevention */
html, body {
    max-width: 100vw;
    overflow-x: clip;
}
@supports not (overflow-x: clip) {
    html, body {
        overflow-x: hidden;
    }
}

/* Theme toggle button interactive styling */
.theme-toggle-btn {
    cursor: pointer;
    user-select: none;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle-btn:hover {
    transform: scale(1.06);
}
.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* ==========================================================
   LIGHT THEME OVERRIDES (html.light-theme)
   ========================================================== */

html.light-theme,
html.light-theme body {
    background-color: #F8FAFC !important;
    color: #0F172A !important;
}

/* Header & Nav */
html.light-theme nav,
html.light-theme header#admin-topbar,
html.light-theme header#pos-top-bar,
html.light-theme nav.sticky {
    background-color: rgba(255, 255, 255, 0.96) !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Top Announcement Bar */
html.light-theme .bg-slate-950.text-slate-400 {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border-color: #E2E8F0 !important;
}

/* Public Nav Links */
html.light-theme nav a {
    color: #334155;
}
html.light-theme nav a:hover {
    color: #0F172A;
    background-color: #F1F5F9;
}
html.light-theme nav a.text-amber-400 {
    color: #B45309 !important;
}
html.light-theme nav a.text-emerald-400 {
    color: #059669 !important;
}
html.light-theme nav a.text-cyan-400 {
    color: #0891B2 !important;
}
html.light-theme nav a.text-rose-400 {
    color: #E11D48 !important;
}
html.light-theme nav a.text-indigo-400 {
    color: #4F46E5 !important;
}

/* Mega Menu Dropdown & Mobile Drawer */
html.light-theme #mobile-nav-drawer,
html.light-theme .bg-\[\#0A2238\] {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.light-theme .bg-slate-900\/80,
html.light-theme .bg-slate-900\/60,
html.light-theme .bg-slate-900\/40,
html.light-theme #mobile-nav-drawer a {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
    color: #1E293B !important;
}
html.light-theme #mobile-nav-drawer a:hover {
    background-color: #EFF6FF !important;
}

/* Hero Sections & Public Page Background Gradients */
html.light-theme section[class*="bg-gradient-"],
html.light-theme section.bg-gradient-to-b,
html.light-theme section.bg-\[\#04121D\],
html.light-theme section.bg-\[\#030F18\],
html.light-theme section#lookbook,
html.light-theme #lookbook,
html.light-theme .bg-\[\#04121D\],
html.light-theme .bg-\[\#030F18\],
html.light-theme section.bg-\[\#051420\],
html.light-theme section.bg-\[\#071C2C\],
html.light-theme section.bg-\[\#072C4C\],
html.light-theme section.bg-\[\#041B1F\],
html.light-theme section.bg-\[\#031B28\],
html.light-theme section.bg-\[\#251A07\],
html.light-theme section.bg-\[\#280512\],
html.light-theme section.bg-\[\#090C28\],
html.light-theme .bg-\[\#071C2C\],
html.light-theme .bg-\[\#051420\],
html.light-theme .bg-\[\#072C4C\] {
    background-image: none !important;
    background: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

html.light-theme .border-slate-800,
html.light-theme .border-slate-800\/90,
html.light-theme .border-slate-800\/80,
html.light-theme .border-slate-800\/60,
html.light-theme .border-slate-800\/40 {
    border-color: #E2E8F0 !important;
}

/* Lookbook Tabs in Light Mode */
html.light-theme .lookbook-tab {
    color: #475569 !important;
}
html.light-theme .lookbook-tab:hover {
    color: #0F172A !important;
    background-color: #F1F5F9 !important;
}
html.light-theme .lookbook-tab.bg-emerald-500\/20,
html.light-theme .lookbook-tab[class*="bg-emerald-"] {
    background-color: #ECFDF5 !important;
    color: #047857 !important;
    border-color: #A7F3D0 !important;
}

/* Neutralize Dark Gradients on Cards, Banners & Panels in Light Mode (Preserving Action Buttons & CTAs) */
html.light-theme [class*="bg-gradient-"]:not(.bg-clip-text):not(a.bg-gradient-to-r):not(.absolute):not(button):not([type="button"]):not([type="submit"]):not(.btn-shimmer):not(#btn-scan):not(.btn-scan-primary) {
    background-image: none !important;
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

/* Ensure Action Buttons and Scan CTAs Retain Vibrant Color and White Text in Light Theme */
html.light-theme button[class*="bg-gradient-"],
html.light-theme [type="button"][class*="bg-gradient-"],
html.light-theme [type="submit"][class*="bg-gradient-"],
html.light-theme a.btn-shimmer,
html.light-theme button.btn-shimmer,
html.light-theme #btn-scan,
html.light-theme .btn-scan-primary {
    color: #FFFFFF !important;
}

html.light-theme button[class*="bg-gradient-"] *,
html.light-theme [type="button"][class*="bg-gradient-"] *,
html.light-theme [type="submit"][class*="bg-gradient-"] *,
html.light-theme a.btn-shimmer *,
html.light-theme button.btn-shimmer *,
html.light-theme #btn-scan *,
html.light-theme .btn-scan-primary * {
    color: #FFFFFF !important;
}

html.light-theme #btn-scan svg,
html.light-theme .btn-scan-primary svg {
    color: #A7F3D0 !important;
}
html.light-theme .absolute[class*="bg-gradient-"],
html.light-theme .product-image-container [class*="bg-gradient-"],
html.light-theme .storefront-hero-frame [class*="bg-gradient-"] {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Specific Card & Panel Overrides */
html.light-theme .bg-slate-900\/95,
html.light-theme .bg-slate-900\/90,
html.light-theme .bg-slate-900\/80,
html.light-theme .bg-slate-900\/60,
html.light-theme .bg-slate-900\/40,
html.light-theme .bg-slate-900,
html.light-theme .bg-slate-950,
html.light-theme .bg-slate-950\/90,
html.light-theme .bg-slate-950\/80,
html.light-theme .bg-slate-950\/70,
html.light-theme .bg-slate-950\/60,
html.light-theme .bg-slate-950\/40 {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02) !important;
}

/* Secondary Buttons, Badges, Filter Bars & kbd Keys */
html.light-theme .bg-slate-800,
html.light-theme .bg-slate-800\/90,
html.light-theme .bg-slate-800\/80,
html.light-theme .bg-slate-800\/70,
html.light-theme .bg-slate-800\/60,
html.light-theme .bg-slate-800\/50,
html.light-theme .bg-slate-800\/40,
html.light-theme .bg-slate-800\/30,
html.light-theme .bg-slate-800\/20,
html.light-theme kbd {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
}

html.light-theme .bg-slate-800:hover,
html.light-theme a.bg-slate-800:hover,
html.light-theme button.bg-slate-800:hover,
html.light-theme .hover\:bg-slate-800:hover,
html.light-theme .hover\:bg-slate-800\/80:hover,
html.light-theme .hover\:bg-slate-800\/60:hover,
html.light-theme .hover\:bg-slate-800\/40:hover,
html.light-theme .hover\:bg-slate-700:hover,
html.light-theme .hover\:bg-slate-900:hover,
html.light-theme .hover\:bg-slate-950:hover,
html.light-theme label.hover\:bg-slate-900:hover,
html.light-theme div.hover\:bg-slate-900:hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}

/* Storefront Hero Photo Frame */
html.light-theme .storefront-hero-frame {
    border-color: #CBD5E1 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
}
html.light-theme .storefront-hero-frame .p-5,
html.light-theme .storefront-hero-frame .bg-slate-900\/95 {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

/* Text Hierarchy in Light Mode */
html.light-theme .text-white {
    color: #0F172A !important;
}
html.light-theme .text-slate-100 {
    color: #0F172A !important;
}
html.light-theme .text-slate-200 {
    color: #1E293B !important;
}
html.light-theme .text-slate-300 {
    color: #334155 !important;
}
html.light-theme .text-slate-400 {
    color: #475569 !important;
}
html.light-theme .text-slate-500 {
    color: #64748B !important;
}

/* Accessible High-Contrast Brand Colors in Light Mode */
html.light-theme .text-emerald-100,
html.light-theme .text-emerald-200,
html.light-theme .text-emerald-300 {
    color: #047857 !important;
}
html.light-theme .text-emerald-400,
html.light-theme .text-emerald-500 {
    color: #059669 !important;
}

html.light-theme .text-cyan-100,
html.light-theme .text-cyan-200,
html.light-theme .text-cyan-300 {
    color: #0E7490 !important;
}
html.light-theme .text-cyan-400,
html.light-theme .text-cyan-500 {
    color: #0891B2 !important;
}

html.light-theme .text-amber-100,
html.light-theme .text-amber-200,
html.light-theme .text-amber-300 {
    color: #92400E !important;
}
html.light-theme .text-amber-400,
html.light-theme .text-amber-500 {
    color: #B45309 !important;
}

html.light-theme .text-rose-100,
html.light-theme .text-rose-200,
html.light-theme .text-rose-300,
html.light-theme .text-red-100,
html.light-theme .text-red-200,
html.light-theme .text-red-300 {
    color: #9F1239 !important;
}
html.light-theme .text-rose-400,
html.light-theme .text-rose-500 {
    color: #BE123C !important;
}
html.light-theme .text-red-400,
html.light-theme .text-red-500 {
    color: #DC2626 !important;
}

html.light-theme .text-indigo-100,
html.light-theme .text-indigo-200,
html.light-theme .text-indigo-300,
html.light-theme [class*="text-indigo-300"],
html.light-theme [class*="text-indigo-400"] {
    color: #3730A3 !important;
}
html.light-theme .text-indigo-400,
html.light-theme .text-indigo-500 {
    color: #4338CA !important;
}

html.light-theme [class*="text-emerald-300"],
html.light-theme [class*="text-emerald-400"] {
    color: #047857 !important;
}

html.light-theme [class*="text-rose-300"],
html.light-theme [class*="text-rose-400"] {
    color: #BE123C !important;
}

html.light-theme [class*="text-amber-300"],
html.light-theme [class*="text-amber-400"] {
    color: #92400E !important;
}

html.light-theme .text-violet-100,
html.light-theme .text-violet-200,
html.light-theme .text-violet-300,
html.light-theme .text-purple-100,
html.light-theme .text-purple-200,
html.light-theme .text-purple-300 {
    color: #5B21B6 !important;
}
html.light-theme .text-violet-400,
html.light-theme .text-purple-400 {
    color: #6D28D9 !important;
}

html.light-theme .text-teal-200,
html.light-theme .text-teal-300 {
    color: #0F766E !important;
}
html.light-theme .text-teal-400 {
    color: #0D9488 !important;
}

html.light-theme .text-yellow-200,
html.light-theme .text-yellow-300 {
    color: #92400E !important;
}
html.light-theme .text-yellow-400 {
    color: #B45309 !important;
}

html.light-theme .text-blue-200,
html.light-theme .text-blue-300 {
    color: #1D4ED8 !important;
}
html.light-theme .text-blue-400 {
    color: #2563EB !important;
}

/* Division & Status Badges in Light Mode */
html.light-theme .bg-emerald-500\/10,
html.light-theme .bg-emerald-500\/20 {
    background-color: #ECFDF5 !important;
    border-color: #A7F3D0 !important;
    color: #047857 !important;
}
html.light-theme .bg-cyan-500\/10,
html.light-theme .bg-cyan-500\/20 {
    background-color: #ECFEFF !important;
    border-color: #A5F3FC !important;
    color: #0E7490 !important;
}
html.light-theme .bg-amber-500\/10,
html.light-theme .bg-amber-500\/20 {
    background-color: #FFFBEB !important;
    border-color: #FDE68A !important;
    color: #92400E !important;
}
html.light-theme .bg-rose-500\/10,
html.light-theme .bg-rose-500\/20 {
    background-color: #FFF1F2 !important;
    border-color: #FECDD3 !important;
    color: #9F1239 !important;
}
html.light-theme .bg-indigo-500\/10,
html.light-theme .bg-indigo-500\/20 {
    background-color: #EEF2FF !important;
    border-color: #C7D2FE !important;
    color: #3730A3 !important;
}
html.light-theme .bg-violet-500\/10,
html.light-theme .bg-violet-500\/20 {
    background-color: #F5F3FF !important;
    border-color: #DDD6FE !important;
    color: #6D28D9 !important;
}

/* Alert Boxes & Critical Notification Banners */
html.light-theme .bg-rose-950\/40,
html.light-theme .bg-rose-950\/60,
html.light-theme .bg-red-950\/40,
html.light-theme .bg-red-950\/60,
html.light-theme .bg-red-900\/40 {
    background-color: #FFF1F2 !important;
    border-color: #FECDD3 !important;
    color: #9F1239 !important;
}
html.light-theme .bg-rose-950\/40 *,
html.light-theme .bg-rose-950\/60 *,
html.light-theme .bg-red-950\/40 *,
html.light-theme .bg-red-950\/60 * {
    color: #9F1239 !important;
}

html.light-theme .bg-amber-950\/40,
html.light-theme .bg-amber-950\/60,
html.light-theme .bg-yellow-950\/40 {
    background-color: #FFFBEB !important;
    border-color: #FDE68A !important;
    color: #92400E !important;
}
html.light-theme .bg-amber-950\/40 *,
html.light-theme .bg-amber-950\/60 * {
    color: #92400E !important;
}

html.light-theme .bg-emerald-950\/40,
html.light-theme .bg-emerald-950\/60,
html.light-theme .bg-green-950\/40 {
    background-color: #ECFDF5 !important;
    border-color: #A7F3D0 !important;
    color: #065F46 !important;
}
html.light-theme .bg-emerald-950\/40 *,
html.light-theme .bg-emerald-950\/60 * {
    color: #065F46 !important;
}

html.light-theme .bg-cyan-950\/40,
html.light-theme .bg-cyan-950\/60,
html.light-theme .bg-cyan-950\/80 {
    background-color: #ECFEFF !important;
    border-color: #A5F3FC !important;
    color: #0E7490 !important;
}
html.light-theme .bg-cyan-950\/40 *,
html.light-theme .bg-cyan-950\/60 *,
html.light-theme .bg-cyan-950\/80 * {
    color: #0E7490 !important;
}

html.light-theme .bg-indigo-950\/40,
html.light-theme .bg-indigo-950\/60 {
    background-color: #EEF2FF !important;
    border-color: #C7D2FE !important;
    color: #3730A3 !important;
}
html.light-theme .bg-indigo-950\/40 *,
html.light-theme .bg-indigo-950\/60 * {
    color: #3730A3 !important;
}

/* Universal Borders */
html.light-theme .border-slate-800,
html.light-theme .border-slate-800\/90,
html.light-theme .border-slate-800\/80,
html.light-theme .border-slate-800\/60,
html.light-theme .border-slate-800\/50,
html.light-theme .border-slate-700,
html.light-theme .border-slate-700\/80,
html.light-theme .border-slate-700\/60,
html.light-theme .border-slate-700\/50,
html.light-theme .divide-slate-800\/50 > :not([hidden]) ~ :not([hidden]),
html.light-theme .divide-slate-800 > :not([hidden]) ~ :not([hidden]) {
    border-color: #E2E8F0 !important;
}

/* Form Inputs, Textareas, Search Bars & Selects */
html.light-theme input,
html.light-theme textarea,
html.light-theme select {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}
html.light-theme select option {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
}
html.light-theme input::placeholder,
html.light-theme textarea::placeholder {
    color: #94A3B8 !important;
}
html.light-theme input:focus,
html.light-theme textarea:focus,
html.light-theme select:focus {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Footer in Light Mode */
html.light-theme footer {
    background-color: #F1F5F9 !important;
    border-color: #E2E8F0 !important;
    color: #475569 !important;
}
html.light-theme footer .bg-\[\#030d15\] {
    background-color: #E2E8F0 !important;
    border-color: #CBD5E1 !important;
}
html.light-theme footer strong,
html.light-theme footer h4 {
    color: #0F172A !important;
}
html.light-theme footer ul li a {
    color: #475569 !important;
}
html.light-theme footer ul li a:hover {
    color: #0F172A !important;
}

/* Admin Sidebar in Light Mode */
html.light-theme aside#sidebar-menu {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03) !important;
}
html.light-theme aside#sidebar-menu a {
    color: #475569 !important;
}
html.light-theme aside#sidebar-menu a:hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}
html.light-theme aside#sidebar-menu a.bg-emerald-500\/10 {
    background-color: #ECFDF5 !important;
    color: #047857 !important;
    font-weight: 700 !important;
}
html.light-theme aside#sidebar-menu .text-slate-500 {
    color: #64748B !important;
}

/* Admin Main Content & Tables */
html.light-theme main {
    background-color: #F8FAFC !important;
}
html.light-theme table {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}
html.light-theme thead th,
html.light-theme thead,
html.light-theme th {
    background-color: #F1F5F9 !important;
    color: #334155 !important;
    font-weight: 700 !important;
    border-color: #E2E8F0 !important;
}
html.light-theme tbody td,
html.light-theme td {
    color: #1E293B !important;
    border-color: #F1F5F9 !important;
}
html.light-theme tbody tr:hover td,
html.light-theme tbody tr:hover {
    background-color: #F8FAFC !important;
}

/* Pharmacy Medicine Catalog Table Visibility & Scroll Protection */
#medicine-catalog-table {
    display: block !important;
    width: 100% !important;
    min-height: 420px !important;
}

#medicine-catalog-table > div.overflow-x-auto,
.medicine-catalog-scroll-wrapper {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
}

html.light-theme #medicine-catalog-table {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

html.light-theme #medicine-catalog-table table {
    background-color: #FFFFFF !important;
}

html.light-theme #medicine-catalog-table tbody tr {
    border-color: #F1F5F9 !important;
}

html.light-theme #medicine-catalog-table tbody tr:hover {
    background-color: #F8FAFC !important;
}

html.light-theme #medicine-catalog-table tbody td {
    color: #1E293B !important;
}

/* POS Terminal in Light Mode */
html.light-theme #pos-top-bar {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}
html.light-theme #pos-top-bar button {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #334155 !important;
}
html.light-theme #pos-top-bar button:hover {
    background-color: #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme #pos-main-container,
html.light-theme #pos-cart-panel,
html.light-theme #pos-products-grid {
    background-color: #F8FAFC !important;
}
html.light-theme .pos-cart-row {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}
html.light-theme .rack-card-box,
html.light-theme .shelf-1,
html.light-theme .shelf-2,
html.light-theme .shelf-3 {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

/* Modals & Dialogs in Light Mode */
html.light-theme .pos-modal > div,
html.light-theme #add-customer-modal > div,
html.light-theme #shortcuts-modal > div,
html.light-theme #add-supplier-modal > div,
html.light-theme #pay-supplier-modal > div,
html.light-theme #store-arrangement-modal > div,
html.light-theme #quick-payment-modal > div,
html.light-theme #hold-cart-modal > div,
html.light-theme #recall-cart-modal > div,
html.light-theme #sale-receipt-modal > div,
html.light-theme #expired-block-modal > div,
html.light-theme #modal-batch-selection > div {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2) !important;
    color: #0F172A !important;
}

/* Theme Toggle Button Styling */
html.light-theme .theme-toggle-btn {
    background-color: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    color: #4F46E5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}
html.light-theme .theme-toggle-btn:hover {
    background-color: #F8FAFC !important;
    border-color: #6366F1 !important;
    color: #4338CA !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15) !important;
}
html:not(.light-theme) .theme-toggle-btn {
    background-color: #0F172A !important;
    border: 1.5px solid #334155 !important;
    color: #FBBF24 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
html:not(.light-theme) .theme-toggle-btn:hover {
    background-color: #1E293B !important;
    border-color: #F59E0B !important;
    color: #FDE68A !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
}

/* ==========================================================================
   ULTRA-PREMIUM MEDICAL HOLOGRAPHIC SCANNER & OCR ANIMATIONS
   ========================================================================== */

/* Primary Dual-Laser Scanning Beam */
@keyframes scanLaserSweep {
    0% {
        top: 2%;
        opacity: 0.6;
        box-shadow: 0 0 10px #06b6d4, 0 0 20px #10b981, 0 0 35px rgba(6, 182, 212, 0.7);
    }
    50% {
        top: 94%;
        opacity: 1;
        box-shadow: 0 0 15px #38bdf8, 0 0 30px #10b981, 0 0 50px rgba(56, 189, 248, 0.9);
    }
    100% {
        top: 2%;
        opacity: 0.6;
        box-shadow: 0 0 10px #06b6d4, 0 0 20px #10b981, 0 0 35px rgba(6, 182, 212, 0.7);
    }
}

.scanner-laser-beam {
    animation: scanLaserSweep 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    will-change: top, opacity, box-shadow;
}

/* Secondary High-Tech Cyan Scanline Overlay */
@keyframes scanLineDrift {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(1000%); }
}

.scanner-raster-scanlines {
    background: repeating-linear-gradient(
        0deg,
        rgba(6, 182, 212, 0.04) 0px,
        rgba(6, 182, 212, 0.04) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
}

/* Rotating HUD Reticle */
@keyframes reticleSpinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes reticleSpinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.animate-spin-reticle {
    animation: reticleSpinSlow 14s linear infinite;
}

.animate-spin-reticle-reverse {
    animation: reticleSpinReverse 9s linear infinite;
}

/* HUD Target Lock Pulse */
@keyframes reticleTargetPulse {
    0%, 100% {
        transform: scale(1);
        border-color: rgba(6, 182, 212, 0.8);
        box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
    }
    50% {
        transform: scale(1.08);
        border-color: rgba(16, 185, 129, 0.9);
        box-shadow: 0 0 22px rgba(16, 185, 129, 0.7);
    }
}

.scanner-target-lock {
    animation: reticleTargetPulse 1.8s ease-in-out infinite;
}

/* OCR Bounding Box Glow */
@keyframes ocrBoxFlash {
    0%, 100% {
        border-color: rgba(56, 189, 248, 0.7);
        background-color: rgba(56, 189, 248, 0.08);
    }
    50% {
        border-color: rgba(52, 211, 153, 0.9);
        background-color: rgba(52, 211, 153, 0.16);
    }
}

.ocr-bounding-box {
    animation: ocrBoxFlash 2.2s ease-in-out infinite;
    backdrop-filter: blur(1px);
}

/* Radar Wave Ring */
@keyframes radarWaveExpand {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.radar-wave-ring {
    animation: radarWaveExpand 2.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

/* ==========================================================================
   SITEWIDE PROFESSIONAL ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* 1. Page Content Reveal & Cascading Staggers */
@keyframes pageRevealUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-reveal {
    animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-1 { animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) 0.02s both; }
.stagger-2 { animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both; }
.stagger-3 { animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both; }
.stagger-4 { animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both; }
.stagger-5 { animation: pageRevealUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both; }

/* 2. Interactive Button Shimmer Sweep */
@keyframes btnShimmerSweep {
    0% {
        transform: translateX(-150%) skewX(-20deg);
    }
    30%, 100% {
        transform: translateX(250%) skewX(-20deg);
    }
}

.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.0) 35%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.0) 65%,
        transparent 100%
    );
    transform: translateX(-150%) skewX(-20deg);
    animation: btnShimmerSweep 5s ease-in-out infinite;
    pointer-events: none;
}

.btn-shimmer:hover::after {
    animation: btnShimmerSweep 1.6s ease-in-out infinite;
}

/* 3. Barcode Laser Input Flash */
@keyframes barcodeInputFlash {
    0% {
        border-color: rgba(16, 185, 129, 0.9);
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35), 0 0 20px rgba(16, 185, 129, 0.5);
    }
    50% {
        border-color: rgba(56, 189, 248, 1);
        box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.45), 0 0 30px rgba(56, 189, 248, 0.7);
    }
    100% {
        border-color: rgba(16, 185, 129, 0.6);
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
    }
}

.barcode-scan-flash {
    animation: barcodeInputFlash 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4. Ambient Live Breathing Glow */
@keyframes ambientBreatheGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.65), 0 0 4px rgba(16, 185, 129, 0.9);
    }
}

.badge-glow-emerald {
    animation: ambientBreatheGlow 2.5s ease-in-out infinite;
}

@keyframes ambientBreatheCyan {
    0%, 100% {
        box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.65), 0 0 4px rgba(6, 182, 212, 0.9);
    }
}

.badge-glow-cyan {
    animation: ambientBreatheCyan 2.5s ease-in-out infinite;
}

/* 5. Smooth Table Row Ingestion Reveal */
@keyframes tableRowIngest {
    0% {
        opacity: 0;
        transform: translateY(6px);
        background-color: rgba(16, 185, 129, 0.15);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background-color: transparent;
    }
}

.table-row-reveal {
    animation: tableRowIngest 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 6. High-Tech Glass Panel Glow */
.glass-panel-glow {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.glass-panel-glow:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 25px 50px -12px rgba(6, 182, 212, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* 7. High-Precision OCR Scan Button - Radiant Emerald/Teal/Cyan Holographic Theme */
#btn-scan,
.btn-scan-primary {
    background: linear-gradient(135deg, #059669 0%, #0d9488 42%, #0284c7 100%) !important;
    color: #FFFFFF !important;
    border: 1.5px solid rgba(110, 231, 183, 0.55) !important;
    box-shadow: 0 12px 28px -4px rgba(13, 148, 136, 0.45), 0 6px 14px -2px rgba(5, 150, 105, 0.35), 0 0 24px rgba(6, 182, 212, 0.3) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
    position: relative;
    overflow: hidden;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#btn-scan:hover,
.btn-scan-primary:hover {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 42%, #0ea5e9 100%) !important;
    box-shadow: 0 16px 36px -4px rgba(13, 148, 136, 0.6), 0 8px 20px -2px rgba(16, 185, 129, 0.5), 0 0 32px rgba(6, 182, 212, 0.55) !important;
    border-color: rgba(167, 243, 208, 0.95) !important;
    transform: translateY(-2px) !important;
}

#btn-scan:active,
.btn-scan-primary:active {
    transform: translateY(1px) scale(0.99) !important;
    box-shadow: 0 4px 14px -2px rgba(13, 148, 136, 0.45) !important;
}

#btn-scan svg,
.btn-scan-primary svg {
    color: #A7F3D0 !important;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.85)) !important;
}

#btn-scan span,
.btn-scan-primary span {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Specific Light Theme Reinforcement for Scan Button */
html.light-theme #btn-scan,
html.light-theme .btn-scan-primary {
    background: linear-gradient(135deg, #059669 0%, #0d9488 42%, #0284c7 100%) !important;
    color: #FFFFFF !important;
    border: 1.5px solid rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 10px 25px -4px rgba(13, 148, 136, 0.4), 0 4px 12px -2px rgba(5, 150, 105, 0.3), 0 0 20px rgba(6, 182, 212, 0.25) !important;
}

html.light-theme #btn-scan:hover,
html.light-theme .btn-scan-primary:hover {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 42%, #0ea5e9 100%) !important;
    box-shadow: 0 14px 32px -4px rgba(13, 148, 136, 0.55), 0 8px 18px -2px rgba(16, 185, 129, 0.45), 0 0 28px rgba(6, 182, 212, 0.45) !important;
}

html.light-theme #btn-scan span,
html.light-theme .btn-scan-primary span {
    color: #FFFFFF !important;
}
