/* Team Building Form Styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
}

.team-building-container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding-bottom: 0;
    margin-bottom: 0;
    width: 100%;
    min-height: 100vh;
}

/* NBV Logo Styles */
.nbv-logo-container {
    text-align: center;
    /* padding: 30px 0 20px 0;
    margin-bottom: 20px; */
    position: relative;
    z-index: 10;
}

.nbv-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    object-fit: contain;
}

.nbv-logo:hover {
    transform: scale(1.02);
}

/* Mobile responsive for logo */
@media (max-width: 768px) {
    
    .nbv-logo {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    
    .nbv-logo {
        max-height: 120px;
    }
}

.form-background {
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 40px 20px 40px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: min-height 0.5s ease-in-out; /* Smooth transition */
}

/* Thu gọn form background sau khi submit */
.form-background.compact {
    min-height: auto;
    padding: 20px 20px 40px 20px; /* Giảm padding trên/dưới */
}

/* Letter Paper Style - giống giấy tập viết */
.letter-paper {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: auto; /* Tự động điều chỉnh height */
    background: transparent;
    margin-top: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible; /* Đảm bảo line không bị cắt */
}

/* Container chứa các dòng viết */
.letter-line-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Bỏ height 100% để có thể dãn ra */
    width: 100%;
    overflow: visible;
    padding: 10px 0; /* Thêm padding để cân đối */
}

/* Mỗi dòng viết */
.writing-line {
    position: relative;
    height: 45px; /* Tăng height để có đủ chỗ cho text */
    margin-bottom: 15px; /* Tăng spacing giữa các dòng */
    display: flex;
    align-items: center; /* Căn giữa theo chiều dọc */
    padding-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Text hiển thị trên line */
.message-text {
    font-family: 'Dancing Script', 'Brush Script MT', cursive;
    font-size: 22px; /* Giảm font size một chút để vừa với dòng */
    color: #0241a1;
    line-height: 1;
    position: absolute;
    top: 50%; /* Căn giữa theo chiều dọc */
    transform: translateY(-50%); /* Căn giữa hoàn hảo */
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 10; /* Tăng z-index để chữ đè lên line */
    text-align: left;
    white-space: nowrap; /* Không cho phép text wrap - để JavaScript xử lý */
    overflow: hidden; /* Ẩn text tràn ra ngoài */
}

/* Hiển thị text */
.message-text.show {
    opacity: 1;
}

/* Đường line để viết */
.line-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.4); /* Dùng rgba thay vì #ffffff42 */
    width: 100%;
    border: none;
    margin: 0;
    border-radius: 0.5px; /* Bo tròn nhẹ */
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Desktop Layout */
.desktop-layout {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    align-items: center; /* Căn giữa theo chiều dọc thay vì stretch */
    justify-content: space-between;
}

.form-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: rgba(0, 0, 0, 0.3); */
    z-index: 1;
}

/* Welcome Message Styles */
.welcome-message {
    border-radius: 15px;
    padding: 5px 15px 15px 15px;
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    position: relative;
    z-index: 2;
    text-align: left;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    /* Bỏ height 100% để có thể dãn ra */
}

.welcome-message h2 {
    color: #333333;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 20px 0;
    text-align: center;
}

.welcome-message p {
    color: #555555;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 15px 0;
    text-align: justify;
}

.welcome-message p:last-of-type {
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}


.section-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 10px 0;
    gap: 15px;
}

.section-divider span {
    font-weight: bold;
    font-size: 18px;
    color: #333333;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}
@media (max-width: 768px) {
    .section-divider {
        justify-content: center; /* Căn giữa trên mobile */
        text-align: center;
        margin: 0!important;
    }
    
    .section-divider span {
        font-size: 28px!important; /* Tăng font size lên 28px trên mobile */
    }
    
    .section-divider hr {
        display: none; /* Ẩn gạch ngang trên mobile */
    }
}
.section-divider hr {
    flex: 1;
    border: none;
    height: 2px;
    background: linear-gradient(to right, #eeff00, #333333);
    margin: 0;
}

.form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px 30px 0px 30px; /* Tăng padding-bottom lên 30px */
    flex: 1;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
    /* Bỏ height 100% để form có thể dãn ra */
    display: flex;
    flex-direction: column;
}
form{
    margin-bottom: 0!important;
}
.team-building-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Bỏ flex: 1 để form có thể tự điều chỉnh chiều cao */
}

.form-group {
    margin-bottom: 0;
}

