﻿img {max-width: 100%;}

body {
    display: grid;
    font-family: "Segoe UI", sans-serif;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(auto, auto);
    color: #3e3e3e;
    text-shadow: 0.4px 0.4px 0.4px rgba(0,0,0,.2);
    min-height: 100vh; /* Đảm bảo body chiếm toàn bộ chiều cao màn hình */
    /*code hien thi sao lap lanh*/
    /*background: linear-gradient(270deg, #fefefe, #CDE7F0, #EEE2DC, #CDE7F0, #E6D5DE);*/
    background: linear-gradient(270deg,  #FFD1CC, #FA8072,#FFD1CC, #FF9999, #FA8072, #FFD1CC);
    background-size: 400% 400%;
    animation: dreamyGradient 60s ease infinite;
}

h1 {
    font-weight: lighter;
    grid-column: span 3;
    text-align: center;
    color: #333333;
    font-size: clamp(1.5rem, 5vw, 2.5rem); /* Tự động điều chỉnh kích thước chữ */
    font-family: "Great Vibes", cursive; /* Thêm font kiểu */
    font-size: clamp(1.8rem, 4vw, 2.2rem); /* Kích thước chữ lớn hơn, responsive */
}

#wrapper {
    display: grid;
    grid-column: 3 / 11;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(auto, auto);
    grid-row-gap: 10px;
    margin-top: 3.6rem;
    padding: 0 10px; /* Padding cho viền */
}

#clock-box, #info {
      grid-column: span 3;
      display: grid;
      grid-template-columns: repeat(12, 1fr);
}

#clock-box #clock {
      grid-column: 4 / 10;
      background-color: #F8C8C8;
      padding: .6rem 2rem;
      padding-top: .8rem;
      text-align: center;
      font-size: 2.4rem;
      border-radius: 10rem;
}

date, time {
      display: block;
}

date {
      font-size: 18px;
}

time {
      font-family: "Arial", sans-serif;
      line-height: 3.2rem;
      letter-spacing: 2px;
}

.avt {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    box-shadow: 2px 2px 8px rgba(0,0,0,.2);
    transition: transform 0.2s ease; /* Thêm transition cho hình ảnh */
    display: block; /* Đảm bảo hình ảnh là block để tránh vấn đề căn chỉnh */
    margin: 0 auto; /* Căn giữa hình ảnh */
}

.avt:hover {
        transform: scale(2.1);
        box-shadow: 0 0 15px rgba(255, 105, 180, 0.5); /* màu hồng ánh nhẹ */
}

#info {
      margin-top: 2.6rem;
}

#heart {
      grid-column: span 2;
      display: grid;
      grid-template-rows: 2;
      font-size: 54px;
      color: #b90d46;
      align-self: center;
      padding-bottom: 2.6rem;
      text-align: center;
}

anni {
      font-size: 16px;
      letter-spacing: 0.2px;
}

#info .one {
    grid-column: 3 / 6;
    text-align: center;
    z-index: 10;
    font-family: "Great Vibes", cursive; /* Thêm font kiểu */
    font-size: clamp(1.8rem, 4vw, 2.2rem); /* Kích thước chữ lớn hơn, responsive */
    color: #333333; /* Màu sắc  */    
}


#info .two {
    grid-column: 8 / 11;
    text-align: center;
    z-index: 10;
    font-family: "Great Vibes", cursive; /* Thêm font kiểu */
    font-size: clamp(1.8rem, 4vw, 2.2rem); /* Kích thước chữ lớn hơn, responsive */
    color: #333333; /* Màu sắc */
}


footer {
      grid-column: span 3;
      text-align: center;
      font-size: 1.6rem;
      font-weight: lighter;
      margin-top: 1.2rem;
      color: #800000;
}

#music {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 2rem;
  z-index: 10; /* đảm bảo nằm trên background */
}

#music audio {
  z-index: 2;
  opacity:0.5;
}

/* Danh sách ẩn mặc định */
#music-list {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: 12px;
    z-index: 999;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#mask {
    background-image: linear-gradient(to top, #6d44cc5d 0%, #f09cd880 100%);
    opacity: .42;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none /* Ngăn #mask chặn sự kiện hover */
}
#album{
        grid-column: span 3;
        margin-top: 2rem;
        position: relative;
        z-index: 1000;
}

#album h2 {
            text-align: center;
            color: #333333;
            font-weight: normal;
            margin-bottom: 1rem;
            font-family: "Great Vibes", cursive; /* Thêm font kiểu */
            font-size: clamp(1.8rem, 4vw, 2.2rem); /* Kích thước chữ lớn hơn, responsive */
      }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.gallery-item {
    position: relative;
    text-align: center;
    cursor: pointer;
    transform: translateY(20px);
    transition: all 0.6s ease;
}
.gallery-item.show {
    opacity: 1;
    transform: translateY(0);
}

