/* Climate Vouchers POS Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #dbeafe;
    color: #1e40af;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.store-info {
    font-size: 0.9em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.products-section, .cart-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border: 1px solid #93c5fd;
}

.products-section h2, .cart-section h2 {
    margin-bottom: 20px;
    color: #1e40af;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.product-card {
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.product-info h3 {
    font-size: 1em;
    margin-bottom: 5px;
    color: #1e40af;
}

.product-info .sku {
    font-size: 0.85em;
    color: #3b82f6;
    margin-bottom: 5px;
}

.product-info .price {
    font-size: 1.2em;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
}

.badge.eligible {
    background-color: #10b981;
    color: white;
}

.badge.eligible-small {
    background-color: #10b981;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
}

.btn-add, .btn-remove, .btn-process, .btn-clear {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: 10px;
}

.btn-add {
    background-color: #3b82f6;
    color: white;
}

.btn-add:hover {
    background-color: #2563eb;
}

.btn-remove {
    background-color: #ef4444;
    color: white;
    padding: 5px 10px;
    width: auto;
    margin-top: 0;
}

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

.btn-process {
    background-color: #3b82f6;
    color: white;
    margin-top: 10px;
}

.btn-process:hover {
    background-color: #2563eb;
}

.btn-clear {
    background-color: #6b7280;
    color: white;
    margin-top: 10px;
}

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

.empty-cart {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th {
    background-color: #eff6ff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #93c5fd;
    color: #1e40af;
}

.cart-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e7ff;
}

.cart-table tr:hover {
    background-color: #eff6ff;
}

.cart-summary {
    background-color: #eff6ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #93c5fd;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95em;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.1em;
    border-top: 2px solid #93c5fd;
    padding-top: 12px;
    margin-top: 8px;
    color: #1e40af;
}

.summary-row.eligible-total {
    color: #059669;
    font-weight: 600;
    border-top: 1px solid #93c5fd;
    padding-top: 8px;
    margin-top: 8px;
}

.payment-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #93c5fd;
}

.payment-section h3 {
    margin-bottom: 15px;
    color: #1e40af;
}

.payment-method {
    margin-bottom: 15px;
}

.payment-method label {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #eff6ff;
    border-radius: 6px;
    cursor: pointer;
}

.payment-method input[type="radio"] {
    margin-right: 10px;
}

/* Payment Method Image Buttons */
.payment-method-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-method-btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    padding: 15px 10px;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.payment-method-btn:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.payment-method-btn.active {
    border-color: #3b82f6;
    background-color: #eff6ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.payment-method-btn.active::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #3b82f6;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.payment-method-img {
    width: 100%;
    max-width: 180px;
    height: auto;
    max-height: 80px;
    border-radius: 4px;
    object-fit: contain;
    display: block;
}

.payment-method-btn[data-payment-method="climate_voucher"] {
    min-width: 180px;
    max-width: 250px;
    padding: 10px;
}

.payment-method-btn[data-payment-method="climate_voucher"] span {
    font-size: 0.85em;
    margin-top: 5px;
}

.payment-method-icon {
    font-size: 2.5em;
    line-height: 1;
    margin-bottom: 5px;
}

.payment-method-btn span {
    font-size: 0.9em;
    font-weight: 600;
    color: #1e40af;
    text-align: center;
}

.payment-method-btn.active span {
    color: #2563eb;
}

/* Specific icon styling */
.cash-icon {
    color: #059669;
}

.bank-icon {
    font-size: 2em;
}

.card-icon {
    color: #3b82f6;
}

.qr-scanner-section {
    margin-bottom: 15px;
}

.qr-scanner-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.qr-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.qr-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

#payment-result {
    margin-top: 15px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #3b82f6;
}

/* Receipt Styles */
.receipt {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border: 1px solid #93c5fd;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #93c5fd;
    padding-bottom: 15px;
    margin-bottom: 15px;
    color: #1e40af;
}

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

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f3f4f6;
}

.receipt-totals {
    border-top: 2px solid #93c5fd;
    padding-top: 15px;
    margin-top: 15px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.receipt-total-row.final {
    font-weight: bold;
    font-size: 1.2em;
    border-top: 2px solid #93c5fd;
    padding-top: 10px;
    margin-top: 10px;
    color: #1e40af;
}

/* Navigation */
.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border: 1px solid #93c5fd;
}

