/* Site-wide playful button FX (body.hub-btn-fx + navbar) */

/* ── All page buttons ── */
body.hub-btn-fx .btn,
body.hub-btn-fx a.btn,
body.hub-btn-fx button.btn,
body.hub-btn-fx .button_manu2,
body.hub-btn-fx .button_manu,
body.hub-btn-fx .button_manu3,
body.hub-btn-fx .button_manu4,
body.hub-btn-fx .button_manu5,
body.hub-btn-fx .button_manu6,
body.hub-btn-fx .button_manu7,
body.hub-btn-fx .quiz-subject-btn,
body.hub-btn-fx .custom1,
body.hub-btn-fx .grade-nav-btn,
body.hub-btn-fx .qx-btn,
body.hub-btn-fx .ql-btn-back,
body.hub-btn-fx .ql-card,
body.hub-btn-fx .button2,
body.hub-btn-fx .button3,
body.hub-btn-fx .uplevel-btn,
.precadet-hub-fx .btn,
.precadet-hub-fx a.btn,
.precadet-hub-fx .button_manu2,
.precadet-hub-fx .custom1,
.precadet-hub-fx .quiz-subject-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: translateY(0) scale(1);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
  will-change: transform;
}

body.hub-btn-fx .btn:not(:disabled):not(.disabled)::after,
body.hub-btn-fx a.btn::after,
body.hub-btn-fx .button_manu2::after,
body.hub-btn-fx .quiz-subject-btn::after,
body.hub-btn-fx .custom1::after,
body.hub-btn-fx .qx-btn::after,
body.hub-btn-fx .ql-card::after,
body.hub-btn-fx .button2::after,
body.hub-btn-fx .button3::after,
.precadet-hub-fx .btn::after,
.precadet-hub-fx .custom1::after,
.precadet-hub-fx .button_manu2::after {
  content: "";
  position: absolute;
  inset: -50% -30%;
  background: linear-gradient(
    110deg,
    transparent 40%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 60%
  );
  transform: translateX(-70%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

body.hub-btn-fx .btn:not(:disabled):not(.disabled):hover,
body.hub-btn-fx a.btn:hover,
body.hub-btn-fx button.btn:not(:disabled):hover,
body.hub-btn-fx .button_manu2:hover,
body.hub-btn-fx .button_manu:hover,
body.hub-btn-fx .quiz-subject-btn:hover,
body.hub-btn-fx .custom1:hover,
body.hub-btn-fx .qx-btn:not(:disabled):hover,
body.hub-btn-fx .ql-btn-back:hover,
body.hub-btn-fx .ql-card:hover,
body.hub-btn-fx .button2:hover,
body.hub-btn-fx .button3:hover,
.precadet-hub-fx .btn:hover,
.precadet-hub-fx .custom1:hover,
.precadet-hub-fx .button_manu2:hover {
  transform: translateY(-5px) scale(1.03);
  filter: saturate(1.12) brightness(1.03);
  box-shadow:
    0 8px 0 rgba(15, 23, 42, 0.35),
    0 14px 22px rgba(15, 23, 42, 0.18);
  z-index: 2;
}

body.hub-btn-fx .btn:not(:disabled):hover::after,
body.hub-btn-fx a.btn:hover::after,
body.hub-btn-fx .button_manu2:hover::after,
body.hub-btn-fx .quiz-subject-btn:hover::after,
body.hub-btn-fx .custom1:hover::after,
body.hub-btn-fx .qx-btn:hover::after,
body.hub-btn-fx .ql-card:hover::after,
.precadet-hub-fx .btn:hover::after,
.precadet-hub-fx .custom1:hover::after {
  opacity: 1;
  animation: hub-btn-shine 0.7s ease-out;
}

body.hub-btn-fx .btn:not(:disabled):active,
body.hub-btn-fx a.btn:active,
body.hub-btn-fx .button_manu2:active,
body.hub-btn-fx .qx-btn:active,
body.hub-btn-fx .ql-card:active,
.precadet-hub-fx .btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 2px 0 rgba(15, 23, 42, 0.35),
    0 4px 8px rgba(15, 23, 42, 0.15);
}

body.hub-btn-fx .btn:disabled,
body.hub-btn-fx .btn.disabled,
body.hub-btn-fx .qx-btn:disabled {
  transform: none !important;
  animation: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Big CTA only when marked */
body.hub-btn-fx .hub-cta-btn,
.precadet-hub-fx .hub-cta-btn {
  border: 3px solid #111 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 0 #111, 0 14px 22px rgba(15, 23, 42, 0.18) !important;
  background-image: linear-gradient(135deg, #fde68a 0%, #f59e0b 55%, #d97706 100%) !important;
  animation: hub-sparkle-pulse 2.5s ease-in-out infinite;
}

body.hub-btn-fx .hub-cta-btn:hover,
.precadet-hub-fx .hub-cta-btn:hover {
  transform: translateY(-7px) scale(1.025) !important;
  box-shadow: 0 14px 0 #111, 0 24px 32px rgba(15, 23, 42, 0.24) !important;
}

/* ── Navbar ── */
.navbar.hub-btn-fx .btn,
.navbar.hub-btn-fx a.btn,
.navbar.hub-btn-fx button.btn,
.navbar.hub-btn-fx #buyBtn,
.navbar.hub-btn-fx .btn-group > .btn {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  border: 2px solid #111 !important;
  border-radius: 10px !important;
  box-shadow:
    0 5px 0 #111,
    0 10px 16px rgba(0, 0, 0, 0.22) !important;
  transform: translateY(0) scale(1);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease !important;
  animation: hub-nav-float 2.6s ease-in-out infinite;
  z-index: 1;
}

.navbar.hub-btn-fx .btn:nth-of-type(2n),
.navbar.hub-btn-fx #buyBtn:nth-of-type(2n),
.navbar.hub-btn-fx .btn-group:nth-of-type(2n) > .btn { animation-delay: 0.12s; }
.navbar.hub-btn-fx .btn:nth-of-type(3n),
.navbar.hub-btn-fx #buyBtn:nth-of-type(3n),
.navbar.hub-btn-fx .btn-group:nth-of-type(3n) > .btn { animation-delay: 0.24s; }
.navbar.hub-btn-fx .btn:nth-of-type(4n),
.navbar.hub-btn-fx #buyBtn:nth-of-type(4n),
.navbar.hub-btn-fx .btn-group:nth-of-type(4n) > .btn { animation-delay: 0.36s; }

.navbar.hub-btn-fx .btn::before,
.navbar.hub-btn-fx #buyBtn::before,
.navbar.hub-btn-fx .btn-group > .btn::before {
  content: "";
  position: absolute;
  inset: -40% -25%;
  background: linear-gradient(
    110deg,
    transparent 38%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 62%
  );
  transform: translateX(-75%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.navbar.hub-btn-fx .btn:hover,
.navbar.hub-btn-fx a.btn:hover,
.navbar.hub-btn-fx button.btn:hover,
.navbar.hub-btn-fx #buyBtn:hover,
.navbar.hub-btn-fx .btn-group > .btn:hover {
  transform: translateY(-6px) scale(1.06) !important;
  filter: saturate(1.15) brightness(1.06);
  box-shadow:
    0 10px 0 #111,
    0 18px 24px rgba(0, 0, 0, 0.28) !important;
  animation: hub-nav-wiggle 0.45s ease !important;
  z-index: 5;
}

.navbar.hub-btn-fx .btn:hover::before,
.navbar.hub-btn-fx #buyBtn:hover::before,
.navbar.hub-btn-fx .btn-group > .btn:hover::before {
  opacity: 1;
  animation: hub-btn-shine 0.65s ease-out;
}

.navbar.hub-btn-fx .btn:active,
.navbar.hub-btn-fx #buyBtn:active,
.navbar.hub-btn-fx .btn-group > .btn:active {
  transform: translateY(1px) scale(0.97) !important;
  box-shadow:
    0 2px 0 #111,
    0 4px 8px rgba(0, 0, 0, 0.2) !important;
  animation: none !important;
}

.navbar.hub-btn-fx .dropdown-menu .btn,
.navbar.hub-btn-fx .dropdown-menu #buyBtn {
  animation: none !important;
  box-shadow: 0 3px 0 #111 !important;
  margin: 4px 8px !important;
  width: calc(100% - 16px);
}

.navbar.hub-btn-fx .dropdown-menu .btn:hover,
.navbar.hub-btn-fx .dropdown-menu #buyBtn:hover {
  transform: translateY(-3px) scale(1.02) !important;
  animation: none !important;
}

.navbar.hub-btn-fx .btn-group { vertical-align: middle; }

.navbar.hub-btn-fx .navbar-toggler {
  border: 2px solid #111 !important;
  box-shadow: 0 4px 0 #111;
}

/* ── Corner / floating screen buttons ── */
body.hub-btn-fx .btn-top,
body.hub-btn-fx .od-btn-top,
body.hub-btn-fx a.btn-top,
body.hub-btn-fx a.od-btn-top {
  border: 3px solid #111 !important;
  box-shadow:
    0 6px 0 #111,
    0 12px 20px rgba(15, 23, 42, 0.35) !important;
  animation: hub-corner-bounce 2.2s ease-in-out infinite !important;
}

body.hub-btn-fx .btn-top:hover,
body.hub-btn-fx .od-btn-top:hover {
  transform: translateY(-8px) scale(1.1) !important;
  box-shadow:
    0 12px 0 #111,
    0 20px 28px rgba(15, 23, 42, 0.4) !important;
  animation: hub-nav-wiggle 0.45s ease !important;
}

body.hub-btn-fx .tutor-draw-btn,
body.hub-btn-fx #tutor-draw-bar .tutor-draw-btn,
body.hub-btn-fx #tutor-draw-bar button:not(.live-pen-tool) {
  border: 2px solid #111 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 0 #111 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease !important;
}

body.hub-btn-fx .tutor-draw-btn:hover,
body.hub-btn-fx #tutor-draw-bar button:not(.live-pen-tool):hover {
  transform: translateY(-4px) scale(1.05) !important;
  filter: saturate(1.1);
  box-shadow: 0 8px 0 #111, 0 12px 18px rgba(0, 0, 0, 0.2) !important;
}

/* Pen/cursor color tools: no hub FX (keep original soft shadow) */
body.hub-btn-fx .live-pen-tool,
body.hub-btn-fx .live-pen-tool:hover,
body.hub-btn-fx #tutor-draw-bar .live-pen-tool,
body.hub-btn-fx #tutor-draw-bar .live-pen-tool:hover {
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

body.hub-btn-fx #tutor-draw-bar,
body.hub-btn-fx #tutor-draw-rail,
body.hub-btn-fx #quiz-live-float-panel {
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.25));
}