.gallery-thumb {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover .gallery-thumb {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item h3 {
    margin: 0.5rem 0 0;
    font-size: 1.2rem;
    color: #333333;
    font-weight: normal;
}

@media (max-width: 992px) {
      #wrapper {
            grid-column: span 12;
      }

    #info, #music, #album {
        grid-column: span 12; /* Chiếm toàn bộ chiều rộng trên mobile */
        text-align: center;
    }
    #clock-box {
        grid-column: span 12; /* Chiếm toàn bộ chiều rộng */
        display: flex; /* Sử dụng flexbox để căn giữa */
        justify-content: center; /* Căn giữa theo chiều ngang */
        align-items: center; /* Căn giữa theo chiều dọc */
        text-align: center; /* Căn giữa nội dung văn bản */
        font-size: clamp(1.2rem, 4vw, 1.5rem); /* Điều chỉnh kích thước chữ */
    }
    #dynamic-lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 1000; /* Đảm bảo lightbox nằm trên cùng */
        overflow: hidden; /* Ngăn cuộn khi lightbox mở */
        display: none; /* Ẩn ban đầu */
    }

        #dynamic-lightbox.lg-on {
            display: block; /* Hiển thị khi lightbox hoạt động */
        }

      .avt {
            width: 192px;
            height: 192px;
      }
        .avt.active {
            transform: scale(2.1);
            box-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
        }


      #info .one, #info .two{
            grid-column: span 12;
            text-align:center;
            z-index:10;
      }

      #heart {
            grid-column: span 12;
            padding-bottom: 1rem;
      }

    footer {
        grid-column: 1 / -1; /* Chiếm toàn bộ chiều rộng */
        text-align: center; /* Căn giữa nội dung */
        padding: 10px 0;
        font-size: clamp(1rem, 3vw, 1.2rem); /* Tự động điều chỉnh kích thước chữ */
        color: #ec407a;
        margin: 0 auto; /* Căn giữa nếu có width cố định */
        width: 100%; /* Đảm bảo chiếm toàn bộ chiều rộng */
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .gallery-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; /* Hoặc dùng tỉ lệ phù hợp như 3 / 4 */
        object-fit: cover;
    }
     
}
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

#heart {
    animation: heartbeat 5s infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 8px #ec407a);
}
@font-face {
  font-family: 'lg';
  src: url('fonts/lg.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/*key cho hieu ung chuyen mau nen*/
@keyframes dreamyGradient {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}

/* Container chứa sao */
#starry-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* nằm sau mọi nội dung khác */
    overflow: hidden;
    pointer-events: none;
}

/* Sao đơn */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 8s infinite ease-in-out;
    will-change: opacity;
}

/* Hiệu ứng nhấp nháy */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

/*hieu ung tuyet*/

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none; /* Không chặn sự kiện chuột */
    z-index: -1; /* Đặt dưới các phần tử khác */
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
}

.snowflake {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    animation: fall linear infinite;
    will-change: transform;
}

    .snowflake:nth-child(1) {
        left: 10%;
        animation-duration: 10s;
        animation-delay: 0s;
    }

    .snowflake:nth-child(2) {
        left: 20%;
        width: 8px;
        height: 8px;
        animation-duration: 8s;
        animation-delay: 2s;
    }

    .snowflake:nth-child(3) {
        left: 30%;
        animation-duration: 12s;
        animation-delay: 4s;
    }

    .snowflake:nth-child(4) {
        left: 40%;
        width: 12px;
        height: 12px;
        animation-duration: 9s;
        animation-delay: 1s;
    }

    .snowflake:nth-child(5) {
        left: 50%;
        animation-duration: 11s;
        animation-delay: 3s;
    }

    .snowflake:nth-child(6) {
        left: 60%;
        width: 6px;
        height: 6px;
        animation-duration: 7s;
        animation-delay: 5s;
    }

    .snowflake:nth-child(7) {
        left: 70%;
        animation-duration: 13s;
        animation-delay: 0.5s;
    }

    .snowflake:nth-child(8) {
        left: 80%;
        width: 10px;
        height: 10px;
        animation-duration: 10s;
        animation-delay: 2.5s;
    }

    .snowflake:nth-child(9) {
        left: 90%;
        animation-duration: 9s;
        animation-delay: 1.5s;
    }

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0.8;
    }

    20% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 2%, transparent 2%);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 2;
}