@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap");

* {
  padding: 0;
  margin: 0;
  font-family: "Poppins", sans-serif;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.page-section {
  display: none;
}

body.no-transition * {
  transition: none !important;
}

.floating-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}

body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(-45deg, #fff0f5, #ffe4e1, #ffdcb6, #ffefd5);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

nav {
  width: 100%;
  height: 10vh;
  position: sticky;
  z-index: 10;
}

.nav-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.logo {
  color: black;
  font-size: 2rem;
  font-weight: bolder;
  text-decoration: none;
}

.logo span {
  color: #cc788e;
  text-shadow: 0 0 10px #cc788e;
  display: inline-block;
  transition: 0.3s ease;
}

.logo:hover span {
  transform: scale(1.1) translateY(-2px);
  text-shadow:
    0 0 5px #cc788e,
    0 0 15px #cc788e,
    0 0 30px rgba(204, 120, 142, 0.8);
}

.hamburg,
.cancel {
  cursor: pointer;
  position: absolute;
  right: 15px;
  top: 10px;
  color: black;
  font-size: 2rem;
  display: none;
}

.nav-container .links {
  display: flex;
  gap: 3rem;
  align-items: center;
}

.nav-container .links a {
  position: relative;
  font-size: 1.2rem;
  color: black;
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s linear;
}

.nav-container .links a::before {
  position: absolute;
  content: "";
  bottom: -3px;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: #cc788e;
  transition: 0.2s linear;
}

.nav-container .links a:hover::before {
  width: 100%;
}

.nav-container .links a.active-nav {
  color: #cc788e;
}
.nav-container .links a.active-nav::before {
  width: 100%;
}
.dropdown .links a.active-nav {
  background-color: #cc788e;
  color: white;
}

.nav-container .contact-btn {
  background-color: transparent;
  padding: 5px 20px;
  border-radius: 20px;
  border: 2px solid #cc788e;
  transition: all 0.3s ease;
}
.nav-container .contact-btn a {
  color: #cc788e;
  transition: all 0.3s ease;
}
.nav-container .contact-btn:hover {
  background-color: #cc788e;
}
.nav-container .contact-btn:hover a {
  color: white !important;
}
.nav-container .links a:hover {
  color: #cc788e;
}

.nav-container .contact-btn a.active-nav {
  color: white !important;
}
.nav-container .contact-btn:has(a.active-nav) {
  background-color: #cc788e;
}

.dropdown {
  z-index: 100;
  position: absolute;
  top: 0;
  transform: translateY(-500px);
  width: 100%;
  height: auto;
  backdrop-filter: brightness(40%) blur(3px);
  box-shadow: 0 0 20px black;
  transition: 0.2s linear;
}

.dropdown .links a {
  color: white;
  display: flex;
  text-decoration: none;
  justify-content: center;
  padding: 15px 0;
  align-items: center;
  transition: 0.2s linear;
}

.dropdown .links a:hover {
  background-color: #cc788e;
}

section {
  width: 100%;
  height: 90vh;
}

.main-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

.main-container .image {
  z-index: -1;
  width: 50%;
  display: flex;
  justify-content: center;
}

.profile-img img {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  border: 4px solid rgba(204, 120, 142, 0.5);
  box-shadow: 0 0 20px rgba(204, 120, 142, 0.3);
  animation:
    morph 8s ease-in-out infinite,
    float 6s ease-in-out infinite;
  transition: all 0.4s ease;
}

.profile-img img:hover {
  box-shadow: 0 0 40px rgba(204, 120, 142, 0.9);
  transform: scale(1.05);
  border-color: #cc788e;
}

@keyframes morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

.main-container .content {
  color: black;
  width: 40%;
  min-height: 100px;
}

.content h1 {
  font-size: clamp(1rem, 2rem + 5vw, 3rem);
  white-space: nowrap;
}
.content h1 span {
  color: #cc788e;
  text-shadow: 0 0 10px rgba(204, 120, 142, 0.5);
  white-space: nowrap;
}

.content .typewriter {
  font-weight: 600;
  font-size: clamp(1rem, 1rem + 5vw, 2rem);
}
.content .typewriter span {
  color: #cc788e;
  font-size: 2.5rem;
  text-shadow: 0 0 5px rgba(204, 120, 142, 0.5);
  position: relative;
  transition: 0.3s linear;
}

.typewriter span::before {
  content: "Ftuer";
  animation: words 10s infinite;
}

.typewriter span::after {
  content: "";
  position: absolute;
  width: calc(100% + 8px);
  height: 100%;
  border-left: 3px solid black;
  animation: cursor 0.6s linear infinite;
}

@keyframes cursor {
  to {
    border-left: 3px solid transparent;
  }
}

@keyframes words {
  0%,
  50% {
    content: "Ftuer";
  }
  51%,
  100% {
    content: "Nature Lover";
  }
}

.content p {
  font-size: clamp(0.4rem, 0.2rem + 9vw, 1rem);
  margin: 10px 0;
}

.social-links a {
  text-decoration: none;
}
.social-links i {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 3rem;
  height: 3rem;
  background-color: transparent;
  border: 0.2rem solid #cc788e;
  border-radius: 50%;
  color: #cc788e;
  margin: 5px 10px;
  font-size: 1.5rem;
  transition: 0.2s linear;
}
.social-links i:hover {
  scale: 1.2;
  color: white;
  background-color: #cc788e;
  filter: drop-shadow(0 0 10px #cc788e);
}

.content button {
  width: 40%;
  height: 6vh;
  margin: 30px 0;
  background-color: #cc788e;
  color: white;
  border: none;
  outline: none;
  font-size: 100%;
  font-weight: 700;
  border-radius: 5px;
  transition: 0.2s linear;
  cursor: pointer;
  padding: 0 20px;
}
.content button:hover {
  scale: 1.05;
  color: #cc788e;
  border: 2px solid #cc788e;
  background-color: transparent;
  box-shadow: 0 0 30px rgba(204, 120, 142, 0.6);
}

.floating-icon {
  position: absolute;
  bottom: -50px;
  color: #ff9a9e;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  to {
    transform: translateY(-120vh) rotate(360deg);
  }
}

.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 10px 15px;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(204, 120, 142, 0.3);
  border: 2px solid #cc788e;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  z-index: 100;
  width: max-content;
  min-width: 280px;
  transition: all 0.4s ease;
}

.progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  font-size: 0.75rem;
  color: #cc788e;
  font-weight: 600;
  padding: 0 5px;
}

#progress-bar {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(204, 120, 142, 0.2);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: 0.2s;
}

#progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cc788e;
  cursor: pointer;
  transition: transform 0.2s;
}

#progress-bar::-webkit-slider-thumb:hover {
  transform: scale(1.4);
}

#progress-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #cc788e;
  cursor: pointer;
  transition: transform 0.2s;
}

#progress-bar::-moz-range-thumb:hover {
  transform: scale(1.4);
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.btn-nav-music {
  background: transparent;
  border: none;
  color: #cc788e;
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}
.btn-nav-music:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 5px #cc788e);
}

#play-pause-btn {
  background-color: #cc788e;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  font-size: 14px;
  flex-shrink: 0;
}
#play-pause-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px #cc788e;
}

.volume-container {
  display: flex;
  align-items: center;
  background: rgba(204, 120, 142, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: all 0.4s ease;
  overflow: hidden;
}
#mute-btn {
  background: transparent;
  border: none;
  color: #cc788e;
  cursor: pointer;
  font-size: 14px;
  width: 20px;
  transition: 0.2s;
}
#mute-btn:hover {
  transform: scale(1.1);
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0px;
  height: 4px;
  background: #f7e6e1;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  margin-left: 0px;
}

.volume-container:hover #volume-slider {
  width: 60px;
  opacity: 1;
  visibility: visible;
  margin-left: 8px;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cc788e;
  cursor: pointer;
  transition: transform 0.2s;
}
#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}
#volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #cc788e;
  cursor: pointer;
  transition: transform 0.2s;
}
#volume-slider::-moz-range-thumb:hover {
  transform: scale(1.3);
}

.custom-music-select {
  position: relative;
  font-family: "Poppins", sans-serif;
  width: 200px;
  flex-shrink: 0;
}

