/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    font-size: 16px; /* Base font size for mobile */
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* Hero Section - Mobile First */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    padding: 1rem 0;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 2.5rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
    padding: 0 1rem;
}

/* Options Grid - Mobile First */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.option-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.option-card:hover .card-hover {
    opacity: 1;
    transform: translateX(0);
}

.option-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.option-card:hover .option-icon {
    transform: scale(1.1);
}

.option-icon i {
    font-size: 1.8rem;
    color: white;
}

.option-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #333;
}

.option-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.card-hover {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    opacity: 0;
    transition: all 0.3s ease;
    color: #667eea;
    font-size: 1.3rem;
}

/* Features - Mobile First */
.features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.feature i {
    color: #ffd700;
    font-size: 1rem;
}

/* Header - Mobile First */
.header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding: 0 1rem;
}

.back-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) translateX(-3px);
}

.header h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
    padding: 0 2rem;
}

.qr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Form - Mobile First */
.invoice-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    margin: 0 0.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-of-type {
    margin-bottom: 1.5rem;
}

.form-section h2 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2 i {
    color: #667eea;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group label i {
    color: #667eea;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    min-height: 48px; /* Better touch target */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

/* Buttons - Mobile First */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    min-height: 48px; /* Better touch target */
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255,255,255,0.9);
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Result Cards - Mobile First */
.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 100%;
    margin: 0 0.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.result-card.success .result-icon {
    color: #28a745;
}

.result-card.error .result-icon {
    color: #dc3545;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.result-card h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.result-card p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.result-details {
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.detail-item i {
    color: #667eea;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

/* Modal Styles - Mobile First */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* QR Tab Bar */
.qr-tab-bar {
    display: flex;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    gap: 0.3rem;
}

.qr-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

.qr-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.qr-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.qr-tab i {
    font-size: 1rem;
}

/* Tab Content Header */
.tab-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.tab-content-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.tab-content-title i {
    color: #667eea;
    font-size: 1.1rem;
}

.tab-content-controls {
    display: flex;
    gap: 0.5rem;
}

/* QR Options - Mobile First (Legacy - keeping for compatibility) */
.qr-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.qr-option {
    background: rgba(255,255,255,0.8);
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.qr-option:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.qr-option-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
}

.qr-option-icon i {
    font-size: 1.3rem;
    color: white;
}

.qr-option h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #333;
}

.qr-option p {
    font-size: 0.8rem;
    color: #666;
}

/* Camera Section - Mobile First */
.camera-container {
    position: relative;
    margin-bottom: 1.2rem;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

#camera {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #000;
    border: 2px solid #ddd;
}

#camera:not([srcObject]) {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.camera-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.camera-status i {
    font-size: 8px;
    color: #ffc107;
}

.camera-status.ready i {
    color: #28a745;
}

.camera-status.error i {
    color: #dc3545;
}

.camera-permission-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

.permission-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 350px;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    animation: permissionSlideIn 0.3s ease-out;
}

@keyframes permissionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes permissionPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 25px 80px rgba(220, 53, 69, 0.2);
    }
}

