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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.icon-scan {
    width: 40px;
    height: 40px;
    color: #60a5fa;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #9ca3af;
    font-size: 1rem;
}

/* Scanner Card */
.scanner-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

#scanner-container {
    position: relative;
    min-height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

#qr-reader {
    width: 100%;
    border-radius: 12px;
}

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

.scanner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.camera-icon {
    width: 80px;
    height: 80px;
    color: #4b5563;
    margin-bottom: 16px;
}

.scanner-placeholder p {
    color: #9ca3af;
    font-size: 0.95rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

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

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.upload-btn {
    margin-left: 12px;
    background: #6d28d9;
    color: white;
}

.upload-btn:hover {
    background: #5b21b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
}

/* Messages */
.message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.error-message {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: #fca5a5;
}

/* Result Card */
.result-card {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.check-icon {
    width: 24px;
    height: 24px;
    color: #4ade80;
}

.result-header h2 {
    color: #4ade80;
    font-size: 1.5rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-text-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
}

.result-label {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 8px;
}

.result-text {
    color: white;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

.result-meta {
    display: flex;
    gap: 8px;
    font-size: 0.875rem;
    color: #9ca3af;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.result-actions .btn {
    flex: 1;
}

/* Info Card */
.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-card h3 {
    color: #d1d5db;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.info-card li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #60a5fa;
}

/* Install Hint */
.install-hint {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.install-hint p {
    color: #c4b5fd;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 2rem;
    }

    .scanner-card {
        padding: 16px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    #flash-btn {
        width: auto;
        align-self: center;
    }

    .result-actions {
        flex-direction: column;
    }
}

/* Hide html5-qrcode default UI elements */
#qr-reader__dashboard_section {
    display: none !important;
}

#qr-reader__dashboard_section_csr {
    display: none !important;
}

#qr-reader__header_message {
    display: none !important;
}