.nav a {
    color: #3b82f6;
    text-decoration: none;
    margin-right: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav a:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.nav a.active {
    background-color: #3b82f6;
    color: white;
}

/* Admin nav user dropdown */
.nav-user-wrap {
    position: relative;
}

.nav-user-wrap:hover .nav-user-trigger,
.nav-user-trigger:hover {
    background-color: #eff6ff;
}

.nav-user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: #fff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    padding: 4px 0;
    z-index: 100;
}

.nav-user-wrap:hover .nav-user-menu {
    display: block;
}

.nav-user-menu a {
    display: block;
    margin: 0;
    padding: 8px 16px;
    color: #1e40af;
    font-size: 0.875rem;
    border-radius: 0;
}

.nav-user-menu a:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Scanner Mode Buttons */
.scanner-mode-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-scanner-mode {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #3b82f6;
    background-color: white;
    color: #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-scanner-mode:hover {
    background-color: #eff6ff;
}

.btn-scanner-mode.active {
    background-color: #3b82f6;
    color: white;
}

.btn-stop-camera {
    margin-top: 10px;
}

/* QR Reader Container */
#qr-reader {
    border: 2px solid #93c5fd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
}

#qr-reader video {
    width: 100%;
    height: auto;
}

#qr-reader__dashboard {
    background-color: #eff6ff;
    padding: 10px;
}

#qr-reader__camera_selection {
    margin-bottom: 10px;
}

#qr-reader__camera_selection select {
    width: 100%;
    padding: 8px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    color: #1e40af;
}

/* Admin pages: forms and buttons (blue theme) */
.filter-form {
    margin-bottom: 20px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 8px;
    border: 1px solid #93c5fd;
}
.filter-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e40af;
    box-sizing: border-box;
}
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}
.btn-primary-inline {
    padding: 8px 20px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.btn-primary-inline:hover {
    background-color: #2563eb;
}
.btn-secondary-inline {
    display: inline-block;
    margin-left: 10px;
    padding: 8px 20px;
    background-color: #6b7280;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}
.btn-secondary-inline:hover {
    background-color: #4b5563;
    color: white;
}
.btn-receipt-link {
    padding: 5px 10px;
    background-color: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}
.btn-receipt-link:hover {
    background-color: #2563eb;
    color: white;
}
.admin-form-panel {
    background: #eff6ff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #93c5fd;
}
.admin-form-panel h3 {
    color: #1e40af;
    margin-bottom: 1rem;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #1e40af;
}
.form-link-wrap {
    margin-top: 8px;
    font-size: 0.9em;
}
.form-link {
    color: #3b82f6;
    text-decoration: none;
}
.form-link:hover {
    color: #2563eb;
    text-decoration: underline;
}
.form-actions {
    margin-top: 1rem;
}
.form-actions .btn-save,
.form-actions .btn-cancel {
    margin-right: 10px;
}
.btn-add-product {
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.btn-add-product:hover {
    background-color: #2563eb;
}
.btn-save {
    padding: 10px 20px;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.btn-save:hover {
    background-color: #059669;
}
.btn-cancel {
    padding: 10px 20px;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.btn-cancel:hover {
    background-color: #4b5563;
}
.btn-edit {
    padding: 5px 10px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 5px;
}
.btn-edit:hover {
    background-color: #2563eb;
}
.photo-preview-wrap {
    margin-top: 10px;
}
.photo-preview-img {
    max-width: 160px;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid #93c5fd;
}
.product-thumb-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #93c5fd;
}
.btn-toggle-eligible {
    padding: 5px 10px;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 5px;
}
.btn-toggle-eligible:hover {
    background-color: #059669;
}
.btn-delete {
    padding: 5px 10px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.btn-delete:hover {
    background-color: #dc2626;
}

/* Site footer */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: #1e40af;
    font-size: 0.9em;
    border-top: 1px solid #93c5fd;
}
.site-footer-copyright,
.site-footer-company {
    margin: 4px 0;
}
.settings-intro {
    margin-bottom: 1rem;
    color: #1e40af;
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .filter-form-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .cart-table {
        font-size: 0.9em;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 8px;
    }
    
    .scanner-mode-buttons {
        flex-direction: column;
    }
    
    #qr-reader {
        max-height: 300px;
    }
    
    .payment-method-options {
        flex-direction: column;
    }
    
    .payment-method-btn {
        max-width: 100%;
        width: 100%;
    }
    
    .payment-method-btn[data-payment-method="climate_voucher"] {
        max-width: 100%;
    }
}
