/* ============================================
   KOPI NUSA — Custom Styles
   Coffee-themed POS System
   ============================================ */

/* ---------- Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* ---------- Glassmorphism & Cards ---------- */
.glass-card {
    background: rgba(255, 255, 255, 1);
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.glass-card-static {
    background: rgba(255, 255, 255, 1);
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.glass-dark {
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

/* ---------- Scrollbar ---------- */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(44, 24, 16, 0.15);
    border-radius: 10px;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

/* Staggered children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.40s; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 14, 8, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(44, 24, 16, 0.25);
}

.modal-backdrop.active .modal-content {
    /* Animation handled by Tailwind animate-scale-in */
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-dark {
    background: #000000;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-dark:hover {
    background: #333333;
    transform: translateY(-1px);
}

.btn-success {
    background: #16A34A;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    background: #15803D;
    transform: translateY(-1px);
}

.btn-danger {
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #B91C1C;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ghost:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

/* ---------- Form Inputs ---------- */
.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    background: #FFFFFF;
    transition: all 0.2s ease;
    color: #0F172A;
}

.input-field:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: white;
}

.input-field::placeholder {
    color: #94A3B8;
}

/* ---------- Product Grid Card ---------- */
.product-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 1.25rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #2563EB;
}

.product-card:active {
    transform: translateY(0) scale(0.98);
}

.product-card .product-emoji {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ---------- Cart Item ---------- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 1rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease;
}

.cart-item:hover {
    background: #F1F5F9;
}

/* ---------- Calculator ---------- */
.calc-btn {
    width: 100%;
    aspect-ratio: 1.4;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
    color: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-btn:hover {
    background: #F8FAFC;
    border-color: #2563EB;
}

.calc-btn:active {
    transform: scale(0.95);
}

.calc-btn-nominal {
    background: #F1F5F9;
    border-color: #E2E8F0;
    font-size: 0.8rem;
    color: #0F172A;
}

.calc-btn-nominal:hover {
    background: #E2E8F0;
}

/* ---------- Category Tab ---------- */
.category-tab {
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
}

.category-tab:hover {
    background: #F8FAFC;
    color: #0F172A;
}

.category-tab.active {
    background: #000000;
    color: white;
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------- Stat Card ---------- */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16A34A;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #CA8A04;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

/* ---------- Table ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-wrapper thead {
    background: #F1F5F9;
    color: #0F172A;
    border-bottom: 1px solid #E2E8F0;
}

.table-wrapper th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-wrapper td {
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.table-wrapper tbody tr {
    transition: background 0.15s ease;
}

.table-wrapper tbody tr:hover {
    background: #F8FAFC;
}

.table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- Toast ---------- */
.toast {
    padding: 14px 20px;
    border-radius: 14px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideInRight 0.4s ease, fadeIn 0.4s ease;
    cursor: pointer;
}

.toast-success {
    background: linear-gradient(135deg, #22C55E, #16A34A);
}

.toast-error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.toast-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.toast-info {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

/* ---------- Receipt ---------- */
.receipt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
    padding: 20px;
    background: white;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 8px 0;
}

/* ---------- Login Page ---------- */
.login-bg {
    background: #F8FAFC;
    background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-bg::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

/* ---------- QR Code Container ---------- */
.qr-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 2px dashed #E2E8F0;
}

/* ---------- Number Pad ---------- */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* ---------- Print Styles ---------- */
@media print {
    body * { visibility: hidden; }
    .receipt, .receipt * {
        visibility: visible;
    }
    .receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 10px;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .calc-btn {
        font-size: 1rem;
    }
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
