/* Custom Styles for AI Giáo Dục - Thầy Quân */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --accent: #6366f1;
}

* {
  font-family: var(--font-main);
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.dark .glass {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Gradients */
.gradient-teacher {
  background: linear-gradient(135deg, #0d9488 0%, #2563eb 100%);
}
.gradient-classroom {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}
.gradient-text-teal {
  background: linear-gradient(135deg, #0d9488 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text-purple {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Card Hover Animation */
.app-card {
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.09);
}
.dark .app-card:hover {
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.45);
}

/* HIỆU ỨNG ĐIỆN TỬ HIỆN ĐẠI (ELECTRIC GLOW / CYBER ENERGY) */
@keyframes electricPulse {
  0% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.4), inset 0 0 5px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
  }
  50% {
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.8), 0 0 28px rgba(52, 211, 153, 0.4), inset 0 0 10px rgba(16, 185, 129, 0.4);
    border-color: rgba(52, 211, 153, 1);
  }
  100% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.4), inset 0 0 5px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
  }
}

@keyframes electricBeam {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.electric-ready-badge {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.9) 0%, rgba(16, 185, 129, 0.95) 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #34d399 !important;
  animation: electricPulse 2.2s infinite ease-in-out;
}

.electric-ready-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  animation: electricBeam 3s infinite ease-in-out;
  pointer-events: none;
}

/* Tia điện nhỏ xung quanh */
.electric-spark {
  display: inline-block;
  filter: drop-shadow(0 0 4px #34d399);
  animation: sparkFlicker 1.5s infinite alternate;
}

@keyframes sparkFlicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.15); filter: drop-shadow(0 0 8px #6ee7b7); }
}

/* Skeleton Loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Iframe Frame */
.app-iframe-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #f8fafc;
}
.dark .app-iframe-container {
  background-color: #0f172a;
}
.app-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Modal App Runner Toàn Màn Hình Mặc Định (Full Viewport) */
#app-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
}

#modal-dialog {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.zen-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
}

/* Đảm bảo các hộp thoại tương tác (Mời cà phê, Báo lỗi, Đánh giá, Chia sẻ, Video, Promo) luôn nổi lên TRÊN ứng dụng đang mở */
#donate-modal,
#feedback-modal,
#review-modal,
#share-modal,
#video-modal,
#promo-modal {
  z-index: 20000 !important;
}

#toast {
  z-index: 20050 !important;
}

/* Subtle badge pulse */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.04); }
}
.pulse-badge {
  animation: pulse-subtle 2.5s infinite;
}

/* Social Buttons Styling (Real Brands, No simple icon) */
.brand-btn-zalo {
  background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%);
  color: white;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.3);
}
.brand-btn-zalo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 104, 255, 0.45);
}

.brand-btn-fb {
  background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
  color: white;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.3);
}
.brand-btn-fb:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.45);
}

.brand-btn-yt {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.3);
}
.brand-btn-yt:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
}

.brand-btn-coffee {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.brand-btn-coffee:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* HIỆU ỨNG LY CÀ PHÊ TỎA KHÓI CÓ TRÁI TIM */
@keyframes coffeeSteamRise1 {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  25% { opacity: 0.85; }
  60% { transform: translateY(-5px) scaleX(1.15); opacity: 0.5; }
  100% { transform: translateY(-10px) scaleX(1.3); opacity: 0; }
}

@keyframes coffeeSteamRise2 {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  35% { opacity: 0.9; }
  70% { transform: translateY(-6px) scaleX(1.2); opacity: 0.45; }
  100% { transform: translateY(-11px) scaleX(1.35); opacity: 0; }
}

@keyframes coffeeHeartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.steam-line-1 {
  animation: coffeeSteamRise1 2.2s infinite ease-in-out;
  transform-origin: bottom center;
  transform-box: fill-box;
}

.steam-line-2 {
  animation: coffeeSteamRise2 2.5s infinite ease-in-out 0.4s;
  transform-origin: bottom center;
  transform-box: fill-box;
}

.steam-line-3 {
  animation: coffeeSteamRise1 2.4s infinite ease-in-out 0.8s;
  transform-origin: bottom center;
  transform-box: fill-box;
}

.cup-heart {
  animation: coffeeHeartBeat 1.8s infinite ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
}

/* NÚT THÔNG BÁO NỔI BẬT (VIBRANT SUNSET CORAL GLOW) */
.floating-promo-btn {
  background: linear-gradient(135deg, #f43f5e 0%, #ea580c 50%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4), 0 2px 6px rgba(244, 63, 94, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-promo-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.55), 0 4px 10px rgba(244, 63, 94, 0.4);
}

/* HỆ THỐNG ĐÁNH GIÁ & BÌNH LUẬN (STAR RATINGS & REVIEWS) */
.star-btn {
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}
.star-btn:hover {
  transform: scale(1.2);
}
.star-filled {
  color: #f59e0b !important;
  fill: #f59e0b !important;
}
.star-empty {
  color: #cbd5e1;
}
.dark .star-empty {
  color: #475569;
}

.review-card {
  transition: all 0.2s ease;
  border-left: 3px solid #14b8a6;
}
.review-card:hover {
  transform: translateX(2px);
  background-color: rgba(20, 184, 166, 0.04);
}

.review-avatar {
  background: linear-gradient(135deg, #0d9488 0%, #4338ca 100%);
  color: white;
  font-weight: 700;
}

/* HUY HIỆU TƯƠNG TÁC THỰC TẾ (REAL ANALYTICS) */
.trending-badge {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: white;
  animation: pulse-subtle 2s infinite;
}

/* HIỆU ỨNG MỜ RỒI HIỆN DẦN & TRƯỢT LÊN (PROGRESSIVE LOAD & FADE-IN) */
@keyframes cardFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  60% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-card-fade-in {
  opacity: 0;
  animation: cardFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

/* NÚT XEM THÊM CÔNG CỤ & TIẾN TRÌNH */
.btn-load-more {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.25);
}
.dark .btn-load-more:hover {
  box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.2);
}
.btn-load-more:active {
  transform: translateY(0) scale(0.98);
}

