/* =========================================
   DESIGN SYSTEM - AIPROSTUDIO
   Phương pháp tiếp cận tương tự các tập đoàn lớn
   ========================================= */

:root {
  /* Brand Colors */
  --color-primary: #3a86ff;
  --color-primary-light: #61a0ff;
  --color-primary-dark: #2563eb;
  --color-secondary: #8338ec;
  --color-accent: #ff006e;
  
  /* Neutral Colors */
  --color-white: #ffffff;
  --color-light: #d9d9db;
  --color-light-gray: #e9ecef;
  --color-gray: #ced4da;
  --color-dark-gray: #6c757d;
  --color-dark: #1a1a2e;
  --color-black: #000814;
  
  /* Semantic Colors */
  --color-success: #22c55e;
  --color-warning: #fbbf24;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.125rem;  /* 18px */
  --font-size-lg: 1.25rem;   /* 20px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 1.875rem; /* 30px */
  --font-size-3xl: 2.25rem;  /* 36px */
  --font-size-4xl: 3rem;     /* 48px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-loose: 1.75;
  
  /* Spacing System */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  
  /* Border Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem;  /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 0 0 3px rgba(58, 134, 255, 0.35);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Z-index */
  --z-negative: -1;
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-max: 999;
  
  /* Layout */
  --header-height: 4rem;
  --container-max-width: 1200px;
  --container-padding: 1rem;
  
  /* Content widths */
  --content-sm: 640px;
  --content-md: 768px;
  --content-lg: 1024px;
  --content-xl: 1280px;
  
  /* Light Theme (default) */
  --bg-primary: var(--color-white);
  --bg-secondary: var(--color-light);
  --text-primary: var(--color-dark);
  --text-secondary: var(--color-dark-gray);
  --border-color: var(--color-light-gray);
}

/* Dark mode - will be activated by JS or user preference */
@media (prefers-color-scheme: dark) {
  :root.dark-theme, 
  .dark-theme {
    --bg-primary: var(--color-dark);
    --bg-secondary: #242636;
    --text-primary: var(--color-white);
    --text-secondary: #a1a1aa;
    --border-color: #2d2d3a;
  }
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, 
picture, 
video, 
canvas, 
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

/* =========================================
   LAYOUT & UTILITY CLASSES
   ========================================= */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden {
  display: none !important;
}

/* =========================================
   BUTTON COMPONENT
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  border: none;
  text-align: center;
  line-height: 1;
  position: relative;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-md);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

/* Vô hiệu hóa thuộc tính từ các class khác cho nút đăng nhập */
#auth-button-home.btn,
div#auth-button-home {
    background-color: transparent;
    color: var(--color-primary);
    border: none;
    box-shadow: none;
    font-weight: 600;
    padding: 0;
    /* Giữ lại các thuộc tính flex để căn chỉnh */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    line-height: normal;
    transition: color var(--transition-fast);
}

/* Đảm bảo khi hover không làm thay đổi vị trí và có hiệu ứng gạch chân */
#auth-button-home.btn:hover,
#auth-button-home.btn:focus,
div#auth-button-home:hover,
div#auth-button-home:focus {
    background-color: transparent;
    color: var(--color-primary-dark);
    transform: none;
    box-shadow: none;
    text-decoration: underline;
}

/* =========================================
   HEADER COMPONENT
   ========================================= */
#main-header {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: var(--z-30);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

#main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.025em;
}

.nav-links {
  display: none; /* Hidden on mobile first */
}

/* =========================================
   LANGUAGE SWITCHER COMPONENT
   ========================================= */
.language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 var(--space-2);
  position: relative;
  z-index: var(--z-10);
}

.lang-btn {
  width: 2rem;
  height: 2rem;
  margin: 0 var(--space-1);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-btn.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.lang-btn:hover {
  background-color: var(--bg-secondary);
  transform: translateY(-2px);
}

.lang-btn:focus {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.lang-btn.active:hover {
  background-color: var(--color-primary);
}

/* =========================================
   AUTH COMPONENT
   ========================================= */
#auth-container-home {
  display: flex;
  align-items: center;
  min-height: 2.5rem; /* Chiều cao cố định tương đương với nút đăng nhập */
  min-width: 90px; /* Chiều rộng tối thiểu */
  justify-content: flex-end;
  position: relative;
  z-index: var(--z-20); /* Đảm bảo z-index cao hơn các thành phần khác */
}

#user-info-home {
  display: none; /* Thiết lập mặc định là ẩn, sẽ hiển thị qua JS */
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

#user-avatar-home {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  cursor: pointer;
}

#user-initials-home {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#user-name-home {
  font-weight: 500;
  display: none; /* Luôn ẩn trên mọi kích thước màn hình */
}

