/* assets/css/floating-menu.css - Tùy Chỉnh Giao Diện & Liên Hệ Nổi (Draggable Hub) */

/* Lớp phủ mờ nền khi mở menu trên Mobile / Tablet */
.floating-hub-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9988;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.floating-hub-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.floating-hub-container {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  user-select: none;
  -webkit-user-select: none;
}

/* Nút tròn chính */
.floating-hub-trigger {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  touch-action: none;
  justify-content: center;
  cursor: grab;
  cursor: -webkit-grab;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-hub-trigger:active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
  transform: scale(0.95);
}

/* Hiệu ứng nhịp thở phát sáng */
.floating-hub-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: hubPulse 2.5s infinite;
  pointer-events: none;
}

@keyframes hubPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.floating-icon-main {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-icon-close {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-hub-container.active .floating-icon-main {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.floating-hub-container.active .floating-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.floating-hub-container.active .floating-hub-trigger {
  box-shadow: 0 0 25px var(--primary-glow), 0 0 35px rgba(255, 255, 255, 0.3);
}

/* Khung Bảng Tùy Chỉnh Giao Diện */
.floating-hub-menu {
  position: absolute;
  top: 50%;
  right: 66px;
  transform: translateY(-50%) scale(0.9);
  width: 310px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: rgba(14, 18, 30, 0.96);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(139, 92, 246, 0.2);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: right center;
  z-index: 9991;
  box-sizing: border-box;
}

/* Khi kéo sang nửa bên trái thì mở menu trổ sang bên phải */
.floating-hub-container.flip-right .floating-hub-menu {
  right: auto;
  left: 66px;
  transform-origin: left center;
}

.floating-hub-container.active .floating-hub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

/* Header của Menu */
.floating-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.floating-menu-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.floating-menu-title i {
  color: var(--secondary);
}

.floating-menu-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.floating-menu-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Thân Menu có thể cuộn độc lập */
.floating-menu-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.floating-menu-body::-webkit-scrollbar {
  width: 4px;
}
.floating-menu-body::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 999px;
}

/* Từng khối cài đặt */
.customizer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customizer-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customizer-label i {
  color: var(--primary);
  font-size: 0.85rem;
}

/* 1. Nút Sáng / Tối */
.customizer-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.theme-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-mode-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* 2. Bảng Màu Sắc Chủ Đề */
.color-palette-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 14px var(--c);
}

/* 3. Thay Background Body */
.bg-pattern-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bg-option-btn {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.bg-option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  color: #fff;
}

.bg-option-btn.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--secondary);
  color: #fff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Nút tải ảnh nền tự chọn từ máy */
.custom-bg-upload-container {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-bg-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed var(--border-color);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.custom-bg-upload-btn i {
  color: var(--secondary);
  font-size: 0.95rem;
}

.custom-bg-upload-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--secondary);
  color: #fff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

/* Box hiển thị thumbnail ảnh tự tải */
.custom-bg-preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--primary);
  border-radius: 8px;
  gap: 10px;
}

.custom-bg-preview-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.custom-bg-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.custom-bg-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.custom-bg-meta strong {
  font-size: 0.75rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-bg-meta small {
  font-size: 0.65rem;
  color: var(--secondary);
}

.custom-bg-remove-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.custom-bg-remove-btn:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Hỗ trợ Light Theme cho Custom Upload Box */
body.theme-light .custom-bg-upload-btn {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.15);
  color: #475569;
}

body.theme-light .custom-bg-upload-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
}

body.theme-light .custom-bg-preview-box {
  background: #f1f5f9;
  border-color: var(--primary);
}

body.theme-light .custom-bg-meta strong {
  color: #0f172a;
}

/* 4. Đổi Ngôn Ngữ */
.lang-picker-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.lang-btn {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: #fff;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* 5. Thông Tin Liên Hệ */
.contact-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Nút App Clip trong Hub Tuỳ Biến */
.app-clip-hub-launch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.app-clip-hub-launch-btn i {
  font-size: 1rem;
}

.app-clip-hub-launch-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.contact-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.contact-card-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateX(3px);
}

.contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.contact-icon.tg { background: #229ed9; }
.contact-icon.ds { background: #5865f2; }
.contact-icon.ml { background: #ef4444; }

.contact-card-item div strong {
  display: block;
  font-size: 0.8rem;
  color: #fff;
}

.contact-card-item div small {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.floating-menu-footer-hint {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
}

/* Khi đang kéo di chuyển (dragging) */
.floating-hub-container.is-dragging {
  transition: none !important;
}

.floating-hub-container.is-dragging .floating-hub-trigger {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85), 0 0 30px var(--primary-glow);
}

/* Responsive trên điện thoại & máy tính bảng nhỏ */
@media (max-width: 768px) {
  .floating-hub-trigger {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  /* Trên màn hình nhỏ, mở menu cố định ở giữa màn hình chuẩn Modal, không bị lệch hoặc tràn màn hình */
  .floating-hub-menu {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(340px, calc(100vw - 28px)) !important;
    max-height: 75vh !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    transform-origin: center center !important;
    border-radius: 22px !important;
    padding: 16px 14px !important;
    z-index: 9999 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--primary-glow) !important;
  }

  .floating-hub-container.active .floating-hub-menu {
    transform: translate(-50%, -50%) scale(1) !important;
  }

  .floating-menu-body {
    max-height: calc(75vh - 75px);
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ẨN THANH CÔNG CỤ VÀ LỚP PHỦ CỦA GOOGLE TRANSLATE ĐỂ GIỮ NGUYÊN GIAO DIỆN CINEMATIC */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}

body {
  top: 0px !important;
  position: static !important;
}

.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

#google_translate_element {
  display: none !important;
}
