/* styles.css for Cashier Mini App */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #121212;
    color: #f0f0f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.dark-mode header {
    background: linear-gradient(135deg, #1a2530, #0d151f);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.btn-back {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .btn-back {
    color: #f0f0f0;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    flex: 1;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.dark-mode-toggle {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Left Column */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Config Section */
.config-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.config-section .section-header h2 {
    margin: 0;
}

.toggle-config {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    transition: transform 0.3s ease;
}

body.dark-mode .toggle-config {
    color: #bb86fc;
}

.toggle-config.collapsed {
    transform: rotate(-90deg);
}

.config-section .config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-section .config-form.collapsed {
    display: none;
}

.btn-save-config {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn-save-config:hover {
    background-color: #2980b9;
}

body.dark-mode .btn-save-config {
    background-color: #bb86fc;
    color: #121212;
}

body.dark-mode .btn-save-config:hover {
    background-color: #9d65c9;
}

/* Section Styles */
section {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

body.dark-mode section {
    background-color: #1e1e1e;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

section h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

body.dark-mode section h2 {
    color: #bb86fc;
    border-bottom: 2px solid #bb86fc;
}

/* Product Section */
.product-section form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

body.dark-mode .form-group label {
    color: #bb86fc;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

body.dark-mode .form-group input {
    background-color: #2d2d2d;
    border: 1px solid #444;
    color: #f0f0f0;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

body.dark-mode .form-group input:focus {
    border-color: #bb86fc;
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.2);
}

.btn-add-product {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn-add-product:hover {
    background-color: #27ae60;
}

body.dark-mode .btn-add-product {
    background-color: #27ae60;
}

/* Cart Section */
.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.empty-cart {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

body.dark-mode .empty-cart {
    color: #aaa;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f1f8ff;
    border-radius: 8px;
    margin-bottom: 10px;
}

body.dark-mode .cart-item {
    background-color: #2d2d2d;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.item-price-quantity {
    font-size: 0.9rem;
    color: #7f8c8d;
}

body.dark-mode .item-price-quantity {
    color: #aaa;
}

.item-total {
    font-weight: 600;
    margin: 0 15px;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.btn-remove:hover {
    background-color: #c0392b;
}

/* Cart Summary */
.cart-summary {
    background-color: #f1f8ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

body.dark-mode .cart-summary {
    background-color: #2d2d2d;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.summary-row label {
    font-weight: 500;
    color: #2c3e50;
}

body.dark-mode .summary-row label {
    color: #bb86fc;
}

.summary-row input {
    width: 120px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: right;
}

body.dark-mode .summary-row input {
    background-color: #2d2d2d;
    border: 1px solid #444;
    color: #f0f0f0;
}

.total-row {
    font-weight: 700;
    font-size: 1.3rem;
    padding-top: 10px;
    border-top: 2px solid #3498db;
}

body.dark-mode .total-row {
    border-top: 2px solid #bb86fc;
}

/* Payment Section */
.payment-section {
    background-color: #f1f8ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

body.dark-mode .payment-section {
    background-color: #2d2d2d;
}

.payment-section .form-group {
    margin-bottom: 15px;
}

.payment-section .form-group input {
    width: 100%;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    gap: 15px;
}

.btn-print, .btn-clear {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-print {
    background-color: #9b59b6;
    color: white;
}

.btn-print:hover {
    background-color: #8e44ad;
}

.btn-clear {
    background-color: #e74c3c;
    color: white;
}

.btn-clear:hover {
    background-color: #c0392b;
}

body.dark-mode .btn-print {
    background-color: #8e44ad;
    color: white;
}

body.dark-mode .btn-print:hover {
    background-color: #7d3c98;
}

body.dark-mode .btn-clear {
    background-color: #c0392b;
    color: white;
}

body.dark-mode .btn-clear:hover {
    background-color: #a93226;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e;
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background-color: #f1f8ff;
    border-top: 1px solid #ddd;
}

body.dark-mode .modal-footer {
    background-color: #2d2d2d;
    border-top: 1px solid #444;
}

.btn-confirm, .btn-cancel {
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-confirm {
    background-color: #2ecc71;
    color: white;
}

.btn-confirm:hover {
    background-color: #27ae60;
}

.btn-cancel {
    background-color: #e74c3c;
    color: white;
}

.btn-cancel:hover {
    background-color: #c0392b;
}

body.dark-mode .btn-confirm {
    background-color: #27ae60;
}

body.dark-mode .btn-cancel {
    background-color: #c0392b;
}

/* Receipt Preview */
.receipt-preview {
    background-color: white;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-width: 300px;
    margin: 0 auto;
    border: 1px dashed #333;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.receipt-header h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.receipt-header p {
    margin: 0;
    font-size: 10px;
}

.receipt-items {
    margin-bottom: 15px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-item-name {
    flex: 2;
}

.receipt-item-price {
    flex: 1;
    text-align: right;
}

.receipt-summary {
    border-top: 1px solid #333;
    padding-top: 10px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-total {
    font-weight: bold;
    margin-top: 5px;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 10px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 1rem;
    border-top: 1px solid #eee;
}

body.dark-mode footer {
    color: #aaa;
    border-top: 1px solid #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .app-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-confirm, .btn-cancel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    section {
        padding: 20px 15px;
    }
    
    section h2 {
        font-size: 1.3rem;
    }
}