#auth-button-home {
  /* Các thuộc tính chung đã được định nghĩa ở trên */
  /* Có thể để trống hoặc thêm các điều chỉnh nhỏ nếu cần */
  min-width: auto; /* Cho phép co giãn theo nội dung */
  white-space: nowrap;
}

/* =========================================
   HERO SECTION COMPONENT
   ========================================= */
.hero-section {
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content {
  text-align: center;
  margin-bottom: var(--space-8);
}

.hero-content h1 {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-5);
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: var(--content-md);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
}

.hero-image {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-image img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Hero Info Box - Replacing the hero image */
.hero-info-box {
  width: auto;
  max-width: 100%;
  background: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  color: var(--color-white);
  border: none;
  position: relative;
  overflow: hidden;
  min-height: auto !important; /* Bỏ chiều cao cố định */
  display: inline-block; /* Thay đổi từ flex sang inline-block để co dãn theo nội dung */
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-info-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
}

/* Tạo hiệu ứng overlay và pattern cho background */
.hero-info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='rgba(255,255,255,0.1)' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: 0;
}

.hero-info-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at bottom right, rgba(255,0,110,0.3) 0%, transparent 70%);
  z-index: 0;
}

/* Tạo container cho nội dung để thu gọn */
.hero-info-box .hero-info-content {
  max-width: 100% !important;
  margin: 0 !important; /* Bỏ margin để nội dung sát với nền */
  position: relative;
  z-index: 1;
  padding: 8px !important;
  text-align: left !important; /* Căn lề trái */
}

.hero-info-box h3 {
  font-size: 1rem !important;
  font-weight: 800;
  margin-bottom: 0.5rem !important;
  color: var(--color-white);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

.hero-info-box p {
  margin-bottom: 0.5rem !important;
  line-height: 1.4;
  font-size: 0.875rem !important;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero-info-box p:last-child {
  margin-bottom: 0;
}

.hero-info-box a {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
}

.hero-info-box a:hover {
  color: var(--color-light);
  text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* =========================================
   FEATURES SECTION COMPONENT
   ========================================= */
.features-section {
  padding: var(--space-12) 0;
  background-color: var(--bg-primary);
}

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: var(--font-size-md);
  text-align: center;
  color: var(--text-secondary);
  max-width: var(--content-md);
  margin: 0 auto var(--space-10);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  width: 100%;
}

/* =========================================
   APP CARD COMPONENT
   ========================================= */
.app-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border-color);
  padding-bottom: 7.5rem;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.app-card-image-container {
  position: relative;
  height: 12.5rem;
  overflow: hidden;
}

.app-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.app-card:hover .app-card-image {
  transform: scale(1.05);
}

.app-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: white;
}

.app-badge.popular {
  background-color: var(--color-accent);
}

.app-badge.new {
  background-color: var(--color-secondary);
}

.app-card-content {
  padding: var(--space-4);
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.app-card-text-wrapper {
  margin-bottom: var(--space-4);
}

.app-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.app-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.system-requirements-notice {
  background-color: var(--bg-secondary);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  position: absolute;
  bottom: 4rem;
  left: var(--space-4);
  right: var(--space-4);
  height: 3rem;
}

.app-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
}

.app-price strong {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.btn-card-cta {
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-normal);
  font-size: var(--font-size-sm);
}

.btn-card-cta:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* =========================================
   COMING SOON CARDS COMPONENT
   ========================================= */
.coming-soon .app-card-image-container {
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
}

.coming-soon-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.coming-soon-placeholder i {
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
  opacity: 0.7;
}

/* =========================================
   FOOTER COMPONENT
   ========================================= */
#main-footer {
  background-color: var(--color-dark);
  color: var(--color-white);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo {
  margin-bottom: var(--space-6);
}

.footer-logo h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.footer-logo p {
  color: rgba(255, 255, 255, 0.7);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-white);
}

.copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-sm);
}

/* =========================================
   RESPONSIVE DESIGN - TABLET (768px+)
   ========================================= */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
    gap: var(--space-6);
  }
  
  .nav-links a {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
  }
  
  .nav-links a:hover,
  .nav-links a.active {
    color: var(--color-primary);
  }
  
  .nav-links a.active:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
  }
  
  /* Bỏ hiển thị tên người dùng kể cả trên màn hình lớn */
  /* #user-name-home {
    display: block;
  } */
  
  .hero-section .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
  }
  
  .hero-content {
    text-align: left;
    flex: 0 0 40%; /* Thay đổi từ flex: 1 thành flex: 0 0 40% để chiếm 40% không gian */
    margin-bottom: 0;
  }
  
  .hero-image {
    flex: 0 0 60%; /* Chiếm 60% không gian */
  }
  
  .hero-info-box {
    padding: var(--space-4) var(--space-5);
    min-height: auto !important;
    display: inline-block;
    flex: 0 0 auto; /* Không co dãn theo container */
    width: 100%; /* Sử dụng 100% chiều rộng của phần hero-image */
  }
  
  .hero-info-box .hero-info-content {
    max-width: 80% !important;
    padding: var(--space-4) var(--space-2) !important;
  }
  
  .hero-info-box h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .hero-info-box p {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .hero-cta {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
}

/* =========================================
   RESPONSIVE DESIGN - DESKTOP (1024px+)
   ========================================= */
@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-content h1 {
    font-size: var(--font-size-4xl);
  }
  
  .footer-links {
    gap: var(--space-8);
  }
}

