/* --- TẤT CẢ CSS CŨ ĐÃ CÓ TRƯỚC ĐÂY --- */
:root {
    --primary-dark: #111827;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --brand-green: #22c55e;
    --brand-teal: #0d9488;
    --bg-gradient-start: #dcfce7;
    --bg-gradient-end: #e0e7ff;
    --border-color: #cbd5e1;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.5;
}

.site-header {
    background-color: var(--primary-dark);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
}

.logo-icon {
    width: 300px;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
}

    .nav-item:hover, .nav-item.active {
        border-bottom: 2px solid #fff;
    }

.btn-feedback {
    background-color: #fff;
    color: #065f46;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
}

    .btn-feedback:hover {
        background-color: #90c586;

    }

.main-content {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: calc(100vh - 80px);
    padding: 3rem 1.5rem;
}

.page-title {
    text-align: center;
    color: var(--primary-dark);
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
}

    .page-title span {
        color: var(--brand-teal);
    }

.qr-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.qr-controls {
    flex: 1;
}

.qr-preview-area {
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-top: 100px;
}

.qr-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-link {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    font-weight: 600;
    font-family: var(--font-family);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: -2px;
    transition: 0.3s;
}

    .tab-link.active {
        color: var(--primary-dark);
        border-bottom-color: var(--brand-green);
        background: linear-gradient(to top, rgba(34, 197, 94, 0.2) 0%, transparent 100%);
    }

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

    .tab-content.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family);
    background: #fff;
    transition: 0.3s;
}

    .form-control:focus {
        outline: none;
        border-color: var(--brand-teal);
        box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
    }

textarea.form-control {
    resize: none;
    overflow: hidden;
    min-height: 120px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.custom-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

    .custom-row > label {
        width: 120px;
        margin-bottom: 0;
    }

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;

}

.flex-column {
    flex-direction: column;
    align-items: flex-start;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.align-top {
    align-items: flex-start;
}

.color-input-wrapper {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    width: 100%;
    height: 46px;
    margin-bottom:0;
}

    .color-input-wrapper input[type="text"] {
        border: none;
        padding: 0.5rem 1rem;
        flex: 1;
        outline: none;
        font-family: var(--font-family);
        font-size: medium;
    }

.color-picker-btn {
    width: 40px;
    background: #22c55e;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 0 !important;
}

.color-picker-hidden {
    width: 0;
    height: 0;
    visibility: hidden;
    position: absolute;
}

.upload-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    width: 100%;
    transition: border-color 0.3s;
}

    .upload-box:hover {
        border-color: var(--brand-teal);
    }

    .upload-box label {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        cursor: pointer;
        margin: 0 !important;
        color: var(--text-main);
        font-weight: normal;
    }

        .upload-box label i {
            color: #475569;
            font-size: 1.1rem;
        }

        .upload-box label span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

    .upload-box .btn-clear {
        background: none;
        border: none;
        border-left: 1px solid #e2e8f0;
        color: #ef4444;
        padding: 0 1rem;
        align-self: stretch;
        cursor: pointer;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        transition: 0.2s;
    }

        .upload-box .btn-clear:hover {
            background: #fee2e2;
        }

.hidden-file {
    display: none;
}
.bg-templates-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Ép buộc đúng 5 cột/dòng */
    gap: 10px;
    width: 100%;
    flex: 1;
}

.bg-template-item {
    width: 100%;
    aspect-ratio: 3/4; /* Giữ tỷ lệ khung hình chữ nhật đứng y hệt Poster */
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: 0.3s;
}

    .bg-template-item.active, .bg-template-item:hover {
        border-color: var(--brand-teal);
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(13,148,136,0.2);
    }

.xoa-nen {
    width: 80px;
    height: 120px;
    border: dashed 2px #cbd5e1;
    color: #ef444466;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 10px;
    transition: 0.2s;
    border-radius: 6px;
}
    .xoa-nen:hover {
        color: #ef4444;
        border: dashed 2px #ef4444;
    }

.qr-poster {
    width: 320px;
    height: 450px;
    background-color: #cbd5e1;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(34,197,94,0.3) 100%);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: 0.3s;
}

.qr-box-wrapper {
    width: 200px;
    height: 200px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 2;
    top: 80px;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
}

    .qr-placeholder i {
        font-size: 4rem;
        margin-bottom: 0.5rem;
    }

#qrcode-display {
    width: 100%;
    height: 100%;
    display: none;
}

    #qrcode-display img, #qrcode-display canvas {
        width: 100%;
        height: 100%;
    }

#qr-logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50px;
    object-fit: contain;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.poster-credit {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 0.65rem;
    color: #1e293b;
    font-weight: 500;
    z-index: 2;
    font-style: italic;
}

.site-footer {
    background-color: var(--primary-dark);
    color: #cbd5e1;
    padding: 3rem 0 1rem;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-logo .logo-icon {
    color: var(--brand-green);
    font-size: 3rem;
}

.footer-logo .logo-text strong {
    font-size: 1.5rem;
    color: #fff;
}

.slogan {
    margin-top: 0.5rem;
    font-style: italic;
    color: #94a3b8;
}

.footer-heading {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.footer-desc {
    color: var(--brand-green);
    margin-bottom: 1.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: #1e293b;
    color: #fff;
    border-radius: 50%;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: 0.3s;
}

    .social-links a:hover {
        background: var(--brand-green);
    }

.footer-list {
    list-style: none;
}

    .footer-list li {
        margin-bottom: 0.5rem;
    }

    .footer-list a {
        color: var(--brand-green);
        text-decoration: none;
        transition: 0.3s;
    }

        .footer-list a:hover {
            color: #fff;
        }

.map-wrapper img, .map-wrapper iframe {
    width: 100%;
    border-radius: 8px;
    border: 2px solid #1e293b;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 1.5rem 1.5rem 0;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom-links a {
    color: var(--brand-teal);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: 0.3s;
}

    .footer-bottom-links a:hover {
        color: var(--brand-green);
    }
/* ================= CSS MỚI CHO NÚT TẢI XUỐNG CÓ DROPDOWN ================= */
.download-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-download {
    background: var(--brand-teal);
    color: #fff;
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.4);
    transition: 0.3s;
    width: 100%;
    justify-content: center;
}

    .btn-download:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.4);
    }

.download-menu {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 50;
    overflow: hidden;
}

    .download-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.download-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
    text-align: left;
}

    .download-item:last-child {
        border-bottom: none;
    }

    .download-item:hover {
        background: #f8fafc;
    }

    .download-item strong {
        font-size: 1rem;
        color: var(--brand-teal);
    }

    .download-item span {
        font-size: 0.8rem;
        color: var(--text-light);
    }
.custom-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

    .custom-modal.active {
        display: flex;
        animation: fadeInModal 0.2s ease-out forwards;
    }

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.custom-modal.active .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

    .modal-header h2 {
        color: var(--primary-dark);
        font-size: 1.5rem;
        margin: 0;
    }

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.2s;
}

    .close-modal-btn:hover {
        color: #ef4444;
    }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    line-height: 1.7;
    color: var(--text-main);
}
.quick-color-palette {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    width: 80%;
    padding-left: 15px;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 30%;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    transition: 0.2s;
    border: 2px solid transparent;
}

    .color-swatch:hover {
        transform: scale(1.1);
    }

    .color-swatch.active {
        border: 2px solid var(--brand-teal);
        box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3), inset 0 0 0 1px rgba(0,0,0,0.1);
    }