/* Global 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: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-link {
    background: none;
    color: #007bff;
    text-decoration: underline;
    padding: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Cards */
.setup-card,
.login-card,
.business-select-card {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.business-card {
    width: 100%;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.3s;
}

.business-card:hover {
    border-color: #007bff;
}

.business-card h3 {
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

/* Scan Page (iPad Optimized) */
.scan-container {
    max-width: 100%;
    padding: 20px;
}

.scan-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.scan-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.qr-input {
    width: 100%;
    padding: 20px;
    font-size: 32px;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
}

.customer-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.customer-info {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.customer-info p {
    margin-bottom: 10px;
    font-size: 18px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 22px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn {
    flex: 1;
}

.override-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.override-section input {
    margin-top: 10px;
    padding: 10px;
    width: 100%;
}

.reward-item {
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

/* Customer Pages */
.customer-container {
    max-width: 100%;
    padding: 20px;
}

.customer-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.customer-header h1 {
    margin-bottom: 10px;
    font-size: 24px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.slices-display {
    text-align: center;
}

.slices-count {
    font-size: 48px;
    margin-bottom: 20px;
}

.slices-count .current {
    color: #28a745;
    font-weight: bold;
}

.slices-count .separator {
    color: #666;
    margin: 0 10px;
}

.slices-count .required {
    color: #666;
}

.slices-count .label {
    display: block;
    font-size: 18px;
    color: #666;
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 16px;
    color: #666;
}

.rewards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reward-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.reward-icon {
    font-size: 32px;
    margin-right: 15px;
}

.reward-details p {
    margin: 5px 0;
}

.reward-details .expiry {
    color: #666;
    font-size: 14px;
}

.reward-details .reward-date {
    color: #999;
    font-size: 12px;
}

.no-rewards {
    text-align: center;
    color: #666;
    padding: 20px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.activity-icon {
    font-size: 24px;
    margin-right: 15px;
}

.activity-details p {
    margin: 5px 0;
}

.activity-date {
    color: #666;
    font-size: 14px;
}

.customer-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.qr-code-display {
    font-size: 32px;
    font-family: monospace;
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    letter-spacing: 4px;
    margin: 15px 0;
}

.danger-zone {
    border: 2px solid #dc3545;
}

.danger-zone h2 {
    color: #dc3545;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Admin Pages */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.info-box {
    background-color: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.info-box ul {
    margin: 10px 0 0 20px;
}

.success-message {
    text-align: center;
}

.success-message h1 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .setup-card,
    .login-card,
    .register-card {
        padding: 20px;
        margin: 20px auto;
    }
    
    .qr-input {
        font-size: 24px;
        padding: 15px;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
    
    .customer-container {
        padding: 10px;
    }
    
    .slices-count {
        font-size: 36px;
    }
    
    .qr-code-display {
        font-size: 24px;
    }
}

/* iPad Specific Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .scan-container {
        padding: 40px;
    }
    
    .qr-input {
        font-size: 36px;
        padding: 25px;
    }
    
    .customer-info p {
        font-size: 20px;
    }
    
    .btn-large {
        padding: 20px 40px;
        font-size: 20px;
    }
    
    .modal-content {
        max-width: 700px;
        padding: 40px;
    }
    
    .modal .close {
        font-size: 42px;
        padding: 15px 25px;
    }
    
    .reward-item {
        padding: 35px !important;
    }
    
    .reward-item button {
        padding: 25px !important;
        font-size: 24px !important;
    }
    
    .reward-checkbox {
        width: 40px !important;
        height: 40px !important;
        cursor: pointer;
    }
    
    .reward-item-selectable {
        cursor: pointer;
    }
    
    .reward-item-selectable:hover {
        transform: translateY(-5px) !important;
    }
}

/* Branded Header */
.rewards-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.rewards-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rewards-brand {
    display: flex;
    align-items: center;
}

.rewards-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.rewards-logo {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.logo-icon {
    font-size: 28px;
}

.rewards-brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    margin: 2px 0 0 0;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rewards-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rewards-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.rewards-nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

.nav-logout {
    background-color: rgba(255,255,255,0.2);
}

.nav-logout:hover {
    background-color: rgba(255,255,255,0.3);
}

/* Branded Footer */
.rewards-footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.8);
    margin-top: 60px;
    padding: 30px 20px;
}

.rewards-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.rewards-footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

/* Update body to account for sticky header */
body {
    padding-bottom: 0;
}

/* Update admin container to work with new header */
.admin-container {
    padding-top: 20px;
}

/* Responsive header */
@media (max-width: 768px) {
    .rewards-header-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .rewards-brand {
        width: 100%;
        justify-content: center;
    }
    
    .rewards-nav {
        width: 100%;
        justify-content: center;
    }
    
    .brand-name {
        font-size: 20px;
    }
    
    .rewards-logo {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
}

