/**
 * Loyalty Rewards - Customer App Styles
 */

:root {
    --lrwc-primary: #6366f1;
    --lrwc-secondary: #4f46e5;
    --lrwc-success: #10b981;
    --lrwc-error: #ef4444;
    --lrwc-gray-50: #f9fafb;
    --lrwc-gray-100: #f3f4f6;
    --lrwc-gray-200: #e5e7eb;
    --lrwc-gray-300: #d1d5db;
    --lrwc-gray-500: #6b7280;
    --lrwc-gray-700: #374151;
    --lrwc-gray-900: #111827;
}

/* App Container */
.lrwc-app {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Loading */
.lrwc-loading {
    text-align: center;
    padding: 60px 20px;
}

.lrwc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--lrwc-gray-200);
    border-top-color: var(--lrwc-primary);
    border-radius: 50%;
    animation: lrwc-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes lrwc-spin {
    to { transform: rotate(360deg); }
}

/* Header */
.lrwc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--lrwc-primary), var(--lrwc-secondary));
    border-radius: 16px;
    color: white;
    margin-bottom: 20px;
}

.lrwc-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.lrwc-tier {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    margin-top: 5px;
}

/* Points Card */
.lrwc-points-card {
    background: var(--lrwc-gray-50);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.lrwc-points-label {
    font-size: 14px;
    color: var(--lrwc-gray-500);
    margin-bottom: 5px;
}

.lrwc-points-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--lrwc-gray-900);
    line-height: 1;
    margin-bottom: 15px;
}

.lrwc-points-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: var(--lrwc-gray-500);
}

.lrwc-points-info strong {
    color: var(--lrwc-gray-700);
}

/* QR Section */
.lrwc-qr-section {
    text-align: center;
    padding: 20px;
    background: white;
    border: 1px solid var(--lrwc-gray-200);
    border-radius: 16px;
    margin-bottom: 20px;
}

.lrwc-qr-section h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.lrwc-qr-section p {
    color: var(--lrwc-gray-500);
    font-size: 14px;
    margin-bottom: 15px;
}

.lrwc-qr-container {
    display: inline-block;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lrwc-qr-container canvas,
.lrwc-qr-container img {
    display: block;
}

/* Navigation */
.lrwc-nav {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--lrwc-gray-100);
    border-radius: 12px;
    margin-bottom: 20px;
}

