/* ===================================
   FIXED APP HERO SECTION - NextApp
   =================================== */

/* CSS Variables */
:root {
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-6xl: 3.75rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-sm: 0.875rem;
  --bg-primary: #ffffff;
  --bg-tertiary: #f8f9fa;
  --transition-normal: 0.3s ease;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --leading-tight: 1.25;
  --leading-relaxed: 1.625;
  --accent-green: #10b981;
}

/* App Hero Section Container */
.app-hero-section {
  width: 100%;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header Section với gradient xanh */
.app-hero-header {
  background: linear-gradient(135deg, #007BFF 0%, #7B2FFF 100%);
  min-height: 50vh; /* Giảm từ 60vh xuống 50vh */
  position: relative;
  display: flex;
  align-items: center;
  padding: 60px 0 40px 0; /* Giảm padding */
}

/* Background Elements */
.app-hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><radialGradient id="a" cx="0.5" cy="0.5" r="0.5"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="150" fill="url(%23a)"/><circle cx="1000" cy="600" r="200" fill="url(%23a)"/><circle cx="800" cy="150" r="100" fill="url(%23a)"/></svg>') no-repeat center;
  background-size: cover;
  opacity: 0.3;
  z-index: 1;
}

.app-hero-header .container {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Content Section với nền trắng */
.app-hero-content {
  background: var(--bg-primary);
  flex: 1;
  min-height: 50vh; /* Giảm từ 60vh xuống 50vh */
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 80px 0; /* Thêm padding thay vì dùng margin âm */
  overflow: visible; /* Cho phép phần tử con tràn */
}

.app-hero-content .container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  overflow: visible; /* Cho phép tràn khỏi container */
}

/* Layout Container - Flexbox 2 phần */
.hero-content-row {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 3;
  gap: var(--spacing-xl); /* Thêm gap thay vì margin */
}

/* Bên trái: Phone Mockup - FIX OVERLAPPING */
#app-hero-img {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 4; /* Giảm z-index */
  overflow: visible; /* Không cắt ảnh khi tràn */
}

.hero-img {
  position: relative;
  z-index: 5;
  margin-top: -450px; /* GIẢM từ -450px xuống -150px */
  width: 100%;
  display: flex;
  justify-content: center; /* Đẩy ảnh sang trái để vượt container */
  overflow: visible;
}

/* Đẩy ảnh vượt ra ngoài container về bên trái trên desktop */
.hero-img .app-preview {
  transform: translateX(-120px); /* Đẩy sang trái để full-bleed */
}

.app-preview {
  max-width: 350px; /* Giữ nguyên giá trị gốc */
  height: auto;
  border: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15); /* Giảm shadow */
  transition: transform var(--transition-normal);
  border-radius: 30px;
  position: relative;
  z-index: 6;
}

.app-preview:hover {
  transform: translateX(-120px) translateY(-5px) scale(1.02); /* Bảo toàn offset trái khi hover */
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

/* Bên phải: App Information */
.hero-txt {
  flex: 1;
  padding: 0 var(--spacing-lg); /* Giảm padding */
  color: #333333;
  position: relative;
  z-index: 4;
}

/* App Logo Header - FIX RIGHT ALIGN */
.hero-app-logo {
  margin-bottom: var(--spacing-lg);
  position: relative;
  z-index: 5;
  text-align: right; /* Căn phải nội dung */
  display: flex;
  flex-direction: column;
  align-items: center; /* Căn phải */
}

.hero-app-logo .d-flex {
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  align-items: center;
  flex-direction: row;
  justify-content: flex-end; /* Căn phải logo + text */
  flex-wrap: wrap; /* Cho phép wrap nếu cần */
}

.app-name {
  font-size: var(--text-4xl); /* Giảm từ text-6xl xuống text-4xl */
  font-weight: 800;
  color: white;
  margin: 0;
  font-style: italic;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  order: 1; /* Logo trước, text sau */
}

.app-logo {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal);
  width: 80px; /* Giảm từ 90px xuống 80px */
  height: 80px;
  object-fit: cover;
  flex-shrink: 0;
  order: 2; /* Logo sau text */
}

.app-logo:hover {
  transform: scale(1.05) rotate(3deg); /* Giảm hover effect */
}

