/* ============================================
   Widget nổi "Giờ vàng" — partials/books/golden-hour-float.blade.php
   Vị trí: fixed bottom 140px / right 16px, nằm trên nút chat (>=1280px: right 32px)
   ============================================ */

.gh-float {
  /* Doi mau nut o day: mau do thuong hieu Langmaster. */
  --gh-accent: #e23b3b;
  --gh-accent-dark: #b3131b;
  --gh-accent-shadow: 179, 19, 27;

  position: fixed;
  bottom: 140px;
  right: 16px;
  /* Cao hon icon chat (Zalo/Messenger) va #back-to-top de khong bi che. */
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(24px) scale(.96);
  pointer-events: none;
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1),
              transform .7s cubic-bezier(.22, .61, .36, 1);
}

.gh-float.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.gh-float.is-leaving {
  opacity: 0;
  transform: translateY(16px) scale(.92);
  pointer-events: none;
}

/* --- Nút đóng --- */
.gh-float-close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: color .25s ease, transform .25s ease;
}
.gh-float-close svg { width: 10px; height: 10px; }
.gh-float-close:hover { color: #db1f1f; transform: scale(1.1); }

/* --- Vùng bấm --- */
.gh-float-btn {
  display: block;
  width: 200px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* --- Cụm bìa sách xoè --- */
.gh-float-books {
  position: relative;
  display: block;
  width: 100%;
  height: 114px;
  margin-bottom: -14px;
}

.gh-float-book {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: block;
  width: 70px;
  transform-origin: bottom center;
}
.gh-float-book img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, .22);
  /* Nhun len xuong lech pha nhau -> hieu ung domino. */
  animation: gh-float-domino 3.4s ease-in-out infinite;
}
.gh-float-book--1 img { animation-delay: 0s; }
.gh-float-book--2 img { animation-delay: .38s; }
.gh-float-book--3 img { animation-delay: .76s; }

.gh-float-book--1 { transform: translateX(-104%) rotate(-13deg); z-index: 1; }
.gh-float-book--2 { transform: translateX(-50%) rotate(0deg) translateY(-6px); z-index: 3; }
.gh-float-book--3 { transform: translateX(4%) rotate(13deg); z-index: 2; }


@keyframes gh-float-domino {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-11px); }
}

/* --- Nút pill xanh --- */
.gh-float-pill {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gh-accent) 0%, var(--gh-accent-dark) 100%);
  color: #fff;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 12px 26px rgba(var(--gh-accent-shadow), .38);
  overflow: hidden;
  animation: gh-float-breathe 4.2s ease-in-out infinite;
  transition: transform .25s ease, box-shadow .25s ease;
}
.gh-float-btn:hover .gh-float-pill {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(var(--gh-accent-shadow), .5);
}
.gh-float-btn:active .gh-float-pill { transform: translateY(0) scale(.98); }

/* Vệt sáng quét qua nút */
.gh-float-pill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 42%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: gh-float-shine 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gh-float-shine {
  0%, 72% { left: -60%; }
  100% { left: 120%; }
}
@keyframes gh-float-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}


.gh-float-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}
.gh-float-text-top {
  font-size: 12px;
  font-weight: 500;
  opacity: .92;
}
.gh-float-text-main {
  font-size: 15px;
  font-weight: 700;
}

/* --- Responsive --- */
@media (min-width: 1280px) {
  .gh-float { right: 32px; }
}

@media (max-width: 480px) {
  .gh-float { bottom: 150px; right: 12px; }
  .gh-float-btn { width: 180px; }
  .gh-float-books { height: 100px; margin-bottom: -12px; }
  .gh-float-book { width: 60px; }
  .gh-float-book img { border-radius: 8px; }
  .gh-float-pill { padding: 9px 14px; }
  .gh-float-text-top { font-size: 11px; }
  .gh-float-text-main { font-size: 13.5px; }
}

/* --- Giảm chuyển động theo thiết lập hệ thống --- */
@media (prefers-reduced-motion: reduce) {
  .gh-float,
  .gh-float-books,
  .gh-float-book,
  .gh-float-book img,
  .gh-float-pill,
  .gh-float-pill::after { animation: none; transition: none; }
}
