/* Ngăn chặn trượt ngang và zoom trên mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch; /* Cho phép cuộn mượt trên iOS */
    overscroll-behavior-x: none; /* Ngăn chặn hiệu ứng bounce trên iOS */
    touch-action: pan-y; /* Chỉ cho phép cuộn dọc, ngăn zoom */
    -webkit-touch-callout: none; /* Ngăn context menu trên iOS */
    -webkit-user-select: none; /* Ngăn select text */
    user-select: none;
}

/* Đảm bảo viewport không bị tràn */
@viewport {
    width: device-width;
    zoom: 1.0;
}

html {
    scroll-behavior: smooth; /* Tạo hiệu ứng cuộn mượt mà */
}

/* Màn hình loading */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 2s ease-out, visibility 2s ease-out;
}

/* Ẩn màn hình loading từ từ */
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Hiệu ứng spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Đảm bảo loading screen luôn nằm chính giữa trên mobile */
@media screen and (max-width: 768px) {
    #loading-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

/* Fix cho các màn hình nhỏ hơn */
@media screen and (max-width: 480px) {
    #loading-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Fix cho các màn hình rất nhỏ */
@media screen and (max-width: 320px) {
    #loading-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* CSS cho Menu Hamburger */
.menu-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 30px;
    cursor: pointer;
    z-index: 100;
}

.hamburger-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px; /* Đảm bảo chiều rộng vừa đủ cho 3 dòng */
    height: 20px; /* Chiều cao tổng thể của hamburger */
}

.hamburger-lines .line {
    height: 4px;
    width: 100%;
    background-color: #333;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Danh sách menu */
.menu-list {
    display: none;
    position: fixed; /* Sử dụng fixed để menu luôn đứng yên trên màn hình khi scroll */
    top: 60px; /* Khoảng cách từ nút hamburger */
    left: 0;
    background-color: rgba(0, 0, 0, 0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 99;
    border-radius: 5px;
    min-width: 200px;
    padding: 10px 0; /* Thêm padding cho menu */
}

.menu-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu-list ul li {
    margin: 0;
}

.menu-list ul li a {
    color: white;
    font-size: 18px;
    text-decoration: none;
    padding: 12px 20px; /* Điều chỉnh padding để link dễ click */
    display: block;
}

.menu-list ul li a:hover {
    background-color: black;
}

/* Hiển thị menu khi nhấn vào icon */
.menu-list.show {
    display: block;
}

/* Biến đổi hamburger khi menu mở */
.menu-icon.open .hamburger-lines .line1 {
    transform: rotate(45deg);
    position: relative;
    top: 10px;
}

.menu-icon.open .hamburger-lines .line2 {
    opacity: 0;
}

.menu-icon.open .hamburger-lines .line3 {
    transform: rotate(-45deg);
    position: relative;
    top: -6px;
}


/* Đặt ảnh nền cưới */
#wedding-background {
    background-image: url('https://ik.imagekit.io/thanhdat/anhcuoi/anhcuoi1.jpg?updatedAt=1746612065999');
    background-size: cover; /* Thay đổi từ 50% auto thành cover */
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 100vh; /* Thay đổi từ height thành min-height */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    z-index: -1;
}

#wedding-background::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* Điều chỉnh cho các màn hình mobile */
@media screen and (max-width: 768px) {
    #wedding-background {
        min-height: 100vh;
        background-size: cover;
        background-position: center;
    }
}

@media screen and (max-width: 480px) {
    #wedding-background {
        min-height: 100vh;
        background-size: cover;
        background-position: center;
    }
}

@media screen and (max-width: 320px) {
    #wedding-background {
        min-height: 100vh;
        background-size: cover;
        background-position: center;
    }
}

/* Điều chỉnh cho các màn hình có chiều cao lớn */
@media screen and (min-height: 800px) {
    #wedding-background {
        min-height: 100vh;
        background-size: cover;
        background-position: center;
    }
}

/* Điều chỉnh cho các màn hình có chiều cao rất lớn */
@media screen and (min-height: 1000px) {
    #wedding-background {
        min-height: 100vh;
        background-size: cover;
        background-position: center;
    }
}

/* Chữ Save The Date */
#save-the-date {
    margin-bottom: 7rem;
}

#save-the-date h1 {
    font-size: 6em;
    margin-bottom: 10px;
    font-weight: bold;
    color: white;
    margin-top: 2em;
}

#save-the-date p {
    font-size: 2em;
    margin-top: 0;
    color: white;
}

/* couple-section */
.couple-section {
    text-align: center;
    margin: 50px auto;
}

.title {
    font-size: 36px;
    font-weight: bold;
    color: #ff4081;
}

.subtitle {
    font-size: 16px;
    color: gray;
    margin-bottom: 30px;
}

.couple-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15%;
    position: relative;
}

.person {
    text-align: center;
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 380px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid red;
    display: inline-block;
}

.image-wrapper img {
    width: 100%;
    height: 115%;
    object-fit: cover;
}

.heart-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 18px;
}

