/* Access Code Popup Styles - Giống Web Demo */
body.access-granted .access-popup-overlay {
    display: none !important;
}

.access-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    animation: overlayFadeIn 0.4s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.access-popup-content {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    text-align: center;
    animation: popupSlideUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.access-popup-content h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.access-popup-content > p {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 15px;
}

#access-code-form {
    margin-bottom: 15px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#access-code-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 28px;
    text-align: center;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    letter-spacing: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

#access-code-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

#access-code-input::placeholder {
    letter-spacing: 10px;
    font-size: 24px;
    color: #ccc;
}

.btn-submit-code {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit-code::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit-code:hover::before {
    left: 100%;
}

.btn-submit-code:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-submit-code:active {
    transform: translateY(-1px);
}

.btn-submit-code:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-submit-code.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.btn-submit-code.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    animation: shake 0.5s ease;
    border-left: 4px solid #c62828;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

.success-message {
    padding: 12px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border-left: 4px solid #2e7d32;
}

.attempts-message {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.attempts-icon {
    font-size: 16px;
}

.attempts-message.warning {
    color: #ff9800;
    font-weight: 600;
}

.attempts-message.warning .attempts-icon {
    animation: pulse 1s ease infinite;
}

.attempts-message.danger {
    color: #f44336;
    font-weight: 700;
}

.attempts-message.danger .attempts-icon {
    animation: shake 0.5s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.demo-contact-info {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.demo-contact-info p {
    margin: 0;
    color: #777;
    font-size: 13px;
}

.demo-contact-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.demo-contact-info a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .access-popup-content {
        padding: 35px 25px;
    }

    .access-popup-content h2 {
        font-size: 24px;
    }

    #access-code-input {
        font-size: 24px;
        letter-spacing: 12px;
        padding: 15px 20px;
    }

    .btn-submit-code {
        padding: 15px;
        font-size: 15px;
    }
}

/* Animation cho số khi nhập */
#access-code-input {
    transition: all 0.2s ease;
}

#access-code-input:not(:placeholder-shown) {
    color: #667eea;
}

#access-code-input.shake {
    animation: inputShake 0.3s ease;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
