/* ReggieStarr RS-79 POS Web Styles */
:root {
    --primary: #1E3A8A;
    --primary-dark: #1e3a5f;
    --secondary: #3B82F6;
    --accent: #60A5FA;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --display-bg: #0f172a;
    --display-text: #10B981;
    --keypad-bg: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.pos-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo i {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.header-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.header-btn:hover {
    background: rgba(255,255,255,0.2);
}

.header-btn:active {
    transform: scale(0.98);
}

/* Container */
.pos-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    overflow: hidden;
}

/* Receipt Section */
.receipt-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.receipt-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.receipt-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.receipt-item:hover {
    background: var(--bg);
}

.receipt-item.voided {
    opacity: 0.5;
    text-decoration: line-through;
}

.receipt-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-qty {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.item-details h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.item-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-price {
    font-weight: 600;
    font-size: 1rem;
}

.receipt-totals {
    background: #f8fafc;
    border-top: 2px solid var(--border);
    padding: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

.total-line.grand-total {
    border-top: 2px solid var(--border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Quick Items */
.quick-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0.5rem;
}

.quick-item {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.quick-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-item:active {
    transform: translateY(0);
}

.quick-item i {
    font-size: 1.5rem;
}

.quick-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

.quick-item .price {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

/* PLU Section */
.plu-section {
    background: var(--display-bg);
    border-radius: 10px;
    padding: 1rem;
}

.plu-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plu-label {
    color: var(--display-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.plu-value {
    color: var(--display-text);
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    min-height: 2rem;
}

/* Keypad */
.keypad {
    background: var(--keypad-bg);
    border-radius: 10px;
    padding: 0.75rem;
}

.keypad-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.keypad-row:last-child {
    margin-bottom: 0;
}

.key {
    flex: 1;
    aspect-ratio: 1;
    background: #475569;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    background: #64748b;
}

.key:active {
    background: #334155;
    transform: scale(0.95);
}

.key[data-key="C"] {
    background: var(--danger);
}

.key[data-key="C"]:hover {
    background: #dc2626;
}

.key[data-key="ENT"] {
    background: var(--success);
}

.key[data-key="ENT"]:hover {
    background: #059669;
}

/* Payment Section */
.payment-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.payment-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.payment-btn:hover {
    border-color: var(--secondary);
    background: rgba(59, 130, 246, 0.05);
}

.payment-btn.active {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.payment-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

.payment-btn span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
}

/* Footer */
.pos-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-info.success {
    color: var(--success);
    font-weight: 500;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.footer-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
    transition: all 0.2s;
}

.footer-btn:hover {
    background: var(--border);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .quick-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pos-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .main-area {
        min-height: 50%;
    }
    
    .header-actions {
        display: none;
    }
    
    .quick-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print styles */
@media print {
    .pos-header, .sidebar, .pos-footer, .quick-items {
        display: none !important;
    }
    
    .main-area {
        width: 100%;
        padding: 0;
    }
    
    .receipt-section {
        box-shadow: none;
        border: none;
    }
}
