* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.bg {
    background-image: url('images/antiCounterfeiting_bg.jpg');
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

.language {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #333;
    font-size: 14px;
}

.language span {
    cursor: pointer;
    font-weight: 500;
}

.language span.active {
    font-weight: 700;
}

.container {
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 80px;
}

.logo {
    margin-bottom: 20px;
    text-align: center;
}

.logo img {
    max-width: 160px;
}

.title {
    font-size: 18px;
    text-align: center;
    color: #333;
    margin-bottom: 80px;
    font-weight: 500;
    line-height: 1.4;
}

.search-container {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease-in-out;
}

.search-container.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.input-group {
    display: flex;
    width: 100%;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.input-wrapper {
    flex: 1;
    height: 100%;
    background-color: transparent;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.shield-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
}

.security-code {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    background: transparent;
}

.scan-button {
    width: 60px;
    height: 100%;
    background-color: #FFE600;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.scan-button img {
    width: 24px;
    height: 24px;
}

.query-button {
    width: 100%;
    height: 50px;
    border-radius: 4px;
    background-color: #FFE600;
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.query-button:hover {
    background-color: #FFD700;
}

.tip {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.tip-link {
    color: #333;
    text-decoration: underline;
    cursor: pointer;
}

/* QR Scanner Styles */
.qr-scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qr-scanner-container.active {
    opacity: 1;
    visibility: visible;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #000;
    color: #fff;
}

.scanner-title {
    font-size: 18px;
    font-weight: 500;
}

.close-scanner {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}

.video-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

#qr-video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.scanner-instructions {
    text-align: center;
    padding: 20px;
    background-color: #000;
    color: #fff;
    font-size: 16px;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 40px 0;
}

.loading-spinner.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #FFE600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Verification Result Styles */
.verification-result {
    margin-top: 40px;
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
}

.verification-result.show {
    opacity: 1;
    transform: translateY(0);
}

.verify-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.verify-icon.valid {
    background-color: #19A78E;
}

.verify-icon.invalid {
    background-color: #e74c3c;
}

/* Cross icon in the verification result */
.verify-icon.valid svg {
    width: 36px;
    height: 36px;
    fill: white;
}

/* Red cross mark */
.verify-icon.invalid::before,
.verify-icon.invalid::after {
    content: '';
    position: absolute;
    background-color: white;
    width: 40px;
    height: 8px;
    top: 36px;
}

.verify-icon.invalid::before {
    transform: rotate(45deg);
}

.verify-icon.invalid::after {
    transform: rotate(-45deg);
}

.verification-result p {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.verification-result.valid p {
    color: #19A78E;
}

.verification-result.invalid p {
    color: #e74c3c;
}

/* QR Code Styles */
.qr-code-container {
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.verification-qr {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 4px;
}

/* Language specific styles */
.lang-zh .title {
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        margin-bottom: 40px;
    }
    
    .title {
        font-size: 16px;
        margin-bottom: 60px;
    }
    
    .verification-result {
        padding: 20px;
    }
    
    .verify-icon {
        width: 60px;
        height: 60px;
    }
    
    .verify-icon.valid svg {
        width: 28px;
        height: 28px;
    }
    
    /* Adjust cross mark for smaller screens */
    .verify-icon.invalid::before,
    .verify-icon.invalid::after {
        width: 30px;
        height: 6px;
        top: 27px;
    }
    
    .verification-result p {
        font-size: 16px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }

    .verification-qr {
        max-width: 300px;
    }
    
    .scanner-title {
        font-size: 16px;
    }
    
    .scanner-instructions {
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    
    .title {
        margin-bottom: 40px;
    }
    
    .input-group, .query-button {
        height: 45px;
    }
    
    .scan-button {
        width: 50px;
    }
    
    .verification-result {
        padding: 15px;
    }
    
    .verify-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    
    .verify-icon.valid svg {
        width: 24px;
        height: 24px;
    }
    
    /* Adjust cross mark for mobile screens */
    .verify-icon.invalid::before,
    .verify-icon.invalid::after {
        width: 25px;
        height: 5px;
        top: 22px;
    }
    
    .verification-result p {
        font-size: 14px;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 14px;
    }

    .verification-qr {
        max-width: 250px;
    }
    
    .scanner-title {
        font-size: 14px;
    }
    
    .close-scanner {
        font-size: 24px;
    }
    
    .scanner-instructions {
        padding: 10px;
        font-size: 12px;
    }
}

/* QR Code Notification */
.code-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1100;
    font-size: 14px;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.code-notification.fade-out {
    opacity: 0;
}

@media (max-width: 480px) {
    .code-notification {
        width: 90%;
        font-size: 12px;
        padding: 10px 15px;
    }
}

/* Custom Alert Styles */
.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert.active {
    opacity: 1;
    visibility: visible;
}

.alert-content {
    background-color: white;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.alert-message {
    padding: 20px;
    text-align: center;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.alert-button {
    width: 100%;
    padding: 12px;
    background-color: #FFE600;
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.alert-button:hover {
    background-color: #FFD700;
}