/* Hero Section Styles - Improved for better video visibility */
.hero-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  padding-top: 0rem; /* Space for fixed navbar */
}

.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 4;
}

.video-container video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: contain; /* Quan trọng - đảm bảo video lấp đầy container */
  z-index: 4;
}


.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f9a94a59, #dd772269, #eb9046ad);
  z-index: 2;
  backdrop-filter: blur(5px); /* Áp dụng blur cho nội dung phía sau */
  /* hoặc */
  filter: blur(5px); /* Áp dụng blur cho chính lớp phủ */
}

/* Floating Content Box - Optimized for better positioning */
.hero-floating-content {
  position: relative;
  z-index: 10;
  height: calc(100vh - 5rem); /* Full height minus navbar */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6vh 5vw 8vh;
}

.hero-text-container {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 1rem;
  padding: 1.5rem;
  width: auto;
  max-width: 550px;
  animation: float 5s ease-in-out infinite;
  border-left: 3px solid #dd7722;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  align-self: flex-start;
  margin-top: auto;
}

.hero-text-container h1 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-text-container p {
  margin-bottom: 0;
  font-size: 1rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.teek-gradient-text-horizontal {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Pulse animation for CTA button */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 10px rgba(221, 119, 34, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(221, 119, 34, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 10px rgba(221, 119, 34, 0.3);
  }
}

/* Hero CTA Button - Visible on all devices */
.hero-cta {
  margin-top: 1.5rem;
  display: block;
}

.hero-cta .cta-button {
  display: inline-block;
  background: #dd7722;
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(221, 119, 34, 0.3);
  animation: pulse 2s infinite;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.hero-cta .cta-button:hover {
  background: #eb9046;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(221, 119, 34, 0.4);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .hero-floating-content {
    height: auto;
    min-height: 100vh;
    justify-content: space-between;
    padding: 100px 20px 40px;
    align-items: center;
  }
  
  .hero-text-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1.2rem;
    width: 100%;
    max-width: 100%;
    border-radius: 0.8rem;
    animation: none;
    border-left: 3px solid #dd7722;
    margin-top: 10vh; /* Di chuyển lên cao hơn */
    margin-bottom: 1.5rem;
    align-self: center;
  }
  
  .hero-text-container h1 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    text-shadow: none;
  }
  
  .hero-text-container p.motto {
    color: #dd7722;
    font-size: 0.9rem;
    margin-bottom: 0;
    font-weight: 500;
    text-shadow: none;
  }

  .video-container {
    opacity: 0.9;
    background:linear-gradient(135deg, #f9a94a, #dd7722, #eb9046);
  }
  
  .video-container video {
    object-fit: contain; 
  }
  
  .hero-cta {
    display: block;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
  }
  
  .teek-gradient-text-horizontal {
    color: #dd7722 !important;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    text-shadow: none !important;
  }
}

/* Small mobile screens */
@media (max-width: 480px) {
  .hero-floating-content {
    padding: 0px 20px;
  }
  
  .hero-text-container {
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 2vh; 
  }
  
  .hero-text-container h1 {
    font-size: 1.2rem;
    line-height: 1.4;
  }
  
  .hero-content h1.teek-gradient-text-horizontal {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
  }
  
  .hero-cta {
    margin-top: 1rem;
  }
  
  .hero-cta .cta-button {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .video-container video {
    object-fit: contain;
    width: 100%;
    height: 100%;
  }
  .hero-section {
    min-height: 50vh;
    height: 50vh;
  }
}



/* Mobile Hero Section Height Adjustment */
@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh; /* Reduce from 100vh to 80vh */
  }
  
  .hero-floating-content {
    min-height: 80vh; /* Match with hero-section */
    padding: 80px 20px 30px; /* Reduce top and bottom padding */
    position: relative;
  }
  
  .hero-text-container {
    margin-top: 0; /* Remove top margin */
    margin-bottom: 1rem;
    position: absolute;
    top: 50px; /* Position it just below the navbar */
    left: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8); /* More opaque background */
    max-width: calc(100% - 40px);
    width: auto;
  }
  
  /* Position the CTA at the bottom */
  .hero-cta {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
  }
}

/* Extra optimization for small screens */
@media (max-width: 480px) and (orientation: portrait) {
  .hero-section {
    min-height: 70vh; /* Further reduce height */
    position: relative;
  }
  
  .hero-floating-content {
    min-height: 70vh;
    padding: 0;
  }
  
  .hero-content-wrapper {
    padding: 0;
  }
  
  .hero-text-container {
    position: absolute;
    top: 0px; /* Position text near the top to leave video visible */
    left: 15px;
    right: 15px;
    max-width: calc(100% - 30px);
    padding: 0.5rem;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.85);
    border-left: 2px solid #dd7722;
  }
  
  .hero-text-container h1 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
  }
  
  .hero-text-container p.motto {
    font-size: 0.75rem;
    margin-bottom: 0;
  }
  
  .hero-cta {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0;
    text-align: center;
  }
  
  .hero-cta .cta-button {
    padding: 8px 20px;
    font-size: 0.85rem;
  }
  
  /* Allow video to be fully visible without cropping */
  .video-container {
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .video-container video {
    object-fit: contain; /* Changed back to contain to show full video */
    width: 100%;
    height: 100%;
  }
}

/* Fix for empty space issue in portrait mode on iPhone-like devices */
@media (max-width: 480px) and (min-height: 700px) and (orientation: portrait) {
  .hero-content h1.teek-gradient-text-horizontal {
    margin-bottom: 0.3rem; /* Minimize spacing */
  }
  
  .hero-section {
    min-height: 60vh; /* Reduce height even more for tall phones */
  }
  
  .hero-floating-content {
    min-height: 60vh;
  }
  
  /* Move text block even higher to avoid covering the video content */
  .hero-text-container {
    top: 0px;
    max-width: calc(100% - 30px);
  }
  
  /* Ensure video is fully visible without cropping */
  .video-container {
    opacity: 1;
    background: none; /* Remove gradient background */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .video-container video {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
  }
}

/* Additional fix for very small screens */
@media (max-width: 360px) {
  .hero-text-container h1 {
    font-size: 1.2rem;
  }
  
  .hero-text-container p.motto {
    font-size: 0.75rem;
  }
}


/* Sửa lỗi margin */
@media (max-width: 480px) and (orientation: portrait) {
  .hero-content h1.teek-gradient-text-horizontal {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
  }
}
@media (max-aspect-ratio: 16/9) {
  /* Cho màn hình dọc */
  .video-container video {
    width: 100%;
    height: auto;
  }
}

@media (min-aspect-ratio: 16/9) {
  /* Cho màn hình ngang */
  .video-container video {
    width: auto;
    height: 100%;
  }
}