.lrwc-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 12px;
    color: var(--lrwc-gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.lrwc-nav-btn:hover {
    background: rgba(255,255,255,0.5);
}

.lrwc-nav-btn.active {
    background: white;
    color: var(--lrwc-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lrwc-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Sections */
.lrwc-section {
    padding: 10px 0;
}

.lrwc-section h3 {
    margin: 0 0 15px;
    font-size: 18px;
}

/* Rewards Grid */
.lrwc-rewards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.lrwc-reward-card {
    background: white;
    border: 1px solid var(--lrwc-gray-200);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s;
}

.lrwc-reward-card:hover {
    border-color: var(--lrwc-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.lrwc-reward-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.lrwc-reward-card h4 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 600;
}

.lrwc-reward-card .points-cost {
    font-size: 14px;
    color: var(--lrwc-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.lrwc-reward-card .lrwc-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
}

/* History */
.lrwc-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lrwc-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid var(--lrwc-gray-200);
    border-radius: 10px;
}

.lrwc-history-item .history-info {
    flex: 1;
}

.lrwc-history-item .history-type {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.lrwc-history-item .history-date {
    font-size: 12px;
    color: var(--lrwc-gray-500);
}

.lrwc-history-item .history-points {
    font-weight: 700;
    font-size: 16px;
}

.lrwc-history-item .history-points.positive {
    color: var(--lrwc-success);
}

.lrwc-history-item .history-points.negative {
    color: var(--lrwc-error);
}

/* Buttons */
.lrwc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.lrwc-btn-secondary {
    background: var(--lrwc-gray-100);
    color: var(--lrwc-gray-700);
}

.lrwc-btn-secondary:hover {
    background: var(--lrwc-gray-200);
}

.lrwc-btn:disabled {
    background: var(--lrwc-gray-300);
    color: var(--lrwc-gray-500);
    cursor: not-allowed;
}

.lrwc-btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

.lrwc-btn-icon:hover {
    opacity: 1;
}

/* Login Required */
.lrwc-login-required {
    text-align: center;
    padding: 40px 20px;
    background: var(--lrwc-gray-50);
    border-radius: 12px;
}

.lrwc-login-required a {
    color: var(--lrwc-primary);
    font-weight: 500;
}

/* Empty States */
.lrwc-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--lrwc-gray-500);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .lrwc-points-value {
        font-size: 40px;
    }
    
    .lrwc-rewards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== */
/* STAFF SCANNER STYLES */
/* ==================== */

.lrwc-staff-app {
    max-width: 500px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Staff Login */
.lrwc-staff-login {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lrwc-staff-login-box {
    width: 100%;
    max-width: 360px;
    padding: 30px;
    background: white;
    border: 1px solid var(--lrwc-gray-200);
    border-radius: 16px;
    text-align: center;
}

.lrwc-staff-login-box h2 {
    margin: 0 0 5px;
}

.lrwc-staff-login-box > p {
    color: var(--lrwc-gray-500);
    margin-bottom: 20px;
}

.lrwc-form-group {
    margin-bottom: 15px;
    text-align: left;
}

.lrwc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.lrwc-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lrwc-gray-300);
    border-radius: 8px;
    font-size: 15px;
}

.lrwc-form-group input:focus {
    outline: none;
    border-color: var(--lrwc-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.lrwc-staff-login-box .lrwc-btn {
    width: 100%;
    margin-top: 10px;
}

.lrwc-error {
    color: var(--lrwc-error);
    font-size: 14px;
    margin-top: 15px;
}

/* Staff Header */
.lrwc-staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--lrwc-primary);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

.lrwc-staff-header h2 {
    margin: 0;
    font-size: 18px;
}

.lrwc-staff-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lrwc-staff-info span {
    font-size: 14px;
    opacity: 0.9;
}

/* Staff Tabs */
.lrwc-staff-tabs {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--lrwc-gray-100);
    border-radius: 10px;
    margin-bottom: 20px;
}

.lrwc-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lrwc-gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.lrwc-tab-btn:hover {
    background: rgba(255,255,255,0.5);
}

.lrwc-tab-btn.active {
    background: white;
    color: var(--lrwc-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Scanner */
.lrwc-scanner-container {
    text-align: center;
}

#lrwc-qr-reader {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}

#lrwc-qr-reader video {
    border-radius: 12px;
}

.lrwc-scanner-hint {
    color: var(--lrwc-gray-500);
    margin-top: 15px;
    font-size: 14px;
}

/* Customer Result Card */
.lrwc-customer-result {
    padding: 10px 0;
}

.lrwc-customer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--lrwc-primary), var(--lrwc-secondary));
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.lrwc-customer-info h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.lrwc-customer-points {
    text-align: right;
}

.lrwc-customer-points .lrwc-points-label {
    font-size: 12px;
    opacity: 0.9;
}

.lrwc-customer-points .lrwc-points-value {
    font-size: 28px;
    font-weight: 700;
}

/* Add Points Form */
.lrwc-add-points-form {
    background: white;
    border: 1px solid var(--lrwc-gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.lrwc-add-points-form h4 {
    margin: 0 0 15px;
}

.lrwc-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.lrwc-form-row .lrwc-form-group {
    flex: 1;
    margin-bottom: 0;
}

.lrwc-form-row .lrwc-btn {
    height: 42px;
}

.lrwc-points-preview {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--lrwc-gray-500);
}

.lrwc-points-preview strong {
    color: var(--lrwc-primary);
    font-size: 16px;
}

/* Pending Redemptions */
.lrwc-pending-redemptions {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.lrwc-pending-redemptions h4 {
    margin: 0 0 10px;
    color: #92400e;
}

/* Result Actions */
.lrwc-result-actions {
    text-align: center;
    margin-top: 15px;
}

/* Modal */
.lrwc-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: 9999;
}

.lrwc-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
}

.lrwc-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.lrwc-modal-icon.lrwc-success {
    background: #dcfce7;
    color: #16a34a;
}

.lrwc-modal-content h3 {
    margin: 0 0 10px;
}

.lrwc-modal-content p {
    color: var(--lrwc-gray-500);
    margin-bottom: 20px;
}

.lrwc-modal-content .lrwc-btn {
    min-width: 120px;
}

/* Wallet Banner */
.lrwc-wallet-banner {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin: 15px 0;
}
.lrwc-wallet-banner h4 {
    margin: 0 0 5px;
    font-size: 14px;
    opacity: 0.9;
}
.lrwc-wallet-banner .wallet-value {
    font-size: 24px;
    font-weight: 700;
}
.lrwc-wallet-banner small {
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

/* My Account Loyalty Styles */
.lrwc-account-section {
    margin-bottom: 30px;
}
.lrwc-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    color: white;
}
.lrwc-account-points {
    text-align: right;
}
.lrwc-account-points .points-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}
.lrwc-account-points .points-label {
    font-size: 14px;
    opacity: 0.9;
}
.lrwc-tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    margin-top: 8px;
}
.lrwc-qr-box {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 30px;
}
.lrwc-qr-box h3 {
    margin: 0 0 10px;
}
.lrwc-qr-box p {
    color: #6b7280;
    margin-bottom: 15px;
}
.lrwc-qr-code {
    display: inline-block;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.lrwc-reward-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}
.lrwc-reward-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}
.lrwc-reward-card h4 {
    margin: 0 0 5px;
    font-size: 14px;
}
.lrwc-reward-btn {
    margin-top: 10px;
    padding: 6px 16px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.lrwc-reward-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}
.lrwc-history-table {
    width: 100%;
    border-collapse: collapse;
}
.lrwc-history-table th,
.lrwc-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.lrwc-history-table th {
    background: #f9fafb;
    font-weight: 600;
}
.lrwc-points-positive {
    color: #10b981;
    font-weight: 600;
}
.lrwc-points-negative {
    color: #ef4444;
    font-weight: 600;
}
