
/* Diticoms Performance Styles */
.animate-in { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-in-from-bottom {
  animation: slideInBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInBottom {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Tối ưu hóa cực hạn cho thiết bị di động */
* {
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
}

input, textarea, select {
  font-size: 16px !important; /* Ngăn iOS tự động zoom gây lag layout */
  text-rendering: optimizeSpeed !important;
  transform: translateZ(0); /* Ép buộc tăng tốc phần cứng */
}

/* Vô hiệu hóa backdrop-blur vì nó gây lag cực nặng khi gõ phím trên WebView */
.backdrop-blur-xl, .backdrop-blur-md, .backdrop-blur-sm {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
}

/* Tối ưu hóa trạng thái Focus */
input:focus, textarea:focus {
  transition: none !important; /* Loại bỏ transition để phản hồi tức thì */
  border-color: #2563eb !important;
  background-color: #ffffff !important;
}

/* Giảm thiểu animation khi bàn phím đang mở */
body.keyboard-open .animate-pulse,
body.keyboard-open .animate-bounce {
  animation: none !important;
}

@media (max-width: 640px) {
  .safe-area-padding {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Premium Styles - Glassmorphism & Animations */
.glass-effect {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* Glass panel cho các block nội dung, tắt blur trên màn hình nhỏ để chống lag */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

@media (min-width: 768px) {
  .glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  }
}

.gradient-text {
  background: linear-gradient(135deg, #2b3eff 0%, #1e24fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Micro-animations */
.btn-bounce {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.2s ease;
}
.btn-bounce:active {
  transform: scale(0.96);
}

.hover-glow {
  transition: all 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

/* Hiệu ứng tia sáng lướt qua nút */
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(30deg) translate(-100%, -100%);
  animation: shimmer-effect 3s infinite;
  pointer-events: none;
}

@keyframes shimmer-effect {
  0% { transform: rotate(30deg) translate(-100%, -100%); }
  20% { transform: rotate(30deg) translate(50%, 50%); }
  100% { transform: rotate(30deg) translate(50%, 50%); }
}

.card-hover {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.smooth-transition {
  transition: all 0.2s ease-in-out;
}