body.hub-btn-fx .close,
body.hub-btn-fx .close:hover {
  transform: none !important;
  box-shadow: none !important;
  animation: none !important;
  filter: none !important;
}

/* ── student_live page buttons (exclude .live-pen-tool) ── */
body.hub-btn-fx .custom-btn,
body.hub-btn-fx .btn-expand,
body.hub-btn-fx .btn-choice:not(:disabled),
body.hub-btn-fx .close-expand,
body.hub-btn-fx .leave-room-btn,
body.hub-btn-fx .tutor-draw-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease !important;
  will-change: transform;
}

body.hub-btn-fx .custom-btn {
  border: 2px solid #111 !important;
  box-shadow:
    0 5px 0 #111,
    0 10px 16px rgba(15, 23, 42, 0.22) !important;
}

body.hub-btn-fx .btn-expand,
body.hub-btn-fx .close-expand {
  border: 2px solid #111 !important;
  box-shadow: 0 4px 0 #111 !important;
}

body.hub-btn-fx .leave-room-btn {
  display: inline-block;
  padding: 4px 12px;
  margin-left: 4px;
  border-radius: 999px;
  border: 2px solid #111 !important;
  background: #ffe8e6;
  color: #c0392b !important;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 3px 0 #111 !important;
}

body.hub-btn-fx .custom-btn:hover,
body.hub-btn-fx .btn-expand:hover,
body.hub-btn-fx .btn-choice:not(:disabled):hover,
body.hub-btn-fx .close-expand:hover,
body.hub-btn-fx .leave-room-btn:hover {
  transform: translateY(-5px) scale(1.04) !important;
  filter: saturate(1.12) brightness(1.05) !important;
  box-shadow:
    0 9px 0 #111,
    0 14px 22px rgba(15, 23, 42, 0.25) !important;
  z-index: 2;
}