.heart-center {
    font-size: 5em;
    animation: heartbeat 1.2s infinite;
    position: absolute;
    left: 47%;
    top: 25%;
    transform: translateX(-50%);
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); } /* Nhịp đầu */
    50% { transform: scale(1); }
    75% { transform: scale(1.2); } /* Nhịp hai */
    100% { transform: scale(1); }
}

h3 {
    font-size: 22px;
    font-weight: bold;
    margin-top: 10px;
}

p {
    margin: 5px 0;
    font-size: 14px;
}

.social-icon {
    font-size: 24px;
    text-decoration: none;
    display: block;
    margin-top: 10px;
}


/* Wedding Events */
#wedding-events {
    background: white;
    width: 100%;
    padding: 50px 0 0 0; /* Giảm padding bottom xuống 0 */
    position: relative;
    z-index: 1;
    margin-bottom: 0; /* Thêm margin-bottom: 0 */
}

/* Phần tiêu đề */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    margin-bottom: 30px;
    color: #ff4081;
    padding-top: 1rem;
}

/* Bố cục container */
.events-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card sự kiện */
.event-card {
    background: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    max-width: 300px;
    text-align: center;
    padding-bottom: 20px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* Hình ảnh trong card */
.event-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Thêm icon camera ở góc */
.event-card .image-container {
    position: relative;
}

.event-card .image-container::after {
    content: "📸";
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Bỏ hiệu ứng hover cho desktop */
@media (hover: hover) and (pointer: fine) {
    .event-card .image-container::after {
        opacity: 0.7;
    }
}

/* Bỏ hiệu ứng active cho mobile */
@media (hover: none) {
    .event-card:active .image-container::before,
    .event-card:active .image-container::after {
        opacity: 1;
    }
}

/* Bỏ hiệu ứng hover cho event card */
.event-card:hover {
    transform: none;
}

/* Điều chỉnh cho mobile */
@media (max-width: 768px) {
    .event-card .view-more {
        font-size: 1.1rem;
        bottom: 110px; /* Đẩy text lên cao hơn trên mobile */
    }

    .event-card .image-container::after {
        bottom: 10px;
        right: 10px;
        font-size: 1.3rem;
    }
}

/* Tiêu đề sự kiện lớn hơn */
.event-card h3 {
    margin: 15px 0;
    font-size: 1.5rem; /* Tăng kích thước chữ */
    font-weight: bold;
}

/* Làm nổi bật địa điểm */
.event-card p:nth-child(3),
.event-card p:nth-child(4) {
    font-size: 1.2rem;
    font-weight: 400;
    color: #ff4081;
    margin: 12px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    display: block;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff4081; */
    transition: none;
}

.event-card p:nth-child(3)::before,
.event-card p:nth-child(4)::before {
    content: "⏰";
    margin-right: 6px;
    font-size: 1.2em;
}

.event-card p:nth-child(4)::before {
    content: "📍";
}

/* Nút bấm lớn hơn */
.calendar-btn, .map-btn {
    width: 85%;
    padding: 12px;
    margin: 8px;
    font-size: 1.1rem;
    border-radius: 6px;
    transition: none;
    transform: none;
}

/* Loại bỏ hiệu ứng hover và active */
.calendar-btn:hover,
.calendar-btn:active,
.map-btn:hover,
.map-btn:active {
    background-color: #ff758c;
    transform: none;
}

/* Đảm bảo nút active không bị thay đổi kích thước */
.calendar-btn:active,
.map-btn:active {
    background-color: #ff758c !important;
    transform: none !important;
}

/* Body */
body {
    font-family: 'Libre Baskerville', serif;
    background: linear-gradient(to bottom, white, #fad0c4);
    text-align: center;
    overflow: hidden;
    margin: 0;
    overflow-y: auto;
}

/* Định dạng carousel */
.carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

/* Container cho tất cả slides */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Định dạng item trong carousel */
.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
    overflow: hidden;
}

.carousel-item.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 2s ease-in-out;
}

/* Định dạng hình ảnh trong carousel */
.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: none;
}

.carousel-item.active .carousel-image {
    transition: transform 2s ease-in-out;
}

/* Định dạng caption của carousel */
.carousel-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: none;
}

.carousel-item.active .carousel-caption {
    opacity: 1;
    visibility: visible;
    transition: opacity 2s ease-in-out;
}

.carousel-caption h3 {
    font-size: 3.5em;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Playfair Display', serif;
}

.carousel-caption p {
    font-size: 1.2em;
    margin: 15px 0;
    line-height: 1.6;
    color: #ffffff; /* Màu trắng cho text */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Thêm bóng đổ để text nổi bật */
    font-weight: 500; /* Làm đậm chữ một chút */
}

.carousel-caption strong {
    color: #ffffff; /* Đảm bảo text trong thẻ strong cũng màu trắng */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.story-text, .venue-text {
    font-size: 1.2em;
    line-height: 1.8;
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.carousel-item.active .story-text,
.carousel-item.active .venue-text {
    opacity: 1;
    transform: translateY(0);
    transition: all 2s ease-in-out;
}

/* Countdown timer */
#countdown-timer {
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.carousel-item.active #countdown-timer {
    opacity: 1;
    transform: translateY(0);
    transition: all 2s ease-in-out;
}

