/* Main Styles */
.sidebar { transition: transform 0.3s ease; }
.sidebar-collapsed { transform: translateX(-100%); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.modal { transition: opacity 0.3s ease; }

/* Toast Animation */
.toast { animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Card Hover Effect */
.card-hover:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

/* Gradient Background */
.gradient-bg { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}

/* Status Badges */
.status-active { background: #10b981; }
.status-expired { background: #ef4444; }
.status-pending { background: #f59e0b; }

/* Popular Products Card */
.popular-card:hover { transform: scale(1.05); }
.rank-badge { position: absolute; top: -8px; right: -8px; }

/* Image Preview */
.image-preview { 
    max-width: 100px; 
    max-height: 100px; 
    object-fit: contain; 
}

/* Print Styles */
@media print { 
    .no-print { display: none !important; } 
}

/* Receipt Print Styles - 98mm x 148mm */
.receipt-print {
    width: 98mm;
    height: 148mm;
    margin: 0;
    padding: 5mm;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #000;
}

.receipt-print .watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    max-width: 80%;
    z-index: -1;
    pointer-events: none;
}

.receipt-print .header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.receipt-print .logo {
    max-height: 35px;
    margin-bottom: 3px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.receipt-print .store-name {
    font-size: 13px;
    font-weight: bold;
    margin: 0;
}

.receipt-print .store-info {
    font-size: 9px;
    margin: 1px 0;
}

.receipt-print .meta {
    font-size: 9px;
    margin: 5px 0;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
}

.receipt-print .meta p {
    margin: 2px 0;
}

.receipt-print .items {
    padding-top: 3px;
    min-height: 30px;
}

.receipt-print .item {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin: 2px 0;
}

.receipt-print .total {
    border-top: 1px dashed #000;
    margin-top: 5px;
    padding-top: 5px;
    font-weight: bold;
    font-size: 12px;
}

.receipt-print .seal {
    text-align: center;
    margin-top: 8px;
}

.receipt-print .seal img {
    max-height: 35px;
}

.receipt-print .footer {
    text-align: center;
    font-size: 8px;
    margin-top: 8px;
    border-top: 1px dashed #000;
    padding-top: 5px;
}

/* Invoice Print Styles - A4 */
.invoice-print {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 20mm;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    position: relative;
}

.invoice-print .watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    z-index: -1;
    max-width: 400px;
}

.invoice-print .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #7c3aed;
}

.invoice-print .logo-section h1 {
    color: #7c3aed;
    font-size: 28px;
}

.invoice-print .invoice-title {
    text-align: right;
}

.invoice-print .invoice-title h2 {
    font-size: 28px;
    color: #7c3aed;
}

.invoice-print table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.invoice-print th {
    background: #7c3aed;
    color: white;
    padding: 12px;
    text-align: left;
}

.invoice-print td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.invoice-print .totals {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.invoice-print .totals-box {
    width: 300px;
}

.invoice-print .totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.invoice-print .grand-total {
    border-top: 2px solid #7c3aed;
    font-size: 18px;
    font-weight: bold;
    color: #7c3aed;
}

.invoice-print .warranty-box {
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.invoice-print .warranty-active {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.invoice-print .warranty-expired {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.invoice-print .bank-box {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.invoice-print .signature {
    text-align: right;
    margin-top: 30px;
}

.invoice-print .signature img {
    max-height: 60px;
}

.invoice-print .footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 12px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #7c3aed;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