body.hub-btn-fx .custom-btn:active,
body.hub-btn-fx .btn-expand:active,
body.hub-btn-fx .btn-choice:not(:disabled):active,
body.hub-btn-fx .close-expand:active,
body.hub-btn-fx .leave-room-btn:active {
  transform: translateY(1px) scale(0.98) !important;
  box-shadow:
    0 2px 0 #111,
    0 4px 8px rgba(15, 23, 42, 0.18) !important;
}

body.hub-btn-fx .btn-choice:disabled,
body.hub-btn-fx .btn-choice:disabled:hover {
  transform: none !important;
  filter: none !important;
  animation: none !important;
}

/* ── studentboard_popup: all buttons + day select ── */
body.studentboard-fx button,
body.studentboard-fx #day-select {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid #111 !important;
  box-shadow:
    0 4px 0 #111,
    0 8px 14px rgba(0, 0, 0, 0.35) !important;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease !important;
  will-change: transform;
}

body.studentboard-fx button:hover,
body.studentboard-fx #day-select:hover {
  transform: translateY(-4px) scale(1.04) !important;
  filter: saturate(1.12) brightness(1.06) !important;
  box-shadow:
    0 8px 0 #111,
    0 14px 22px rgba(0, 0, 0, 0.4) !important;
  z-index: 2;
}

body.studentboard-fx button:active,
body.studentboard-fx #day-select:active {
  transform: translateY(1px) scale(0.98) !important;
  box-shadow:
    0 2px 0 #111,
    0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

@keyframes hub-btn-shine {
  from { transform: translateX(-75%) rotate(8deg); }
  to { transform: translateX(75%) rotate(8deg); }
}

@keyframes hub-nav-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes hub-nav-wiggle {
  0%, 100% { transform: translateY(-6px) rotate(0deg) scale(1.06); }
  25% { transform: translateY(-6px) rotate(-2.5deg) scale(1.06); }
  75% { transform: translateY(-6px) rotate(2.5deg) scale(1.06); }
}

@keyframes hub-sparkle-pulse {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.12) brightness(1.05); }
}

@keyframes hub-corner-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  body.hub-btn-fx .btn,
  body.hub-btn-fx .btn-top,
  body.hub-btn-fx .od-btn-top,
  body.hub-btn-fx .ql-card,
  body.hub-btn-fx .hub-cta-btn,
  .navbar.hub-btn-fx .btn,
  .navbar.hub-btn-fx #buyBtn,
  .navbar.hub-btn-fx .btn-group > .btn,
  .precadet-hub-fx .btn,
  .precadet-hub-fx .button_manu2 {
    animation: none !important;
  }
}
