* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.language {
    position: absolute;
    top: 30px;
    right: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language span {
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.language span.active {
    font-weight: 700;
    color: #4FC3F7;
}

.language span:hover {
    color: #4FC3F7;
}

.container {
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
}

.logo {
    margin-bottom: 40px;
    text-align: center;
}

.logo img {
    max-width: 200px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    border-radius: 12px;
}

.title {
    font-size: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 60px;
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.search-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    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: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #4FC3F7;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

.input-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.shield-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.security-code {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: transparent;
    letter-spacing: 1px;
}

.security-code::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.scan-button {
    width: 70px;
    height: 100%;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: all 0.3s ease;
}

.scan-button:hover {
    background: linear-gradient(135deg, #29B6F6 0%, #0288D1 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.4);
}

.scan-button img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.query-button {
    width: 100%;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    border: none;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.query-button:hover {
    background: linear-gradient(135deg, #29B6F6 0%, #0288D1 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.4);
}

.tip {
    margin-top: 30px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.tip-link {
    color: #4FC3F7;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tip-link:hover {
    color: #81D4FA;
    text-decoration: underline;
}

/* QR Scanner Styles */
.qr-scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    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: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
}

.scanner-title {
    font-size: 20px;
    font-weight: 600;
}

.close-scanner {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-scanner:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.video-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

#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: 25px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 50px 0;
}

.loading-spinner.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4FC3F7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Verification Result Styles */
.verification-result {
    margin-top: 50px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease-in-out;
}

.verification-result.show {
    opacity: 1;
    transform: translateY(0);
}

.verify-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.verify-icon.valid {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.verify-icon.invalid {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.verify-icon.valid svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.verify-icon.invalid::before,
.verify-icon.invalid::after {
    content: '';
    position: absolute;
    background-color: white;
    width: 50px;
    height: 8px;
    top: 46px;
}

.verify-icon.invalid::before {
    transform: rotate(45deg);
}

.verify-icon.invalid::after {
    transform: rotate(-45deg);
}

.verification-result p {
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 15px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.verification-result.valid p {
    color: #4CAF50;
}

.verification-result.invalid p {
    color: #f44336;
}

/* WGP Verification Styles */
.wgp-verification-container {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.wgp-info {
    text-align: left;
}

.wgp-branding h4 {
    color: #4FC3F7;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.wgp-branding p {
    color: #e0e0e0;
    margin: 0 0 15px 0;
    font-size: 14px;
    opacity: 0.8;
}

.verification-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.verification-details p {
    margin: 8px 0;
    color: #e0e0e0;
    font-size: 14px;
}

.verification-details strong {
    color: #4FC3F7;
}

/* Language specific styles */
.lang-zh .title {
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        margin-bottom: 30px;
    }
    
    .title {
        font-size: 18px;
        margin-bottom: 50px;
    }
    
    .verification-result {
        padding: 30px 20px;
        margin-top: 30px;
    }
    
    .verify-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 25px;
    }
    
    .verify-icon.valid svg {
        width: 40px;
        height: 40px;
    }
    
    .verify-icon.invalid::before,
    .verify-icon.invalid::after {
        width: 40px;
        height: 6px;
        top: 37px;
    }
    
    .verification-result p {
        font-size: 18px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }

    .verification-qr {
        max-width: 250px;
    }
    
    .scanner-title {
        font-size: 18px;
    }
    
    .scanner-instructions {
        padding: 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    
    .title {
        margin-bottom: 40px;
        font-size: 16px;
    }
    
    .input-group, .query-button {
        height: 55px;
    }
    
    .scan-button {
        width: 60px;
    }
    
    .verification-result {
        padding: 25px 15px;
    }
    
    .verify-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .verify-icon.valid svg {
        width: 35px;
        height: 35px;
    }
    
    .verify-icon.invalid::before,
    .verify-icon.invalid::after {
        width: 35px;
        height: 5px;
        top: 32px;
    }
    
    .verification-result p {
        font-size: 16px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 16px;
    }

    .verification-qr {
        max-width: 200px;
    }
    
    .scanner-title {
        font-size: 16px;
    }
    
    .close-scanner {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .scanner-instructions {
        padding: 15px;
        font-size: 13px;
    }
}

/* QR Code Notification */
.code-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    z-index: 1100;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-notification.fade-out {
    opacity: 0;
}

@media (max-width: 480px) {
    .code-notification {
        width: 90%;
        font-size: 12px;
        padding: 12px 20px;
    }
}

/* Custom Alert Styles */
.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    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: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 80%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-message {
    padding: 30px;
    text-align: center;
    font-size: 16px;
    color: white;
    font-weight: 500;
    line-height: 1.5;
}

.alert-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.alert-button:hover {
    background: linear-gradient(135deg, #29B6F6 0%, #0288D1 100%);
}