/* Countdown styles */
#countdown-timer {
    margin-top: 30px;
    transition: all 0.5s ease;
}

#countdown ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0;
    list-style: none;
}

#countdown li {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    min-width: 100px;
    backdrop-filter: blur(5px);
}

#countdown li span {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

/* Nút điều hướng carousel */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.5s ease;
    z-index: 10;
    opacity: 0.6;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* Chỉ số slide */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: white;
    transform: scale(1.2);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .carousel-caption {
        width: 90%;
        padding: 15px;
        top: 45%; /* Điều chỉnh vị trí caption */
    }

    .carousel-caption h3 {
        font-size: 2em; /* Giảm kích thước tiêu đề */
        margin-bottom: 10px;
    }

    .carousel-caption p {
        font-size: 1em;
        line-height: 1.4;
        margin: 10px 0;
    }

    .story-text, .venue-text {
        font-size: 0.9em;
        line-height: 1.4;
        margin-top: 10px;
        padding: 8px;
    }

    #countdown li {
        min-width: 60px; /* Giảm kích thước các ô đếm ngược */
        padding: 10px;
    }

    #countdown li span {
        font-size: 1.8em;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    /* Điều chỉnh cho section couple */
    .couple-container {
        flex-direction: column;
        gap: 40px;
        padding: 0 15px;
    }

    .image-wrapper {
        width: 250px;
        height: 250px;
    }

    .heart-center {
        display: none;
    }

    /* Điều chỉnh cho wedding events */
    .events-container {
        padding: 0 15px;
    }

    .event-card {
        max-width: 380px;
    }

    .event-card img {
        height: 160px;
    }

    /* Điều chỉnh cho địa điểm */
    .event-card p:nth-child(3) {
        font-size: 1.1rem;
    }

    /* Điều chỉnh cho thời gian */
    .event-card p:nth-child(4) {
        font-size: 1.1rem;
        padding: 5px 10px;
    }
}

/* Điều chỉnh thêm cho màn hình nhỏ hơn */
@media screen and (max-width: 480px) {
    .carousel {
        height: 100vh;
    }

    .carousel-caption {
        top: 40%;
    }

    .carousel-caption h3 {
        font-size: 1.8em;
    }

    #countdown li {
        min-width: 50px;
        padding: 8px;
    }

    #countdown li span {
        font-size: 1.5em;
    }

    .image-wrapper {
        width: 300px;
        height: 300px;
    }

    /* Đảm bảo container không bị tràn */
    .container {
        width: 90%;
        margin: 30px auto;
        padding: 15px;
        left: 0;
    }

    /* Điều chỉnh cho địa điểm */
    .event-card p:nth-child(3) {
        font-size: 1rem;
    }

    /* Điều chỉnh cho thời gian */
    .event-card p:nth-child(4) {
        font-size: 1rem;
        padding: 4px 8px;
    }
}

/* Điều chỉnh cho màn hình siêu nhỏ */
@media screen and (max-width: 320px) {
    #wedding-background, .carousel, #wedding-events, .couple-section {
        width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 85%;
        margin: 20px auto;
        padding: 10px;
        left: 0;
    }

    .image-wrapper {
        width: 180px;
        height: 180px;
    }

    .dropdown-content {
        min-width: 250px;
        right: -10px;
    }

    .carousel-caption {
        width: 85%;
        padding: 10px;
    }

    .carousel-caption h3 {
        font-size: 1.5em;
    }

    #countdown li {
        min-width: 45px;
        padding: 5px;
    }

    /* Điều chỉnh cho địa điểm */
    .event-card p:nth-child(3) {
        font-size: 1.1rem;
    }

    /* Điều chỉnh cho thời gian */
    .event-card p:nth-child(4) {
        font-size: 1.1rem;
        padding: 5px 10px;
    }
    .video-section {
        width: 115%;
    }
}

/* Đảm bảo không có scroll ngang và ngăn zoom */
body {
    overflow-x: hidden;
    width: 100%;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Ngăn zoom trên các phần tử quan trọng */
.couple-container,
.person,
.image-wrapper,
.zodiac-sign,
.event-card,
.gallery-item {
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Đảm bảo các phần tử không bị tràn */
.carousel-container, .events-container, .couple-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Container */
.container {
    top: -50px;
    max-width: 600px;
    margin: 50px auto;
    margin-top: 11rem;
    padding: 20px;
    background: #f5e1e1; /* Sử dụng màu hồng nhạt cho nền container */
    border-radius: 15px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1); /* Mờ nhẹ để tạo chiều sâu */
    position: relative;
    z-index: 3; /* Đặt container lên trên ảnh cưới */
}

/* Header */
h1 {
    color: #ff4e50; /* Giữ màu đỏ hồng cho tiêu đề */
    font-size: 2.5em;
}

/* Paragraph */
p {
    color: #333;
    font-size: 1.2em;
}

/* Input và Textarea */
input, textarea {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #ff758c;
    font-size: 1em;
}

/* Button */
button {
    background-color: #ff758c; /* Màu hồng đậm cho nút */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    transition: 0.3s;
    -webkit-tap-highlight-color: transparent; /* Loại bỏ highlight khi tap trên mobile */
}

button:hover {
    background-color: #e84158;
    transform: scale(1.1);
}

/* Giữ màu hồng cho button sau khi nhấn trên mobile */
button:active {
    background-color: #ff758c !important;
    transform: scale(0.95);
}

/* Loại bỏ outline khi focus */
button:focus {
    outline: none;
}

/* Flower Animation */
#flowerCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Hoa rơi ở lớp dưới cùng */
}