/* =========================================
   ANIMATIONS & TRANSITIONS
   ========================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn var(--transition-normal);
}

/* =========================================
   ACCESSIBILITY & FOCUS STYLES
   ========================================= */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* User dropdown menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: var(--z-30);
  margin-top: 0.5rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: none;
}

.user-dropdown.active {
  display: block;
  animation: fadeIn var(--transition-fast) forwards;
}

.user-dropdown-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-name {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.user-dropdown-email {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-body {
  padding: var(--space-2) 0;
}

.dropdown-item {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
}

.dropdown-item i {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  width: 1.25rem;
}

/* Confirmation Dialog Styles */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-max);
  animation: fadeIn 0.3s ease;
}

.dialog-box {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 450px;
  width: 90%;
  animation: fadeInUp 0.3s ease;
}

.dialog-box h3 {
  font-size: var(--font-size-xl);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.dialog-box p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Classes for language loading transitions */
.loading-language [data-lang-key],
.updating-language [data-lang-key] {
  transition: none !important; /* Vô hiệu hóa transitions khi đang tải ngôn ngữ */
}

/* Thêm CSS cho quá trình tải và chuyển đổi ngôn ngữ */
html.loading-language #auth-button-home,
html.updating-language #auth-button-home {
  opacity: 1 !important;
  min-height: 2.5rem !important;
  visibility: visible !important;
  display: flex !important;
}

/* Đảm bảo text trong nút đăng nhập luôn có vị trí nhất quán */
#auth-button-home [data-lang-key],
#auth-button-home span,
#auth-button-home div {
  line-height: normal !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

/* Responsive adjustments for hero-info-box */
@media (min-width: 480px) {
  .hero-info-box {
    padding: var(--space-3) var(--space-4);
    min-height: auto !important;
    display: inline-block;
  }
  
  .hero-info-box .hero-info-content {
    max-width: 100% !important;
    padding: 8px !important;
    margin: 0 !important;
  }
  
  .hero-info-box h3 {
    font-size: 1.125rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .hero-info-box p {
    font-size: 0.875rem !important;
    margin-bottom: 0.5rem !important;
  }
}

@media (min-width: 768px) {
  .hero-info-box {
    padding: var(--space-4) var(--space-5);
    min-height: auto !important;
    display: inline-block;
  }
  
  .hero-info-box .hero-info-content {
    max-width: 100% !important;
    padding: 10px !important;
    margin: 0 !important;
  }
  
  .hero-info-box h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .hero-info-box p {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
}

/* =========================================
   VOICE CREATE GRADIENT
   ========================================= */

.voice-create-gradient {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.voice-create-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.3) 20%, transparent 21%),
              radial-gradient(circle at 70% 80%, rgba(255,255,255,0.2) 15%, transparent 16%);
  animation: liquid 5s ease-in-out infinite;
}

.voice-text {
  font-family: var(--font-family);
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.1em;
  position: relative;
  z-index: 2;
  text-transform: uppercase;
}

@keyframes liquid {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

/* Responsive for Voice Create */
@media (max-width: 768px) {
  .voice-text {
    font-size: 2rem;
  }
}

/* =========================================
   ALL TO TEXT AI GRADIENT
   ========================================= */

.alltotext-gradient {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.alltotext-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg,
    transparent 30%,
    rgba(255,255,255,0.3) 50%,
    transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

.alltotext-text {
  font-family: var(--font-family);
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.1em;
  z-index: 2;
  position: relative;
  text-align: center;
  line-height: 1.2;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Responsive for AllToText */
@media (max-width: 768px) {
  .alltotext-text {
    font-size: 1.5rem;
  }
}

/* =========================================
   DROPDOWN MENU STYLES
   ========================================= */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-toggle:hover {
    color: var(--color-primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.app-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.app-info {
    flex: 1;
}

.app-name {
    font-weight: 500;
    font-size: 14px;
}

/* Responsive dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        left: -50px;
        min-width: 250px;
    }
}