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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.screen {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login Screen */
.logo {
    font-size: 80px;
    text-align: center;
    margin: 60px 0 20px;
}

h1 {
    text-align: center;
    color: #4F46E5;
    margin-bottom: 40px;
    font-size: 28px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #4F46E5;
}

button {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:active {
    transform: scale(0.98);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logout {
    background: #ef4444;
    padding: 8px 15px;
    border-radius: 20px;
}

/* Scan Button */
.scan-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 18px;
    margin: 20px 0;
}

/* Receipts List */
.receipts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.receipt-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid #4F46E5;
}

.receipt-card h4 {
    color: #4F46E5;
    margin-bottom: 8px;
}

.receipt-card .store {
    font-weight: 600;
    margin-bottom: 5px;
}

.receipt-card .total {
    font-size: 20px;
    font-weight: bold;
    color: #10b981;
    margin: 8px 0;
}

.receipt-card .date {
    color: #6b7280;
    font-size: 12px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-content.loading {
    text-align: center;
    padding: 40px;
}

video {
    width: 100%;
    height: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #4F46E5;
    color: white;
}

.close-modal {
    background: none;
    font-size: 24px;
    padding: 0;
    width: 30px;
}

.capture-btn {
    width: 100%;
    border-radius: 0;
    background: #4F46E5;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4F46E5;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Install Button */
.install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4F46E5;
    border-radius: 50px;
    padding: 12px 20px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .install-btn {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 14px;
    }
}