.app-version {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-base); /* Giảm từ text-lg xuống text-base */
  font-weight: 500;
  margin: 0;
  opacity: 0.9;
}

/* App Title & Description */
.app-title {
  font-size: var(--text-3xl); /* Giảm từ text-4xl xuống text-3xl */
  font-weight: 700;
  color: var(--text-primary,#33333);
  margin-bottom: var(--spacing-md);
  line-height: var(--leading-tight);
}

.app-description {
  font-size: var(--text-base); /* Giảm từ text-lg xuống text-base */
  color: #666666;
  margin-bottom: var(--spacing-lg);
  line-height: var(--leading-relaxed);
  max-width: 500px;
}

/* Store Badges - HORIZONTAL LAYOUT */
.stores-badge {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md);
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  justify-content: flex-start; /* Căn trái thay vì center */
}

.stores-badge .img-btn {
  display: inline-block;
  transition: all var(--transition-normal);
  text-decoration: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.stores-badge .img-btn:hover {
  transform: translateY(-2px); /* Giảm hover effect */
  box-shadow: var(--shadow-lg);
}

.store-btn {
  height: auto;
  max-width: 140px; /* Giảm từ 150px xuống 140px */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.stores-badge .img-btn:hover .store-btn {
  box-shadow: var(--shadow-xl);
  transform: scale(1.03); /* Giảm hover scale */
}

.os-version {
  font-size: var(--text-sm);
  color: #999999;
  font-style: italic;
  margin-top: var(--spacing-sm);
  display: block;
  width: 100%;
  text-align: left; /* Căn trái thay vì center */
}

/* RESPONSIVE DESIGN - FIX BREAKPOINTS */
@media (max-width: 1200px) {
  .hero-img .app-preview { transform: translateX(-80px); }
  .app-preview { max-width: 320px; }
}

@media (max-width: 1024px) {
  .hero-content-row {
    flex-direction: column-reverse; /* Image ở dưới, text ở trên */
    text-align: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
  }
  
  .hero-img { margin-top: -80px; justify-content: center; }
  .hero-img .app-preview { transform: translateX(0); } /* Không đẩy trên tablet */
  
  .hero-txt {
    padding: 0 var(--spacing-md);
    text-align: center;
  }
  
  .app-name { font-size: var(--text-3xl); }
  .app-title { font-size: var(--text-2xl); }
  .app-preview { max-width: 260px; }
  .stores-badge { justify-content: center; }
  .os-version { text-align: center; }
  .hero-app-logo { align-items: center; text-align: center; } /* Căn giữa trên tablet/mobile */
}

@media (max-width: 768px) {
  .app-hero-section { min-height: auto; }
  .app-hero-header { min-height: 40vh; padding: 40px 0 20px 0; }
  .app-hero-content { min-height: auto; padding: 60px 0 40px 0; }
  .hero-content-row { padding: var(--spacing-md) 0; gap: var(--spacing-md); }
  .hero-img { margin-top: -60px; }
  .app-name { font-size: var(--text-2xl); }
  .app-logo { width: 60px; height: 60px; }
  .app-title { font-size: var(--text-xl); }
  .app-preview { max-width: 220px; }
  .store-btn { max-width: 120px; }
}

@media (max-width: 576px) {
  .app-hero-header { min-height: 35vh; padding: 30px 0 15px 0; }
  .app-hero-content { padding: 50px 0 30px 0; }
  .hero-img { margin-top: -40px; }
  .hero-app-logo .d-flex { flex-direction: column; gap: var(--spacing-sm); }
  .app-name { font-size: var(--text-xl); white-space: normal; order: 2; }
  .app-logo { width: 50px; height: 50px; order: 1; }
  .stores-badge { flex-direction: column; gap: var(--spacing-sm); }
  .app-preview { max-width: 180px; }
  .store-btn { max-width: 110px; }
}

/* Animation Effects - Giữ nguyên */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.app-hero-section.animate-in .hero-app-logo { animation: fadeInUp 0.8s ease-out; }
.app-hero-section.animate-in .hero-img { animation: fadeInLeft 1s ease-out 0.2s both; }
.app-hero-section.animate-in .hero-txt { animation: fadeInRight 1s ease-out 0.4s both; }