﻿/* ====================================================== */
/* FILE CSS HOÀN CHỈNH - ĐÃ SỬA LỖI              */
/* ====================================================== */

@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;700&display=swap");

:root {
    --primary-color: #dc3545;
    --primary-color-hover: #c82333;
    --bs-danger-text-stable: #dc3545;
    --completed-color: #198754;
}

body, input, button, select, textarea {
    font-family: "Be Vietnam Pro", sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    font-family: "Be Vietnam Pro", sans-serif;
    background-color: #f8f9fa;
}

.card {
    border: none;
    border-radius: 0px;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s;
}

    .form-step.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ===== HEADER MỚI ===== */
.main-header-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color); 
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}


@media (max-width: 576px) {
    .main-header-title {
        font-size: 2rem;
    }

 
}

.progress-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto 3.5rem;
}

.progress-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background-color: #e0e0e0;
    width: 100%;
    z-index: 1;
}

.progress-bar-fill {
    /* Đảm bảo thanh màu xanh nằm gọn trong thanh màu xám */
    height: 100%;
    background-color: var(--completed-color);
    width: 0%;
    transition: width 0.4s ease-in-out;
    border-radius: 4px;
}

.progress-step {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: all 0.4s ease;
    position: relative;
    color: #999;
    font-size: 1.1rem;
    font-weight: 700;
}

    .progress-step .step-number {
        display: block;
        transition: opacity 0.3s ease;
    }

    .progress-step .step-check {
        display: none;
        font-size: 1.1rem;
    }

    .progress-step.completed {
        border-color: var(--completed-color);
        background-color: var(--completed-color);
        color: #fff;
    }

        .progress-step.completed .step-number {
            display: none;
        }

        .progress-step.completed .step-check {
            display: block;
        }

    .progress-step.active {
        border-color: var(--primary-color);
        background-color: var(--primary-color);
        color: #fff;
        transform: scale(1.15);
        box-shadow: 0 0 15px rgba(220, 53, 69, 0.4);
    }

    .progress-step::after {
        content: attr(data-title);
        position: absolute;
        top: 48px;
        font-size: 11px;
        color: #6c757d;
        width: 80px;
        text-align: center;
    }

.image-preview-container {
    width: 150px;
    height: 150px;
    border: 3px solid #eee;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .image-preview-container:hover {
        transform: scale(1.02);
    }

#HinhThe-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

    .review-section:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
    }

.review-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.review-section dd {
    font-weight: 500;
    word-break: break-all;
}

.review-image-thumbnail {
    width: 120px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.07);
}

.btn-danger,
.btn-light,
.btn-success {
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 500;
}

.btn-danger {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-danger:hover {
        background-color: var(--primary-color-hover);
        border-color: var(--primary-color-hover);
    }

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: .875em;
    color: var(--bs-danger-text-stable) !important;
}

.is-invalid ~ .invalid-feedback,
.is-invalid .invalid-feedback {
    display: block;
}

/* ================================== */
/* SELECT2 OVERRIDES                  */
/* ================================== */
.select2-container {
    width: 100% !important;
}

    .select2-container .select2-selection--single {
        height: calc(1.5em + .5rem + 2px);
        padding: .375rem .75rem;
        border: 1px solid #dee2e6;
        border-radius: .375rem;
        display: flex;
        align-items: center;
    }

.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 0.9rem; /* <-- THÊM DÒNG NÀY ĐỂ ĐỒNG BỘ FONT */
    line-height: 1.5;
    padding-left: 0;
    color: #212529;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    position: absolute;
    top: 0;
    right: 0.75rem;
    display: flex;
    align-items: center;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

.form-select.is-invalid + .select2-container .select2-selection--single {
    border-color: #dc3545;
}

.select2-dropdown {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

/* ===== FIX: Cho phép chữ trong dropdown xuống dòng VÀ đồng bộ font-size ===== */
.select2-results__option {
    font-size: 0.9rem; /* <-- THÊM DÒNG NÀY ĐỂ ĐỒNG BỘ FONT */
    white-space: normal !important;
    word-wrap: break-word;
}
/* ======================================================= */


/* ================================== */
/* OTHER UTILITIES                    */
/* ================================== */

.field {
    position: absolute;
    left: -5000px;
    opacity: 0;
    pointer-events: none;
}

#loader img {
    max-width: 1050px;
    height: auto;
    display: block;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .avatar-upload .invalid-feedback {
        margin-top: 0.5rem;
    }

.form-step .row > [class^="col-"] {
    margin-bottom: 1rem;
}

.form-control,
.form-select {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.9rem;
}

input.form-control,
.form-select {
    height: calc(1.5em + .5rem + 2px);
}

.form-check-label {
    padding-top: 2px;
}

.id-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.id-image-preview {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 16 / 10;
    border: 2px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .id-image-preview:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border-style: solid;
    }

    .id-image-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* ================================== */
/* RESPONSIVE STYLES                  */
/* ================================== */
@media (min-width: 768px) {
    /* Căn chỉnh các label trong form để có cùng chiều cao, tránh bị lệch cột */
    .form-step .row .form-label {
        min-height: 48px; /* Tương đương 2 dòng chữ, có thể điều chỉnh */
    }
}

@media (max-width: 767px) {
    .card.p-4.p-md-5 {
        padding: 1.5rem !important;
    }

    .progress-step::after {
        font-size: 11px;
        width: 65px;
        top: 45px;
    }
}

@media (max-width: 480px) {
    .card.p-4.p-md-5 {
        padding: 1rem !important;
    }

    .progress-step::after {
        display: none;
    }
}
/* Dynamic Entry Styles */
.dynamic-entry {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    background-color: #fdfdfd;
    transition: all 0.3s ease;
}

.btn-add-entry {
    display: block;
    width: 100%;
    border-style: dashed;
}

.btn-remove-entry {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    background-color: #f8f9fa;
}

    .btn-remove-entry:hover {
        background-color: #e2e6ea;
    }
.banner-card {
    position: relative;
    width: calc(100% + 2rem); 
    margin-left: -1rem;
    margin-right: -1rem; 
    max-height: 300px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .banner-card {
        width: calc(100% + 5rem);
        margin-left: -2.5rem;
        margin-right: -2.5rem;
    }
}

.banner-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.banner-card:hover .banner-card-image {
    transform: scale(1.05);
}

.section-card {
    padding: 2rem 1.25rem;
}

@media (min-width: 768px) {
    .section-card {
        padding: 3rem 2rem;
    }
}

#qrWrap {
    position: relative;
}

/* video phải có kích thước thực sự */
#qrVideo {
    display: block !important;
    width: 100% !important;
    max-height: 70vh;
    background: #000; /* để dễ thấy đang phát */
}

/* overlay luôn khớp video và không che đen */
#qrOverlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none; /* tránh cản trở tương tác */
}
/* ===== QR Busy Overlay (global) ===== */
.qr-busy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000
}

    .qr-busy-overlay.d-none {
        display: none !important
    }

.qr-busy-box {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fff;
    padding: .75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18)
}

.id-image-upload.has-error .id-image-preview,
.avatar-upload.has-error .image-preview-container {
    border: 1px dashed #dc3545 !important;
    box-shadow: 0 0 0 .25rem rgba(220,53,69,.15);
}

.id-image-upload .invalid-feedback,
.avatar-upload .invalid-feedback {
    display: block;
}

.col-12 .invalid-feedback {
    display: block;
}
