/*
* halloween.css
* Temporary Halloween event theme.
* All rules are scoped under `html.halloween` (added by commonMaster.blade.php
* when App\Helpers\Halloween::active() is true). To restore the normal theme,
* set HALLOWEEN_ENABLED=false or wait for the event window to end — nothing
* here applies without the `halloween` class on <html>.
******************************************************************************/

html.halloween {
  --halloween-orange: #ff7518;
  --halloween-orange-light: #ffa94d;
  --halloween-purple: #6d28d9;
  --halloween-purple-dark: #3b0764;
  --halloween-night: #1a1030;
}

@font-face {
  font-family: 'Scary Halloween';
  src: url('/assets/vendor/fonts/halloween/Scary Halloween Font.ttf') format('truetype');
  font-display: swap;
}

/* --------------------------------------------------------------------------
* Spooky page ambience
* ------------------------------------------------------------------------ */

/* Gradient strip along the top of the front navbar */
html.halloween .layout-navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--halloween-purple) 0%, var(--halloween-orange) 50%, var(--halloween-purple) 100%);
  z-index: 5;
  pointer-events: none;
}

/* Accent colors */
html.halloween .text-primary,
html.halloween a.text-primary {
  color: var(--halloween-orange) !important;
}
html.halloween a:hover {
  color: var(--halloween-orange);
}

/* Buttons become pumpkin gradient */
html.halloween .btn-primary {
  background: linear-gradient(135deg, var(--halloween-orange) 0%, #e85d04 100%) !important;
  border-color: var(--halloween-orange) !important;
  box-shadow: 0 4px 14px rgba(255, 117, 24, 0.35);
}
html.halloween .btn-primary:hover,
html.halloween .btn-primary:focus {
  background: linear-gradient(135deg, #ff8c3a 0%, var(--halloween-orange) 100%) !important;
  box-shadow: 0 6px 18px rgba(255, 117, 24, 0.5);
  transform: translateY(-1px);
}

/* Headings get a subtle purple text shadow */
html.halloween .section-py h1,
html.halloween .section-py h2,
html.halloween .section-py h3 {
  text-shadow: 0 2px 12px rgba(109, 40, 217, 0.15);
}

/* Badges */
html.halloween .badge.bg-primary {
  background-color: var(--halloween-purple) !important;
}

/* Footer accent */
html.halloween .landing-footer {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--halloween-purple), var(--halloween-orange), var(--halloween-purple)) 1;
}

/* --------------------------------------------------------------------------
* Help-center / extensions header — night scene
* (replaces the ::before / ::after artwork with halloween illustrations)
* ------------------------------------------------------------------------ */

html.halloween .help-center-header {
  background-color: var(--halloween-night);
  background-image:
    radial-gradient(1px 1px at 15% 30%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 15%, rgba(255, 233, 168, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 40%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 22%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 45%, rgba(255, 233, 168, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 60%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    linear-gradient(165deg, #3b0764 0%, #241640 45%, #1a1030 100%);
}

/* Glowing moon + bats, top-left */
html.halloween .help-center-header:before {
  width: 21rem;
  height: 21rem;
  top: -120px;
  background-image: url('/assets/img/pages/halloween-moon.svg');
}
html.halloween:not([dir='rtl']) .help-center-header:before {
  left: -105px;
}
html.halloween[dir='rtl'] .help-center-header:before {
  right: -105px;
  transform: none;
}

/* Jack-o'-lanterns, bottom-right */
html.halloween .help-center-header:after {
  width: 9rem;
  height: 18rem;
  bottom: -40px;
  background-image: url('/assets/img/pages/halloween-pumpkins.svg');
}
html.halloween:not([dir='rtl']) .help-center-header:after {
  right: -0.5rem;
  transform: none;
}
html.halloween[dir='rtl'] .help-center-header:after {
  left: -0.5rem;
  transform: scaleX(-1);
}

/* Header text on the night sky */
html.halloween .help-center-header h1,
html.halloween .help-center-header h2,
html.halloween .help-center-header h3,
html.halloween .help-center-header h4,
html.halloween .help-center-header h5 {
  color: #ffe9a8;
  text-shadow: 0 0 18px rgba(255, 184, 92, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
}
html.halloween .help-center-header p,
html.halloween .help-center-header .text-muted {
  color: rgba(255, 233, 200, 0.75) !important;
}

/* ...but keep card content readable on the cards' light background */
html.halloween .help-center-header .card h1,
html.halloween .help-center-header .card h2,
html.halloween .help-center-header .card h3,
html.halloween .help-center-header .card h4,
html.halloween .help-center-header .card h5,
html.halloween .help-center-header .card p,
html.halloween .help-center-header .card .text-muted {
  color: inherit !important;
  text-shadow: none;
}
html.halloween .help-center-header .extension-search-container .form-control,
html.halloween .help-center-header .input-group-text {
  border-color: rgba(255, 117, 24, 0.4);
}
html.halloween .help-center-header .form-select {
  border-color: rgba(255, 117, 24, 0.4);
}

/* --------------------------------------------------------------------------
* Halloween Deal card (extensions listing — price matches special_price)
* ------------------------------------------------------------------------ */

/* Halloween Deal card: keeps the normal card design, marked by a discount
   tag hanging down from the top-left edge + a subtle spooky glow */
html.halloween .extension-container--halloween {
  position: relative;
  border: 1px solid rgba(255, 117, 24, 0.55) !important;
  animation: halloween-card-glow 3s ease-in-out infinite alternate;
}
html.halloween .extension-container--halloween:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(109, 40, 217, 0.35), 0 0 22px rgba(255, 117, 24, 0.45);
}
html.halloween .extension-container--halloween .extension-price-item {
  color: var(--halloween-orange);
}
/* Plugin name in the spooky font */
html.halloween .extension-container--halloween h5 {
  font-family: 'Scary Halloween', 'IBM Plex Sans', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--halloween-orange-light) !important;
}

@keyframes halloween-card-glow {
  from {
    box-shadow: 0 0 6px rgba(255, 117, 24, 0.25), 0 0 18px rgba(109, 40, 217, 0.15);
  }
  to {
    box-shadow: 0 0 14px rgba(255, 117, 24, 0.5), 0 0 32px rgba(109, 40, 217, 0.3);
  }
}

/* Discount tag hanging from the card's top-left edge */
html.halloween .halloween-deal-tag {
  position: absolute;
  top: 6px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--halloween-purple) 0%, var(--halloween-purple-dark) 100%);
  border: 1px solid var(--halloween-orange);
  border-radius: 3px 3px 10px 10px;
  box-shadow: 0 4px 10px rgba(59, 7, 100, 0.45);
  transform-origin: 50% -6px;
  animation: halloween-tag-swing 4s ease-in-out infinite;
}
/* string attaching the tag to the card's top edge */
html.halloween .halloween-deal-tag::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 1px;
  height: 7px;
  background: var(--halloween-orange);
}

