/* QR Code Generator - Beautiful Design */

/* Container với background gradient */
.qr-code-generator-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0;
}

/* Main wrapper với glass effect */
.qr-generator-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

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

/* Title với gradient text */
.qr-generator-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 35px 0;
    padding-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}

.qr-generator-form {
    margin-bottom: 30px;
}

/* Input group styling */
.qr-input-group {
    margin-bottom: 25px;
}

.qr-input-group label {
    display: block;
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
}

#qr-text-input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
    box-sizing: border-box;
    background: #f8fafc;
}

#qr-text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #ffffff;
}

#qr-text-input::placeholder {
    color: #a0aec0;
}

/* Options group */
.qr-options-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.qr-option {
    display: flex;
    flex-direction: column;
}

.qr-option label {
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
}

.qr-option select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
    color: #2d3748;
}

.qr-option select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.qr-option input[type="color"] {
    height: 50px;
    padding: 5px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-option input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* Buttons với hiệu ứng đẹp */
.qr-generate-button,
.qr-clear-button,
.qr-download-button {
    padding: 16px 35px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.qr-generate-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.qr-generate-button:hover {
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
    transform: translateY(-3px);
}

.qr-generate-button:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Ripple effect */
.qr-generate-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.qr-generate-button:active::after {
    width: 300px;
    height: 300px;
}

.qr-clear-button {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.35);
}

.qr-clear-button:hover {
    box-shadow: 0 12px 35px rgba(245, 101, 101, 0.45);
    transform: translateY(-3px);
}

/* Result Container với hiệu ứng đẹp */
.qr-result-container {
    text-align: center;
    padding: 35px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    margin-top: 30px;
    border: 2px solid #e2e8f0;
    animation: fadeInUp 0.5s ease-out;
}

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

.qr-result-container h3 {
    color: #2d3748;
    font-size: 22px;
    margin: 0 0 25px 0;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#qr-code-result {
    display: inline-block;
    padding: 25px;
    background: white;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#qr-code-result:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* QRCode.js tạo cả canvas và img - chỉ hiển thị 1 cái */
#qr-code-result img {
    display: none !important;
}

#qr-code-result canvas {
    display: block !important;
    margin: 0 auto;
}

.qr-download-button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.35);
}

.qr-download-button:hover {
    box-shadow: 0 12px 35px rgba(72, 187, 120, 0.45);
    transform: translateY(-3px);
}

/* Banner Container đẹp */
.qr-banner-container {
    width: 100%;
    min-height: 90px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.qr-banner-container > * {
    width: 100%;
    max-width: 100%;
}

.qr-banner-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.qr-banner-placeholder p {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.qr-banner-placeholder small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

/* Banner ad specific styles */
.qr-banner-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.qr-banner-container a {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.qr-banner-container a:hover {
    transform: scale(1.01);
    opacity: 0.95;
}

/* Admin Styles */
.qr-admin-content {
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 25px;
}

.qr-admin-content h2 {
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
    margin-top: 35px;
}

.qr-admin-content h3 {
    color: #4a5568;
    margin-top: 28px;
}

.qr-admin-content code {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    padding: 5px 10px;
    border-radius: 6px;
    color: #764ba2;
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 14px;
}

.qr-admin-content ul,
.qr-admin-content ol {
    line-height: 2;
    color: #4a5568;
}

.qr-admin-content li {
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .qr-code-generator-container {
        padding: 20px 15px;
    }
    
    .qr-generator-wrapper {
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .qr-generator-title {
        font-size: 26px;
    }
    
    .qr-options-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .qr-code-generator-container {
        padding: 15px 10px;
    }
    
    .qr-generator-wrapper {
        padding: 25px 20px;
    }
    
    .qr-generator-title {
        font-size: 22px;
    }
    
    .qr-generate-button,
    .qr-clear-button,
    .qr-download-button {
        padding: 14px 25px;
        font-size: 14px;
    }
    
    #qr-code-result {
        padding: 15px;
    }
}

/* Hover animations cho các elements */
.qr-option select:hover,
.qr-option input[type="color"]:hover {
    border-color: #667eea;
}

#qr-text-input:hover {
    border-color: #667eea;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading animation (optional) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.qr-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Gradient animation cho banner */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.qr-banner-animated {
    background: linear-gradient(270deg, #667eea, #764ba2, #f56565, #48bb78);
    background-size: 800% 800%;
    animation: gradientShift 10s ease infinite;
}

/* Focus visible cho accessibility */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}