/* Hiển thị tin nhắn */
#messages {
    max-height: 300px; /* Giới hạn chiều cao */
    overflow-y: auto;  /* Hiển thị thanh cuộn dọc */
    border: 1px solid #ddd;
    padding: 10px;
    background: #f9f9f9;
}

.message-box {
    position: relative;
    align-items: center;
}

.dropdown {
    position: absolute;
    right: 20px;
    top: 70px;
}

.dropdown .dropdown-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 500px; /* Tăng chiều rộng */
    max-height: 400px; /* Tăng chiều cao */
    overflow-y: auto; /* Hiển thị thanh cuộn nếu nội dung quá dài */
    z-index: 10;
    cursor: pointer;
}
.dropdown-content p {
    padding: 12px; /* Tăng padding cho đẹp hơn */
    font-size: 16px; /* Tăng kích thước chữ để dễ đọc */
}

/* Nút phân trang */
.page-btn {
    margin: 5px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: pink;
    cursor: pointer;
    border-radius: 5px;
    transition: none; /* Loại bỏ transition */
    transform: none; /* Loại bỏ transform */
}

/* Phân trang trang hiện tại */
.active-page {
    background-color: #ff4081 !important; /* Màu hồng nổi bật */
    color: white;
    font-weight: bold;
    border: none;
    transform: none !important; /* Loại bỏ transform */
}

/* Loại bỏ hiệu ứng hover và active */
.page-btn:hover,
.page-btn:active {
    background-color: pink;
    transform: none;
}

/* Đảm bảo nút active không bị thay đổi kích thước */
.active-page:hover,
.active-page:active {
    background-color: #ff4081 !important;
    transform: none !important;
}

/* Toast thông báo */
#toast-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #28a745; /* Xanh lá */
}

.toast.error {
    background-color: #dc3545; /* Đỏ */
}

/* Khung toggle button nhạc */
#music-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 160px;
    height: 31px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    z-index: 1000;
    top: auto;
}

/* Nút nhạc hình tròn */
#music-button {
    min-width: 30px;
    width: 30px;
    height: 30px;
    background-color: #ff4081;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

/* Phần chữ */
#music-text {
    white-space: nowrap;
    font-size: 12px;
    margin-left: 6px;
    padding-right: 5px;
    transition: opacity 0.3s ease;
    max-width: 90px;
}

/* Khi phát nhạc, nút tròn di chuyển qua phải và chữ ẩn đi */
#music-toggle.active {
    justify-content: flex-start;
}

#music-toggle.active #music-button {
    transform: translateX(130px);
}

#music-toggle.active #music-text {
    opacity: 0;
}

/* Nút back-to-top */
#backToTop {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: white;
    color: black;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease; /* Thêm hiệu ứng chuyển tiếp */
    z-index: 4;
}

#backToTop:hover {
    background-color: #D3D3D3;
    transform: translateY(-5px); /* Di chuyển lên 5px */
}


/* Điều chỉnh cho thiết bị di động */
@media (max-width: 768px) {
    #toast-box {
        top: 10px; /* Cách phần form ra một đoạn */
        right: 10px;
        width: auto;
        max-width: 90%;
    }

    .container {
        max-width: 90%; /* Giảm độ rộng */
        padding: 15px; /* Giảm padding */
        margin: 66px auto;
        margin-top: 9rem;
        top: -115px;
    }

    button {
        font-size: 1em; /* Nhỏ hơn một chút */
        padding: 10px 20px;
    }
    .dropdown {
        top: 67px;
        right: 10px;
    }

    .dropdown-content {
        min-width: 369px; /* Giảm chiều rộng */
    }

    .couple-container {
        flex-direction: column; /* Hiển thị mỗi người 1 hàng */
        gap: 145px;
    }

    .event-card {
        width: 100%; /* 1 card mỗi hàng */
    }

    .heart-center {
        display: none;
    }

    /* Giảm kích thước font cho h1 và p trên thiết bị di động */
    #save-the-date h1 {
        font-size: 3em;
        margin-top: 5em;
    }

    #save-the-date p {
        font-size: 1.5em;
    }

    /* Làm background mờ để nổi bật chữ */
    #wedding-background {
        background-color: rgba(0, 0, 0, 0.4); /* Màu đen mờ */
        background-size: 100% auto;
        background-position: center;
        height: 69vh; /* Full chiều cao màn hình */
    }

    /* Thêm khoảng cách giữa nội dung và viền */
    .container {
        padding: 15px;
    }

    /* Căn giữa lại các phần tử trên màn hình nhỏ */
    .container h1 {
        font-size: 1.8em;
        text-align: center;
    }

    .container p {
        font-size: 1.2em;
        text-align: center;
    }
}

