* {
    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;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    min-height: 100vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.progress-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
}

.progress-circle.scanned {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-color: #38ef7d;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(56, 239, 125, 0.5);
}

.scanner-section {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.scanner-wrapper {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: transparent;
}

#reader {
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
}

#reader > div {
    border: none !important;
}

#reader video {
    border-radius: 0 !important;
    object-fit: cover;
    border: none !important;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 60%;
    aspect-ratio: 1;
    border: 3px solid rgba(56, 239, 125, 0.8);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        border-color: rgba(56, 239, 125, 0.8);
        box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.5), 0 0 20px rgba(56, 239, 125, 0.5);
    }
    50% {
        border-color: rgba(56, 239, 125, 1);
        box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.5), 0 0 40px rgba(56, 239, 125, 0.8);
    }
}

.status-section {
    margin-top: auto;
}

.status-message {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#statusText {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.status-message.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.status-message.success #statusText {
    color: white;
}

.status-message.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.status-message.error #statusText {
    color: white;
}

.info-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.info-box p {
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 32px 24px;
    border-radius: 20px;
    max-width: 90%;
    width: 320px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
}

.modal-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-content button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-content button:active {
    transform: scale(0.95);
}

.modal-content.success h3 {
    color: #11998e;
}

.modal-content.success button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .progress-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}
