/* ============================================
   Aliex POS System - Professional Styling
   ============================================ */

:root {
    --color-primary-dark: #0A1628;
    --color-primary: #1A2A4A;
    --color-secondary: #4A90D9;
    --color-secondary-dark: #3A70B9;
    --color-success: #2ECC71;
    --color-danger: #E74C3C;
    --color-warning: #F39C12;
    --color-info: #3498DB;
    --color-white: #FFFFFF;
    --color-gray-100: #F8F9FA;
    --color-gray-200: #E9ECEF;
    --color-gray-300: #DEE2E6;
    --color-gray-400: #CED4DA;
    --color-gray-500: #ADB5BD;
    --color-gray-600: #6C757D;
    --color-gray-700: #495057;
    --color-gray-800: #343A40;
    --color-gray-900: #212529;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   NAVIGATION - Clean & Professional
   ============================================ */
.navbar-custom {
    background: var(--color-primary-dark) !important;
    border-bottom: 3px solid var(--color-secondary) !important;
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.2);
}

.navbar-custom .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.25rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.5rem 0;
    display: inline-block;
}

.navbar-custom .navbar-brand span {
    color: var(--color-secondary);
}

.navbar-custom .navbar-brand::before,
.navbar-custom .navbar-brand::after {
    display: none !important;
    content: none !important;
}

/* Only hide images in the brand, not favicon */
.navbar-custom .navbar-brand img {
    display: none !important;
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background: rgba(74, 144, 217, 0.2) !important;
    border-radius: 0.375rem;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Dropdown Styling */
.navbar-custom .dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(10, 22, 40, 0.15);
    border-radius: 0.5rem;
    background: #ffffff;
}

.navbar-custom .dropdown-item {
    color: var(--color-gray-800);
    transition: all 0.2s ease;
}

.navbar-custom .dropdown-item:hover {
    background: var(--color-gray-100);
}

.navbar-custom .dropdown-item.text-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Low Stock Badge Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.low-stock-badge {
    animation: pulse 2s infinite;
}

/* ============================================
   STAT CARDS - Professional Styling
   ============================================ */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(10, 22, 40, 0.06);
    border-left: 4px solid var(--color-secondary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(74, 144, 217, 0.03);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(10, 22, 40, 0.12);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    color: var(--color-secondary);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    font-weight: 500;
}

.stat-card.stat-success {
    border-left-color: var(--color-success);
}
.stat-card.stat-success .stat-icon {
    color: var(--color-success);
}
.stat-card.stat-success::before {
    background: rgba(46, 204, 113, 0.03);
}

.stat-card.stat-danger {
    border-left-color: var(--color-danger);
}
.stat-card.stat-danger .stat-icon {
    color: var(--color-danger);
}
.stat-card.stat-danger::before {
    background: rgba(231, 76, 60, 0.03);
}

.stat-card.stat-warning {
    border-left-color: var(--color-warning);
}
.stat-card.stat-warning .stat-icon {
    color: var(--color-warning);
}
.stat-card.stat-warning::before {
    background: rgba(243, 156, 18, 0.03);
}

/* ============================================
   POS PRODUCT ITEMS
   ============================================ */
.pos-product-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--color-gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    background: var(--color-white);
    position: relative;
    overflow: hidden;
}

.pos-product-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.pos-product-item:hover::after {
    transform: scaleX(1);
}

.pos-product-item:hover {
    border-color: var(--color-secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(10, 22, 40, 0.1);
}

.pos-product-item .product-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--color-gray-800);
}

.pos-product-item .product-price {
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 1.1rem;
}

.pos-product-item .product-stock {
    font-size: 0.7rem;
    color: var(--color-gray-500);
}

/* ============================================
   CART STYLES
   ============================================ */
#cartItemsContainer {
    min-height: 100px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-white);
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: var(--color-gray-50);
}

.cart-item .item-info {
    flex: 1;
    margin-right: 0.5rem;
    min-width: 0;
}

.cart-item .item-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item .item-meta {
    font-size: 0.7rem;
    color: var(--color-gray-500);
}

.cart-item .item-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.cart-item .item-actions .btn {
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.cart-item .item-actions .btn:hover {
    transform: scale(1.05);
}

.cart-item .item-qty {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-gray-800);
}

/* Cart Summary */
#cartSummary {
    border-top: 2px solid var(--color-gray-200);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    font-size: 0.85rem;
}

.summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 2px solid var(--color-gray-200);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    color: var(--color-secondary);
}

/* ============================================
   RECEIPT STYLES
   ============================================ */
.receipt-wrapper {
    background: #ffffff;
    font-family: var(--font-family);
}

.receipt-logo {
    max-width: 80px;
    height: auto;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 9999;
    max-width: 420px;
    width: 100%;
}

