/* assets/css/style.css */

/* Custom Variables */
:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 4px 12px 0 rgba(31, 38, 135, 0.08);
    --sidebar-bg: #2b2b2b;
    --text-color: #333;
    --body-bg: #f4f7f6;
    --primary-color: #4a90e2;
    --card-bg: rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] {
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --sidebar-bg: #1a1a1a;
    --text-color: #f8f9fa;
    --body-bg: #121212;
    --primary-color: #5c9ce6;
    --card-bg: rgba(30, 30, 30, 0.85);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
}

/* Modern Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }


/* Glassmorphism Utilities */
.glass-card, .bg-glass, .bg-glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.floating-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
}

.floating-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Sidebar Styles */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .components {
    padding: 20px 0;
}

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 10px 20px;
    font-size: 1.1em;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: 0.3s;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: #fff;
    background: var(--primary-color);
    border-radius: 8px;
    margin: 0 10px;
    padding: 10px;
}

/* Top Navbar */
.navbar {
    padding: 15px 20px;
    background: var(--glass-bg);
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #sidebarCollapse span {
        display: none;
    }
}

/* POS Specific */
.pos-product-grid {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.pos-cart {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.product-card {
    cursor: pointer;
    transition: 0.2s;
}
.product-card:hover {
    transform: scale(1.02);
    border-color: var(--primary-color);
}
.x-small { font-size: 0.75rem !important; }
.btn-back-pos {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    border: none;
    font-weight: bold;
    min-width: 140px;
    border-radius: 10px;
    transition: 0.3s;
}
.btn-back-pos:hover {
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
}
.btn-a4-pos {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white !important;
    border: none;
    font-weight: bold;
    border-radius: 8px;
    transition: 0.3s;
}
.btn-a4-pos:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.4);
}

/* Compact Mode */
.compact-pos {
    font-size: 0.9rem;
}
.compact-pos .card-header { padding: 0.5rem 1rem !important; }
.compact-pos .card-body { padding: 0.5rem !important; }
.compact-pos .product-card h6 { font-size: 0.8rem; margin-bottom: 2px !important; }
.compact-pos .product-card h5 { font-size: 0.95rem; margin-bottom: 0 !important; }
.compact-pos .product-card .badge { font-size: 0.7rem; padding: 0.2em 0.5em; }
.compact-pos .list-group-item { padding: 0.3rem 0.6rem !important; }
.compact-pos .input-group-lg .form-control { font-size: 1rem; padding: 0.4rem 0.8rem; }
.compact-pos .btn-lg { padding: 0.4rem 1rem; font-size: 1rem; }
.compact-pos h4, .compact-pos .h4 { font-size: 1.25rem; }
.compact-pos h5, .compact-pos .h5 { font-size: 1rem; }
.compact-pos .pos-product-grid { max-height: calc(100vh - 140px); }
.compact-pos .pos-cart { max-height: calc(100vh - 280px); }
.compact-pos .bg-glass-nav { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }

/* Super-Compact ERP Mode */
.super-compact { font-size: 0.65rem !important; zoom: 0.85; }
.super-compact .card-header { padding: 0.3rem 0.6rem !important; }
.super-compact .card-body { padding: 0.3rem !important; }
.super-compact .list-group-item { padding: 0.2rem 0.5rem !important; }
.super-compact .product-card h6 { font-size: 0.75rem; margin-bottom: 1px !important; }
.super-compact .product-card h5, .super-compact .product-card .text-primary { font-size: 0.85rem !important; margin-bottom: 0 !important; }
.super-compact .btn { padding: 0.2rem 0.5rem; font-size: 0.8rem; }
.super-compact .form-control, .super-compact .form-select { padding: 0.2rem 0.4rem; font-size: 0.8rem; height: auto !important; }
.super-compact .pos-product-grid { max-height: calc(100vh - 120px); }
.super-compact .pos-cart { max-height: calc(100vh - 240px); }
.super-compact .mb-3, .super-compact .mb-2 { margin-bottom: 0.5rem !important; }
.super-compact .mt-3, .super-compact .mt-2 { margin-top: 0.5rem !important; }
.super-compact .g-2 { --bs-gutter-x: 0.4rem; --bs-gutter-y: 0.4rem; }

.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}
.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}
.stat-card:hover::before {
    opacity: 1;
}
.stat-icon {
    transition: transform 0.4s ease;
}
.stat-card:hover .stat-icon {
    transform: scale(1.2) rotate(-10deg);
}
.tracking-wider { letter-spacing: 0.05em; }

/* Entry Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-up {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Centered POS Wrapper */
.pos-screen-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 10px 0 10px;
    background: var(--body-bg);
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