.select-trigger {
  border: 1px solid #cc788e;
  border-radius: 15px;
  padding: 5px 12px;
  color: #cc788e;
  background: transparent;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  transition: all 0.3s ease;
}
.select-trigger:hover {
  background-color: rgba(204, 120, 142, 0.1);
}
.select-trigger * {
  pointer-events: none;
}
.custom-music-select.open .select-trigger i {
  transform: rotate(180deg);
}
.select-trigger i {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.options-container {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 -5px 20px rgba(204, 120, 142, 0.2);
  border: 1px solid #cc788e;
  width: 100%;
  display: none;
  z-index: 101;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s ease;
  max-height: 125px;
  overflow-y: auto;
  overflow-x: hidden;
}

.custom-music-select.open .options-container {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.options-container::-webkit-scrollbar {
  width: 5px;
}
.options-container::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}
.options-container::-webkit-scrollbar-thumb {
  background: rgba(204, 120, 142, 0.5);
  border-radius: 10px;
}
.options-container::-webkit-scrollbar-thumb:hover {
  background: #cc788e;
}

.option {
  padding: 10px 15px;
  color: black;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}
.option * {
  pointer-events: none;
}
.option:hover {
  background-color: rgba(204, 120, 142, 0.15);
  color: #cc788e;
}
.option.active {
  background-color: #cc788e;
  color: white;
}

.marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  display: block;
}
.trigger-marquee {
  width: calc(100% - 20px);
}
.marquee-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 0%;
}
.marquee-text.scrolling {
  animation: marqueeAnim linear infinite;
}
@keyframes marqueeAnim {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 884px) {
  body {
    overflow-y: visible;
  }
  nav .logo {
    position: absolute;
    top: 16px;
    left: 15px;
    font-size: 1.5rem;
  }
  .main-container {
    display: flex;
    flex-direction: column;
  }
  .nav-container .links {
    display: none;
  }
  .hamburg,
  .cancel {
    display: block;
  }
  .main-container .content {
    width: 80%;
  }
  .content h1 {
    font-size: clamp(1rem, 1.8rem + 5vw, 3rem);
  }
  .social-links i {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  .cancel {
    color: white;
  }
  .main-container .image {
    width: 80%;
    margin-bottom: 0px;
  }

  .music-player {
    bottom: 10px;
    right: 10px;
    padding: 8px 10px;
  }
  .music-controls {
    gap: 8px;
  }
  .custom-music-select {
    width: 140px;
  }

  #volume-slider {
    width: 40px;
    opacity: 1;
    visibility: visible;
    margin-left: 8px;
  }
}

/* AI*/
/* Đảm bảo body và section cho phép cuộn */
body {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-section {
    width: 100%;
    min-height: 100vh; 
    padding: 80px 0; /* Giảm nhẹ padding để nội dung gọn hơn */
}

/* Grid chia 3 cột */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; /* Khoảng cách giữa các ô vừa phải */
    width: 92%; /* Mở rộng chiều ngang một chút */
    margin: 0 auto;
}

/* Style cho từng Card - Đã chỉnh sửa để vừa vặn hơn */
.card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(204, 120, 142, 0.2);
    border-radius: 20px;
    padding: 15px; /* Giảm padding để khung ôm sát ảnh hơn */
    text-align: center;
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    border-color: #cc788e;
    box-shadow: 0 10px 20px rgba(204, 120, 142, 0.15);
}

/* Khung chứa ảnh - Đã chỉnh tỉ lệ 16:9 cực chuẩn */
.card .img-box {
    width: 100%;
    aspect-ratio: 16 / 9; /* Ép tỉ lệ hình chữ nhật chuẩn dự án */
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.03); /* Nền mờ khi ảnh chưa load */
}

.card img, .card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card h3 {
    color: #cc788e;
    font-size: 1.1rem; /* Thu nhỏ tiêu đề một chút cho thanh thoát */
    margin-bottom: 8px;
    line-height: 1.3;
}

.card p {
    font-size: 0.85rem !important; /* Font chữ nhỏ gọn hơn */
    color: #555;
    margin-bottom: 15px !important;
    line-height: 1.5;
    flex-grow: 1; 
}

/* Style cho nút bấm View */
.btn-link {
    display: inline-block;
    padding: 8px 20px;
    background: #cc788e;
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.3s;
    opacity: 0.8;
    align-self: center; /* Căn giữa nút */
    width: fit-content;
}

.btn-link:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Responsive cho thiết bị nhỏ */
@media (max-width: 992px) {
    .grid-container { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px;
    }
}
@media (max-width: 600px) {
    .grid-container { 
        grid-template-columns: 1fr; 
    }
    .page-section { padding: 60px 0; }
}