.flash-message {
    animation: slideInRight 0.4s ease;
    margin-bottom: 0.5rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .flash-container {
        top: 70px;
        right: 1rem;
        left: 1rem;
        max-width: 100%;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-card::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card .stat-value {
        font-size: 1rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.7rem;
    }
    
    .cart-item .item-name {
        font-size: 0.75rem;
    }
    
    .cart-item .item-meta {
        font-size: 0.65rem;
    }
}

/* Print Styles */
@media print {
    .navbar { display: none !important; }
    .footer { display: none !important; }
    .btn { display: none !important; }
    .main-content { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
    .modal-backdrop { display: none !important; }
    .modal {
        position: static !important;
        display: block !important;
        background: white !important;
    }
    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        transform: none !important;
    }
    .modal-content {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .modal-header { display: none !important; }
    .modal-footer { display: none !important; }
    .receipt-wrapper { padding: 20px !important; }
    body { background: white !important; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted { color: var(--color-gray-600) !important; }
.text-primary { color: var(--color-secondary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }

.badge-success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--color-success);
}
.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--color-danger);
}
.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--color-warning);
}
.badge-info {
    background: rgba(52, 152, 219, 0.15);
    color: var(--color-info);
}
.badge-primary {
    background: rgba(74, 144, 217, 0.15);
    color: var(--color-secondary);
}
/* ============================================
   LOCK SCREEN STYLES
   ============================================ */

#lockScreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

#lockScreen .lock-card {
    max-width: 420px;
    width: 90%;
    padding: 2.5rem;
    background: #1A2A4A;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(74, 144, 217, 0.2);
}

#lockScreen .lock-icon {
    font-size: 4rem;
    color: #4A90D9;
    margin-bottom: 1rem;
}

#lockScreen .lock-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#lockScreen .lock-subtitle {
    color: #adb5bd;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#lockScreen .lock-time {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

#lockScreen .lock-input {
    background: #2A3A5A !important;
    border: 2px solid #4A90D9 !important;
    color: #ffffff !important;
    border-radius: 0.5rem;
    height: 50px;
    font-size: 1rem;
    padding-left: 40px;
    width: 100%;
}

#lockScreen .lock-input:focus {
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.3);
    background: #2A3A5A !important;
    color: #ffffff !important;
}

#lockScreen .lock-input::placeholder {
    color: #8a9bb5;
}

#lockScreen .lock-error {
    color: #E74C3C;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

#lockScreen .lock-btn {
    padding: 0.75rem;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
}

/* Lock screen responsive */
@media (max-width: 480px) {
    #lockScreen .lock-card {
        padding: 1.5rem;
    }
    #lockScreen .lock-icon {
        font-size: 3rem;
    }
    #lockScreen .lock-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   58mm Thermal Receipt Preview Styling
   ============================================ */
.thermal-receipt {
    width: 56mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 2mm 1.5mm;
    background: #ffffff;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.25;
    border: 1px solid var(--color-gray-300);
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.08);
}
.thermal-receipt .receipt-logo {
    display: block;
    max-width: 34mm;
    max-height: 16mm;
    object-fit: contain;
    margin: 0 auto 1mm auto;
}
.thermal-receipt .receipt-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 1.5mm;
    margin-bottom: 1.5mm;
}
.thermal-receipt .store-name {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.3px;
    line-height: 1.1;
}
.thermal-receipt .store-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.thermal-receipt .store-info {
    font-size: 10px;
    line-height: 1.2;
}
.thermal-receipt .receipt-section {
    border-bottom: 1px dashed #000;
    padding: 1.5mm 0;
    margin-bottom: 1.5mm;
}
.thermal-receipt .receipt-meta div,
.thermal-receipt .payment-line div,
.thermal-receipt .receipt-totals div {
    display: flex;
    justify-content: space-between;
    gap: 2mm;
    font-size: 11px;
    margin: .7mm 0;
}
.thermal-receipt .receipt-meta strong,
.thermal-receipt .payment-line strong,
.thermal-receipt .receipt-totals strong {
    font-weight: 800;
    text-align: right;
}
.thermal-receipt .receipt-items {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 1.5mm;
}
.thermal-receipt .receipt-items th {
    font-size: 10px;
    font-weight: 900;
    text-align: left;
    border-bottom: 1px solid #000;
    padding: 1mm 0;
}
.thermal-receipt .receipt-items td {
    font-size: 11px;
    font-weight: 700;
    padding: 1mm 0;
    border-bottom: 1px dotted #777;
    vertical-align: top;
}
.thermal-receipt .receipt-items .item-name { width: 42%; word-break: break-word; }
.thermal-receipt .receipt-items .qty { width: 12%; }
.thermal-receipt .receipt-items .price { width: 22%; }
.thermal-receipt .receipt-items .total { width: 24%; }
.thermal-receipt .num { text-align: right !important; }
.thermal-receipt .empty-line { text-align: center; color: #555; font-size: 11px; }
.thermal-receipt .receipt-totals {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 1.5mm 0;
    margin: 1.5mm 0;
}
.thermal-receipt .receipt-totals div { font-size: 12px; }
.thermal-receipt .receipt-totals .grand-total {
    border-top: 2px solid #000;
    margin-top: 1.5mm;
    padding-top: 1.5mm;
    font-size: 16px !important;
}
.thermal-receipt .receipt-footer {
    text-align: center;
    font-size: 10px;
    line-height: 1.25;
    margin-top: 2mm;
}
.thermal-receipt .thanks {
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 1mm;
}
@media print {
    body * { visibility: hidden; }
    .thermal-receipt, .thermal-receipt * { visibility: visible; }
    .thermal-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 56mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
}