.permission-content i {
    font-size: 3.5rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.permission-content h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.permission-content p {
    margin: 0 0 1.5rem 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

.permission-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.permission-actions .btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    min-height: 48px;
}

.permission-help {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.permission-help small {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.permission-help i {
    color: #667eea;
    font-size: 0.9rem;
}

.scan-frame {
    width: 180px;
    height: 180px;
    border: 3px solid #ffd700;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    position: relative;
}

.scan-frame::before,
.scan-frame::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid #ffd700;
}

.scan-frame::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.scan-frame::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.camera-overlay p {
    background: rgba(0,0,0,0.7);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Section Header - Compact layout for camera and upload sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.section-title i {
    color: #667eea;
    font-size: 1.1rem;
}

.section-controls {
    display: flex;
    gap: 0.5rem;
}

/* Small button variant */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-height: auto;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    justify-content: center;
}

/* Upload Section - Mobile First */
.upload-container {
    margin-bottom: 1.2rem;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.05);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-area:hover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.upload-area i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.8rem;
}

.upload-area h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.file-types {
    display: block;
    font-size: 0.75rem;
    color: #999;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    display: inline-block;
}

/* Upload controls removed - now using section-header */

/* Desktop and Tablet Styles */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding: 2rem;
    }
    
    .hero-section {
        margin-bottom: 4rem;
        padding: 2rem 0;
    }
    
    .logo {
        flex-direction: row;
        gap: 1rem;
    }
    
    .logo i {
        font-size: 3rem;
    }
    
    .logo h1 {
        font-size: 3.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        margin-bottom: 4rem;
    }
    
    .option-card {
        padding: 2.5rem;
        min-height: 250px;
    }
    
    .option-icon {
        width: 80px;
        height: 80px;
    }
    
    .option-icon i {
        font-size: 2rem;
    }
    
    .option-card h3 {
        font-size: 1.5rem;
    }
    
    .option-card p {
        font-size: 1rem;
    }
    
    .features {
        flex-direction: row;
        gap: 3rem;
    }
    
    .feature {
        font-size: 1rem;
    }
    
    .feature i {
        font-size: 1.2rem;
    }
    
    .header {
        margin-bottom: 3rem;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .invoice-form {
        padding: 2.5rem;
        margin: 0;
    }
    
    .form-section h2 {
        font-size: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .form-actions {
        flex-direction: row;
        gap: 1rem;
    }
    
    .btn {
        width: auto;
        min-width: 140px;
    }
    
    .result-card {
        padding: 3rem;
        margin: 0 auto;
        max-width: 600px;
    }
    
    .result-card h1 {
        font-size: 2.5rem;
    }
    
    .result-actions {
        flex-direction: row;
        gap: 1rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 90%;
        max-width: 600px;
    }
    
    .modal-header {
        padding: 1.5rem 2rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .qr-options {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .qr-option {
        min-height: 150px;
        padding: 1.5rem;
    }
    
    .qr-option-icon {
        width: 60px;
        height: 60px;
    }
    
    .qr-option-icon i {
        font-size: 1.5rem;
    }
    
    .qr-option h3 {
        font-size: 1.1rem;
    }
    
    .qr-option p {
        font-size: 0.9rem;
    }
    
    .camera-controls {
        flex-direction: row;
        gap: 1rem;
    }
    
    #camera {
        height: 300px;
    }
    
    .scan-frame {
        width: 200px;
        height: 200px;
    }
    
    .upload-area {
        padding: 3rem 2rem;
        min-height: 180px;
    }
    
    .upload-area i {
        font-size: 3rem;
    }
    
    .upload-area h3 {
        font-size: 1.3rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .container {
        padding: 3rem;
    }
    
    .hero-section {
        margin-bottom: 5rem;
    }
    
    .logo h1 {
        font-size: 4rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .options-grid {
        gap: 3rem;
        margin-bottom: 5rem;
    }
    
    .option-card {
        padding: 3rem;
        min-height: 280px;
    }
    
    .option-icon {
        width: 90px;
        height: 90px;
    }
    
    .option-icon i {
        font-size: 2.2rem;
    }
    
    .option-card h3 {
        font-size: 1.6rem;
    }
    
    .option-card p {
        font-size: 1.1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card,
.invoice-form,
.result-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .option-card:hover,
    .btn:hover,
    .modal-close:hover {
        transform: none;
    }
    
    .option-card:active,
    .btn:active,
    .modal-close:active {
        transform: scale(0.98);
    }
}

/* API Configuration Page Styles */
.api-config-container {
    max-width: 800px;
    margin: 0 auto;
}

.response-container {
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e1e5e9;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.response-status {
    font-weight: 600;
    font-size: 1rem;
}

.response-status.success {
    color: #28a745;
}

.response-status.error {
    color: #dc3545;
}

.response-data {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.examples-container {
    display: grid;
    gap: 1.5rem;
}

.example-item {
    background: rgba(255,255,255,0.8);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
}

.example-item h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.example-item pre {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
}

.example-item code {
    color: #333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: 36px;
}

/* Mobile responsive for API config */
@media (max-width: 768px) {
    .api-config-container {
        margin: 0 0.5rem;
    }
    
    .response-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .example-item {
        padding: 1rem;
    }
    
    .example-item pre {
        font-size: 0.8rem;
        padding: 0.8rem;
    }
}

/* API Section on Homepage */
.api-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.api-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.api-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

/* E-Receipt Page Styles */
.receipt-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    margin: 0 0.5rem 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.receipt-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e1e5e9;
}

.receipt-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.receipt-icon i {
    font-size: 2rem;
    color: white;
}

.receipt-header h2 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.receipt-details {
    margin-bottom: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.detail-label i {
    color: #667eea;
    font-size: 1.1rem;
}

.detail-value {
    font-size: 1rem;
    color: #666;
    text-align: right;
    font-weight: 500;
}

.detail-value.amount {
    color: #28a745;
    font-weight: 700;
    font-size: 1.2rem;
}

.detail-value.discount {
    color: #dc3545;
    font-weight: 600;
}

/* Order Items Section */
.order-items-section {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-items-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.order-items-header i {
    color: #667eea;
    font-size: 1.1rem;
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.order-item-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.order-item-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
}

.order-item-meta {
    font-size: 0.8rem;
    color: #888;
}

.order-item-price {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.receipt-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    margin-bottom: 1rem;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
}

.loading-state p {
    color: #666;
    font-size: 1rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 2rem 1rem;
}

.error-icon {
    margin-bottom: 1rem;
}

.error-icon i {
    font-size: 3rem;
    color: #dc3545;
}

.error-state h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Mobile responsive for receipt */
@media (max-width: 768px) {
    .receipt-card {
        margin: 0 0.5rem 2rem;
        padding: 1.5rem 1rem;
    }
    
    .receipt-icon {
        width: 70px;
        height: 70px;
    }
    
    .receipt-icon i {
        font-size: 1.8rem;
    }
    
    .receipt-header h2 {
        font-size: 1.3rem;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1.2rem 0;
    }
    
    .detail-value {
        text-align: left;
        font-size: 1.1rem;
    }
    
    .detail-value.amount {
        font-size: 1.3rem;
    }

    .order-item {
        flex-wrap: wrap;
        padding: 0.6rem;
    }

    .order-item-image {
        width: 40px;
        height: 40px;
    }

    .order-item-name {
        font-size: 0.9rem;
    }

    .order-item-price {
        width: 100%;
        text-align: right;
        padding-top: 0.25rem;
        border-top: 1px dashed #e1e5e9;
        margin-top: 0.25rem;
    }
}

/* Info Message */
.info-message {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #667eea;
    font-weight: 600;
    font-size: 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.info-message i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.info-message span {
    text-align: center;
    line-height: 1.5;
}

/* Desktop styles for receipt */
@media (min-width: 768px) {
    .receipt-card {
        max-width: 600px;
        margin: 0 auto 4rem;
        padding: 2.5rem;
    }
    
    .receipt-icon {
        width: 90px;
        height: 90px;
    }
    
    .receipt-icon i {
        font-size: 2.2rem;
    }
    
    .receipt-header h2 {
        font-size: 1.8rem;
    }
    
    .detail-row {
        padding: 1.5rem 0;
    }
    
    .detail-label {
        font-size: 1.1rem;
    }
    
    .detail-value {
        font-size: 1.1rem;
    }
    
    .detail-value.amount {
        font-size: 1.4rem;
    }
    
    .info-message {
        font-size: 1.1rem;
        padding: 1.2rem 2rem;
    }
    
    .info-message i {
        font-size: 1.5rem;
    }
}

/* Mobile styles for QR modal section headers */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
        padding: 0.6rem 0;
    }
    
    .section-title {
        justify-content: center;
        font-size: 0.9rem;
    }
    
    .section-controls {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .section-controls .btn-sm {
        flex: 1;
        max-width: 120px;
        padding: 0.6rem 0.8rem;
    }
    
    /* Tab bar mobile styles */
    .qr-tab-bar {
        margin-bottom: 1rem;
        padding: 0.2rem;
    }
    
    .qr-tab {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .qr-tab span {
        display: none; /* Hide text on very small screens */
    }
    
    .qr-tab i {
        font-size: 1.1rem;
    }
    
    /* Tab content header mobile styles */
    .tab-content-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
        padding: 0.6rem 0;
    }
    
    .tab-content-title {
        justify-content: center;
        font-size: 0.9rem;
    }
    
    .tab-content-controls {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .tab-content-controls .btn-sm {
        flex: 1;
        max-width: 120px;
        padding: 0.6rem 0.8rem;
    }
    
    /* Permission prompt mobile styles */
    .permission-content {
        max-width: 320px;
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .permission-content i {
        font-size: 3rem;
    }
    
    .permission-content h4 {
        font-size: 1.2rem;
    }
    
    .permission-content p {
        font-size: 0.9rem;
    }
    
    .permission-actions .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .permission-help small {
        font-size: 0.8rem;
    }
}