@media (max-width: 450px) {
    .container {
        top: -19px;
    }
    .heart-center {
        left: 41%;
        top: 47%;
        transform: translate(-50%, -50%);
        font-size: 3.5em;
    }
}

/* Media queries cho các thiết bị có chiều rộng nhỏ hơn */
@media screen and (max-width: 480px) {
    .carousel {
        height: 400px; /* Điều chỉnh chiều cao cho màn hình nhỏ hơn */
    }
}

@media screen and (min-width: 440px) and (max-width: 768px) {
    .heart-center {
        left: 44%;
        top: 45%;
    }
}

/* Media queries cho các thiết bị có chiều rộng trung bình */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .carousel {
        height: 500px; /* Điều chỉnh chiều cao cho các màn hình vừa phải */
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    #wedding-background {
        height: 122vh; /* Full chiều cao màn hình */
    }
}

@media screen and (min-width: 431px) and (max-width: 480px) {
    #wedding-background {
        height: 109vh; /* Full chiều cao màn hình */
    }
}

/* Media queries cho các màn hình lớn hơn */
@media screen and (min-width: 769px) {
    .carousel {
        height: 600px; /* Điều chỉnh chiều cao cho các màn hình lớn */
    }
}

@media all and (max-width: 768px) {  
    #countdown li {
      font-size: calc(1.125rem * var(--smaller));
    }
    
    #countdown li span {
      font-size: calc(3.375rem * var(--smaller));
    }
    #backToTop {
        bottom: 20px;
    }
  }

  @media (max-width: 320px) {
    #wedding-background, .carousel, #wedding-events {
        width: 117%;
    }
    .event-card {
        max-width: 220px;
    }
    .container {
        top: -25px;
        left: 23px;
    }
    .couple-section {
        width: 117%;
    }
    .image-wrapper {
        width: 180px;
        height: 130px;
    }
    .dropdown {
        top: 70px;
        right: 1px;
    }

    .dropdown-content {
        min-width: 286px; /* Giảm chiều rộng */
    }
  }

  @media (min-width: 321px) and (max-width: 375px) {
    #wedding-background, .carousel, #wedding-events {
        width: 112%;
    }
    .container {
        top: -25px;
        left: 22px;
    }
    .couple-section {
        width: 110%;
    }
    .image-wrapper {
        width: 220px;
        height: 130px;
    }
    .dropdown {
        top: 70px;
        right: 5px;
    }

    .dropdown-content {
        min-width: 325px; /* Giảm chiều rộng */
    }
    .heart-center {
        left: 43%;
        top: 46%;
        transform: translate(-50%, -50%);
        font-size: 3em;
    }
    .video-section {
        width: 115%;
    }
  }

  @media (min-width: 769px) and (max-width: 1024px) {
    .image-wrapper {
        width: 300px;
        height: 300px;
    }

    .couple-container {
        gap: 22%;
    }

    .event-card {
        width: 45%;
    }
    .heart-center {
        left: 46%;
        top: 30%;
        transform: translate(-50%, -50%);
        font-size: 4em;
    }
  }

  @media (max-width: 768px) {
    #backToTop {
        bottom: 25px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    #music-toggle {
        width: 140px;
        height: 28px;
        bottom: 15px;
        left: 15px;
        overflow: visible;
    }

    #music-button {
        min-width: 26px;
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    #music-text {
        font-size: 11px;
    }

    #music-toggle.active #music-button {
        transform: translateX(114px);
    }
  }

  @media (max-width: 768px) {
    #toast-box {
        top: 10px;
        right: 10px;
        max-width: 90%;
    }

    .toast {
        padding: 10px 15px;
        font-size: 12px;
    }
  }

/* Popup Gallery - Tối ưu hóa */
.popup-gallery {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    pointer-events: auto;
    touch-action: pan-x pan-y; /* Cho phép pan nhưng ngăn zoom */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform; /* Tối ưu GPU */
}

.popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
    pointer-events: auto;
}

.popup-close:hover {
    color: #bbb;
}

.popup-images {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    overflow: hidden;
    cursor: grab;
}

.popup-images:active {
    cursor: grabbing;
}

.popup-images img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    will-change: transform;
}

/* Nút điều hướng */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    pointer-events: auto;
}

/* Bỏ hiệu ứng hover và active */
.slide-nav:hover,
.slide-nav:active,
.slide-nav:focus {
    background-color: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%);
    outline: none;
}

.prev-slide {
    left: 20px;
}

.next-slide {
    right: 20px;
}

/* Chỉ số slide */
.slide-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
    z-index: 100000;
    pointer-events: auto;
}