@keyframes halloween-tag-swing {
  0%, 100% {
    transform: rotate(-3.5deg);
  }
  50% {
    transform: rotate(3.5deg);
  }
}

/* --------------------------------------------------------------------------
* Decorations injected by halloween.js
* ------------------------------------------------------------------------ */

/* Fixed layer holding all decorations — never blocks clicks */
.halloween-decor-layer {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
  overflow: hidden;
}

/* Spider hanging from the top-right, gently bobbing */
.halloween-spider {
  position: fixed;
  top: 0;
  right: 6%;
  z-index: 1080;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: halloween-spider-bob 5s ease-in-out infinite;
}
.halloween-spider::before {
  content: '';
  width: 1px;
  height: var(--halloween-web-length, 90px);
  background: rgba(120, 120, 120, 0.7);
}
.halloween-spider span {
  font-size: 1.9rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}
@keyframes halloween-spider-bob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(14px);
  }
}

/* Countdown banner hanging from the top-left corner */
.halloween-banner {
  position: fixed;
  top: 0;
  left: 26px;
  z-index: 1090;
  cursor: pointer;
  text-decoration: none;
  transform-origin: top center;
  animation: halloween-banner-sway 5s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}
.halloween-banner:hover {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)) brightness(1.15);
}
.halloween-banner:hover .halloween-banner__label {
  text-decoration: underline;
}
.halloween-banner__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 14px 20px;
  background: linear-gradient(180deg, var(--halloween-purple) 0%, var(--halloween-purple-dark) 100%);
  border: 1px solid rgba(255, 117, 24, 0.6);
  border-top: none;
  /* ribbon with a V-notch cut at the bottom */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
}
.halloween-banner__emoji {
  width: 2.3rem;
  height: auto;
  line-height: 1.1;
}
.halloween-banner__count {
  font-family: 'Scary Halloween', 'IBM Plex Sans', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--halloween-orange-light);
  text-shadow: 0 0 10px rgba(255, 117, 24, 0.55);
  line-height: 1.1;
}
.halloween-banner__total {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 233, 200, 0.7);
}
.halloween-banner__label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 233, 200, 0.85);
}
@keyframes halloween-banner-sway {
  0%, 100% {
    transform: rotate(-1.6deg);
  }
  50% {
    transform: rotate(1.6deg);
  }
}
@media (max-width: 575.98px) {
  .halloween-banner {
    left: 10px;
  }
}

/* Corner cobwebs */
.halloween-web {
  position: fixed;
  z-index: 1080;
  pointer-events: none;
  font-size: 4rem;
  line-height: 1;
  opacity: 0.85;
}
.halloween-web--tl {
  top: 0;
  left: 0;
}
.halloween-web--tr {
  top: -1rem;
  right: -1rem;
  transform: scaleX(-1);
}

/* Accessibility: no motion for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.halloween .extension-container--halloween,
  html.halloween .halloween-deal-tag,
  html.halloween .halloween-banner,
  .halloween-spider {
    animation: none !important;
  }
}