.form-group:last-child {
    margin-bottom: 0; /* Bỏ margin-bottom cho element cuối */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 10px rgba(0, 124, 186, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 300px; /* Giới hạn max height */
    font-family: inherit;
    overflow-y: auto; /* Scroll khi quá cao */
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
}

.custom-dropdown input[type="text"] {
    cursor: pointer;
    padding-right: 50px;
}

.dropdown-arrow {
    position: absolute;
    right: 15px;
    top: 37%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    line-height: 1;
}

.custom-dropdown.active .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-options.show {
    display: block;
}

.store-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.store-option:hover {
    background-color: #f8f9fa;
}

.store-option:last-child {
    border-bottom: none;
}

.store-option.selected {
    background-color: #007cba;
    color: white;
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 40px;
    margin-top: 10px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 30px;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    vertical-align: middle;
    line-height: 1;
    height: auto;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: white;
    box-sizing: border-box;
    min-width: 20px;
    min-height: 20px;
    display: inline-block;
    vertical-align: middle;
    content: '';
    outline: none;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #007cba;
    background: white;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #007cba;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

.radio-custom:hover {
    border-color: #007cba;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px; /* Thêm margin-top nhỏ */
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 124, 186, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bottom Images */
.bottom-images {
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Event Section Styles */
.event-section {
    position: relative;
    width: 100%;
}

.event-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.event-header span {
    font-weight: bold;
    font-size: 20px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.event-header hr {
    border: none;
    height: 3px;
    background: linear-gradient(to right, #007cba, #005a87);
    margin: 10px auto 0 auto;
    width: 100px;
}


.bottom-img {
    margin-top: 15px!important;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    font-weight: bold;
}

.modal-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.modal-content p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-close-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .desktop-layout {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        height: auto; /* Bỏ height cố định cho mobile */
        min-height: auto;
    }
    
    .welcome-message {
        padding: 5px 15px 15px 15px;
        margin: 0;
        border-radius: 10px;
        margin-bottom: 20px;
        max-width: none;
        width: 100%;
        text-align: center;
        height: auto; /* Bỏ height 100% cho mobile */
    }
    
    .letter-paper {
        min-height: auto; /* Tự động điều chỉnh height */
        margin-top: 15px;
        display: none; /* Ẩn ban đầu trên mobile */
        padding: 10px 5px; /* Giảm padding trái/phải */
        max-height: 400px; /* Giới hạn max height */
    }
    
    .letter-paper.show {
        display: flex; /* Hiện sau khi submit */
    }
    
    .writing-line {
        height: 35px; /* Điều chỉnh để 7 dòng vừa khớp container 350px */
        margin-bottom: 8px; /* Tăng spacing */
    }
    
    .message-text {
        font-size: 20px; /* Tăng font size cho dễ đọc */
        bottom: -6px;
        z-index: 10; /* Đảm bảo chữ đè lên line trên mobile */
    }
    
    .letter-line-container {
        padding: 5px 5px; /* Giảm padding trái/phải để tăng chiều rộng */
    }
    
    .form-wrapper.hidden {
        display: none;
    }
    
    /* Mobile layout */
    .desktop-layout {
        flex-direction: column;
        min-height: auto;
        align-items: center;
    }
    
    .welcome-message {
        height: auto;
        min-height: 300px;
    }
    
    .welcome-message h2 {
        font-size: 20px;
    }
    
    .welcome-message p {
        font-size: 14px;
        text-align: justify;
    }
    
    .section-divider span {
        font-size: 16px;
    }
    
    .event-header {
        padding: 10px 20px;
    }
    
    .event-header span {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .form-wrapper {
        margin-top: -100px!important;
        padding: 25px 20px 5px 20px; /* Giảm padding-bottom cho mobile */
        margin: 0;
        border-radius: 15px;
        max-width: none;
        width: 100%;
        min-width: auto;
        height: auto; /* Bỏ height 100% cho mobile */
    }
    
    .form-wrapper.hidden {
        display: none;
    }
    
    .form-background {
        padding: 20px 10px 20px 10px;
    }
    
    /* Thu gọn form background trên mobile */
    .form-background.compact {
        padding: 15px 10px 20px 10px; /* Giảm padding trên mobile */
    }
    
    .sharing-ticker {
        height: 40px;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        width: 100%;
        transform: none;
        border-radius: 0;
    }
    
    .ticker-content {
        line-height: 40px;
        padding: 0 15px;
    }
    
    .ticker-item {
        font-size: 14px;
        margin-right: 80px;
    }
    
    .radio-group {
        flex-direction: row;
        gap: 30px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .radio-option {
        font-size: 15px;
    }
    
    .bottom-images {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .bottom-img {
        margin-top: 15px;
        width: 100%;
        height: auto;
        border-radius: 0;
        object-fit: contain;
        object-position: center;
        max-width: 100%;
    }
    
    .form-group {
        margin-bottom: 0px; /* Giảm margin cho mobile */
    }
    
    .form-group label {
        font-size: 15px;
    }
    
    .form-group input[type="text"],
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .submit-btn {
        font-size: 16px;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .bottom-img {
        margin-top: 15px;
        height: auto;
        object-fit: contain;
    }
    
    .sharing-ticker {
        height: 45px;
    }
    
    .ticker-content {
        line-height: 45px;
    }
}

@media (max-width: 480px) {
    .welcome-message {
        padding: 5px 15px 15px 15px;
        margin: 15px;
    }
    
    .welcome-message h2 {
        font-size: 18px;
    }
    
    .welcome-message p {
        font-size: 13px;
    }
    
    .section-divider span {
        font-size: 14px;
    }
    
    .event-header span {
        font-size: 16px;
    }
    
    .form-wrapper {
        padding: 25px 15px;
    }
    
    .form-group {
        margin-bottom: 0px;
    }
    
    .radio-group {
        gap: 20px;
    }
    
    .radio-option {
        font-size: 14px;
    }
    
    .radio-custom {
        width: 18px;
        height: 18px;
        margin-right: 8px;
        min-width: 18px;
        min-height: 18px;
        box-sizing: border-box;
        display: inline-block;
        vertical-align: middle;
    }
    
    .radio-option input[type="radio"]:checked + .radio-custom::after {
        width: 8px;
        height: 8px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .modal-content h3 {
        font-size: 20px;
    }
    
    .bottom-img {
        margin-top: 15px;
        height: auto;
        object-fit: contain;
    }
}

/* Custom scrollbar for dropdown */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for form appearance */
.form-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Loading state for form */
.form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-loading .submit-btn {
    background: #ccc;
}

/* Error states */
.form-group.error input,
.form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Device-specific image visibility */
/* Mobile only images - hiển thị trên mobile, ẩn trên desktop */
.mobile-only {
    display: block;
}

/* Desktop only images - ẩn trên mobile, hiển thị trên desktop */
.desktop-only {
    display: none;
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}