/* Responsive cho popup */
@media (max-width: 768px) {
    .popup-images {
        width: 90%;
        height: 70%;
    }
    
    .slide-nav {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .prev-slide {
        left: 10px;
    }
    
    .next-slide {
        right: 10px;
    }
    
    .popup-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

/* Thêm cursor pointer cho event card */
.event-card:hover {
    transform: none;
}

@media (min-width: 1025px) {
    .heart-center {
        left: 47.5%;
        top: 27%;
        transform: translate(-50%, -50%);
        font-size: 4em;
    }
}

/* Footer styles */
.footer {
    background: linear-gradient(to right, #f5e1e1, #f8e7e7);
    color: #ff4e50;
    padding: 50px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 50px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

/* Thêm pattern trang trí */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #ff4e50, #f5e1e1, #ff4e50);
}

/* Thêm hiệu ứng chấm trang trí */
.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #fff 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    pointer-events: none;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.footer-content p {
    font-size: 1.2em;
    margin: 15px 0;
    line-height: 1.6;
}

.footer-heart {
    color: #ff4e50;
    display: inline-block;
    animation: heartbeat 1.2s infinite;
    margin: 0 5px;
}

.footer-decoration {
    margin-bottom: 20px;
    position: relative;
}

.footer-decoration::before {
    content: '❀';
    font-size: 24px;
    color: #ff4e50;
    opacity: 0.8;
    margin: 0 10px;
}

.footer-decoration::after {
    content: '❀';
    font-size: 24px;
    color: #ff4e50;
    opacity: 0.8;
    margin: 0 10px;
}

/* Responsive cho footer */
@media (max-width: 768px) {
    .footer {
        padding: 30px 0;
        width: 100%;
    }
    
    .footer-content {
        max-width: 90%;
        padding: 0 15px;
    }
    
    .footer-content p {
        font-size: 1em;
    }

    .footer-decoration::before,
    .footer-decoration::after {
        font-size: 20px;
    }
}

@media (max-width: 375px) {
    .footer {
        width: 115%;
        margin-left: -10px;
    }

    .footer-content {
        max-width: 85%;
    }

    .footer-content p {
        font-size: 0.9em;
    }

    .footer-decoration::before,
    .footer-decoration::after {
        font-size: 18px;
    }
}

@media (max-width: 320px) {
    .footer {
        width: 120%;
        margin-left: -10px;
    }

    .footer-content {
        max-width: 80%;
    }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Zodiac Sign Styling */
.zodiac-sign {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #FEF3F0 0%, #FCE4E1 50%, #F8BBD9 100%);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(252, 228, 225, 0.4);
  border: 3px solid #FCE4E1;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.zodiac-sign::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

.zodiac-sign:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 35px rgba(252, 228, 225, 0.5);
}

.zodiac-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.zodiac-sign h4 {
  font-size: 1.8rem;
  font-weight: bold;
  color: #ad1457;
  margin: 10px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  font-family: 'Playfair Display', serif;
}

.zodiac-date {
  font-size: 1rem;
  color: #8D6E63;
  font-weight: 500;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 15px;
  border-radius: 15px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(252, 228, 225, 0.3);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

/* Responsive cho zodiac signs */
@media (max-width: 768px) {
  .zodiac-sign {
    padding: 15px;
    margin: 10px 5px;
  }
  
  .zodiac-icon {
    font-size: 3rem;
  }
  
  .zodiac-sign h4 {
    font-size: 1.5rem;
  }
  
  .zodiac-date {
    font-size: 0.9rem;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .zodiac-sign {
    padding: 12px;
    margin: 8px 3px;
  }
  
  .zodiac-icon {
    font-size: 2.5rem;
  }
  
  .zodiac-sign h4 {
    font-size: 1.3rem;
  }
  
  .zodiac-date {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}

.person-description::before {
    content: '"';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 60px;
    color: #ff4e50;
    font-family: Georgia, serif;
    opacity: 0.5;
}

.person-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 10px;
    position: relative;
    z-index: 1;
}

.person-description:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive cho person-description */
@media (max-width: 768px) {
    .person-description {
        margin: 15px 10px;
        padding: 15px;
    }

    .person-description p {
        font-size: 14px;
    }

    .person-description::before {
        font-size: 40px;
        top: -10px;
    }
}

@media (max-width: 480px) {
    .person-description {
        margin: 10px 5px;
        padding: 12px;
    }

    .person-description p {
        font-size: 13px;
    }
    .event-card img {
        height: 320px;
    }
}

/* Video Section */
.video-section {
    width: 100%;
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
}

.video-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), transparent);
    z-index: 1;
}

.video-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
    z-index: 1;
}

.video-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-section .section-title {
    text-align: center;
    color: #ff4081;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    margin-bottom: 3rem;
    padding-bottom: 56.25%; /* Tỷ lệ 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive cho video section */
@media (max-width: 768px) {
    .video-section {
        padding: 60px 0;
        width: 100%;
    }

    .video-section .section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .video-container {
        padding: 0 15px;
    }

    .video-wrapper {
        padding-bottom: 56.25%;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .video-section {
        padding: 60px 0;
    }

    .video-wrapper {
        max-width: 800px;
    }
}

@media (min-width: 1024px) {
    .video-section {
        padding: 80px 0;
    }

    .video-wrapper {
        max-width: 1200px;
        padding-bottom: 35%; /* Giảm chiều cao xuống để video dài hơn */
    }
}

@media (min-width: 321px) and (max-width: 375px) {
    .video-section {
        padding: 40px 0;
        width: 100%;
    }

    .video-section .section-title {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .video-container {
        padding: 0 10px;
    }

    .video-wrapper {
        padding-bottom: 56.25%;
    }
}

@media (max-width: 320px) {
    .video-section {
        padding: 30px 0;
        width: 100%;
    }

    .video-section .section-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .video-container {
        padding: 0 8px;
    }

    .video-wrapper {
        padding-bottom: 56.25%;
    }
}

/* Điều chỉnh cơ bản cho tất cả màn hình */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Đảm bảo tất cả container chính */
#wedding-background, 
.carousel, 
#wedding-events, 
.couple-section,
.video-section,
.footer {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* Điều chỉnh cho màn hình nhỏ */
@media screen and (max-width: 344px) {
    .container {
        width: 95%;
        margin: 20px auto;
        margin-top: 100px; /* Thêm margin-top cho phần lưu bút */
        padding: 10px;
        left: 0;
    }

    .image-wrapper {
        width: 160px;
        height: 160px;
    }

    .event-card {
        width: 95%;
        max-width: 280px;
        margin: 10px auto;
    }

    .event-card img {
        height: 220px;
    }

    .carousel-caption {
        width: 90%;
        padding: 10px;
    }

    .carousel-caption h3 {
        font-size: 1.4em;
    }

    .video-section {
        width: 100%;
        padding: 20px 0;
    }

    .video-wrapper {
        width: 95%;
        height: 160px;
        margin: 0 auto;
    }

    .footer {
        width: 100%;
        margin: 0;
        padding: 20px 0;
    }

    .footer-content {
        width: 90%;
        margin: 0 auto;
    }

    .couple-container {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .heart-center {
        left: 50%;
        top: 45%;
        transform: translate(-50%, -50%);
        font-size: 3em;
    }

    #save-the-date h1 {
        font-size: 2.5em;
        margin-top: 3em;
    }

    #save-the-date p {
        font-size: 1.2em;
    }

    .dropdown-content {
        width: 90%;
        max-width: 280px;
        right: 5%;
    }
}

/* Đảm bảo các phần tử không bị tràn */
.carousel-container, 
.events-container, 
.couple-container,
.video-container,
.footer-content {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* Điều chỉnh cho màn hình từ 451px đến 768px */
@media screen and (min-width: 28.125rem) and (max-width: 48rem) {
    .container {
        width: 95%;
        margin: 1.25rem auto;
        margin-top: 14.25rem;
        padding: 0.9375rem;
        left: 0;
        right: 0;
        position: relative;
        transform: translateX(0);
    }

    #wedding-background, .carousel, #wedding-events {
        width: 100%;
    }

    .couple-section {
        width: 100%;
    }

    .image-wrapper {
        width: 15.625rem;
        height: 15.625rem;
    }

    .heart-center {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 4em;
    }

    .video-section {
        width: 100%;
    }

    /* Điều chỉnh event card cho màn hình M */
    .event-card {
        width: 90%;
        max-width: 320px;
        margin: 15px auto;
    }

    .event-card img {
        height: 250px;
    }
    .dropdown {
        top: 4.5rem;
        right: 1.5rem;
    }
}

/* Điều chỉnh cho màn hình từ 345px đến 375px */
@media screen and (min-width: 21.5625rem) and (max-width: 23.4375rem) {
    .container {
        width: 95%;
        margin: 1.25rem auto;
        margin-top: 6.25rem;
        padding: 0.625rem;
        left: 0;
        right: 0;
        position: relative;
        transform: translateX(0);
    }

    #wedding-background, .carousel, #wedding-events {
        width: 100%;
    }

    .container {
        top: -1.5625rem;
        left: 0;
        right: 0;
    }

    .couple-section {
        width: 100%;
    }

    .image-wrapper {
        width: 13.75rem;
        height: 13.75rem;
    }

    .dropdown {
        top: 4.5rem;
        right: 0.3125rem;
    }

    .dropdown-content {
        min-width: 20.3125rem;
    }

    .heart-center {
        left: 43%;
        top: 46%;
        transform: translate(-50%, -50%);
        font-size: 3em;
    }

    .video-section {
        width: 100%;
    }

    /* Điều chỉnh event card cho màn hình L */
    .event-card {
        width: 90%;
        max-width: 330px;
        margin: 15px auto;
    }

    .event-card img {
        height: 255px;
    }
}

/* Điều chỉnh cho màn hình nhỏ */
@media screen and (max-width: 21.5rem) {
    .container {
        width: 95%;
        margin: 1.25rem auto;
        margin-top: 6.25rem; /* 100px -> 6.25rem */
        padding: 0.625rem; /* 10px -> 0.625rem */
        left: 0;
    }

    .image-wrapper {
        width: 15rem; /* 160px -> 10rem */
        height: 15rem;
    }

    .event-card {
        width: 95%;
        max-width: 17.5rem; /* 280px -> 17.5rem */
        margin: 0.625rem auto; /* 10px -> 0.625rem */
    }

    .event-card img {
        height: 13.75rem; /* 220px -> 13.75rem */
    }

    .carousel-caption {
        width: 90%;
        padding: 0.625rem; /* 10px -> 0.625rem */
    }

    .carousel-caption h3 {
        font-size: 1.4em;
    }

    .video-section {
        width: 100%;
        padding: 1.25rem 0; /* 20px -> 1.25rem */
    }

    .video-wrapper {
        width: 95%;
        height: 10rem; /* 160px -> 10rem */
        margin: 0 auto;
    }

    .footer {
        width: 100%;
        margin: 0;
        padding: 1.25rem 0; /* 20px -> 1.25rem */
    }

    .footer-content {
        width: 90%;
        margin: 0 auto;
    }

    .couple-container {
        width: 100%;
        padding: 0 0.625rem; /* 10px -> 0.625rem */
        box-sizing: border-box;
    }

    .heart-center {
        left: 50%;
        top: 45%;
        transform: translate(-50%, -50%);
        font-size: 3em;
    }

    #save-the-date h1 {
        font-size: 2.5em;
        margin-top: 3em;
    }

    #save-the-date p {
        font-size: 1.2em;
    }

    .dropdown-content {
        width: 90%;
        max-width: 17.5rem; /* 280px -> 17.5rem */
        right: 5%;
    }
}

/* Thumbnail gallery */
.thumbnail-gallery {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow-x: auto;
    max-width: 90%;
    z-index: 100000;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background-color: #f3f3f3; /* Màu nền khi ảnh đang load */
}

.thumbnail.active {
    border-color: #ff4081;
    transform: scale(1.1);
}

/* Responsive cho thumbnail gallery */
@media (max-width: 768px) {
    .thumbnail-gallery {
        bottom: 10px;
        gap: 8px;
        padding: 8px;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .thumbnail-gallery {
        bottom: 5px;
        gap: 5px;
        padding: 5px;
    }

    .thumbnail {
        width: 40px;
        height: 40px;
    }
}

/* Loading spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid transparent;
    border-top: 5px solid #ff4081;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Nút zoom in/out */
.zoom-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100000;
    pointer-events: auto;
}

.zoom-btn {
    width: 45px;
    height: 45px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zoom-btn i {
    font-size: 18px;
}

.zoom-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Responsive cho nút zoom */
@media (max-width: 768px) {
    .zoom-controls {
        top: 10px;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .zoom-btn i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .zoom-controls {
        top: 5px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .zoom-btn i {
        font-size: 14px;
    }
}

/* Gallery Section */
.gallery-section {
    padding: 50px 0;
    background: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    aspect-ratio: 1;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    display: block;
    border-radius: 12px;
    background-color: transparent !important;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
}

/* Wedding Gallery Section */
.wedding-gallery {
    padding: 0 0 40px 0;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.wedding-gallery .section-title {
    text-align: center;
    color: #ff4081;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-shadow: none;
    background: none;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(180px, auto); /* Thay đổi từ 180px cố định sang minmax */
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 10px;
}

.gallery-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 1; /* Thêm tỷ lệ khung hình 1:1 */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Thay đổi từ cover sang contain */
    display: block;
    border-radius: 12px;
    background-color: #f5f5f5; /* Thêm màu nền cho phần trống */
}

.view-all-container {
    text-align: center;
    margin-top: 30px;
}

.view-all-btn {
    background-color: #ff4081;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.view-all-btn:hover {
    background-color: #e91e63;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Gallery Popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

.popup-images {
    width: 90%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-images img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.popup-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
}

.prev-slide,
.next-slide {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.prev-slide:hover,
.next-slide:hover {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .popup-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .prev-slide,
    .next-slide {
        padding: 10px 15px;
        font-size: 20px;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .view-all-btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .popup-close {
        top: 5px;
        right: 15px;
        font-size: 25px;
    }
    
    .prev-slide,
    .next-slide {
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .thumbnail {
        width: 40px;
        height: 40px;
    }
}

/* Ẩn các ảnh thừa trong gallery */
.gallery-item.hidden {
  display: none;
}

/* Điều chỉnh cho màn hình tablet */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 8px;
    }
    
    .gallery-item {
        aspect-ratio: 4/3; /* Thay đổi tỷ lệ khung hình cho tablet */
    }
}

/* Điều chỉnh cho màn hình mobile */
@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 5px;
    }
    
    .gallery-item {
        aspect-ratio: 3/4;
        max-height: 400px;
    }
    
    .gallery-item img {
        object-fit: contain;
    }
}



