/* ============================================================
   BOXFUL Brand Custom Theme, Responsive Layout & RTL Engine
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;700;900&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --boxful-teal-dark: #021E22;
  --boxful-teal-deep: #084C55;
  --boxful-teal: #00A896;
  --boxful-mint: #00C4B4;
  --boxful-mint-glow: #00E5C9;
  --boxful-gold: #FACC15;
  --boxful-card-bg: rgba(8, 76, 85, 0.25);
  --boxful-card-border: rgba(0, 229, 201, 0.22);
}

body {
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--boxful-teal-dark);
  color: #F8FAFC;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* RTL (Arabic) Support */
html[dir="rtl"], body.rtl-mode {
  font-family: 'Cairo', 'Pretendard', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

html[dir="rtl"] #mobile-nav-drawer {
  left: 0;
  right: auto;
}

/* Glassmorphism Classes */
.boxful-glass {
  background: rgba(3, 28, 32, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--boxful-card-border);
}

.boxful-glass-hover {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.boxful-glass-hover:hover {
  border-color: rgba(0, 229, 201, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -8px rgba(0, 229, 201, 0.22);
}

/* Glow Effects */
.glow-mint {
  box-shadow: 0 0 35px -5px rgba(0, 229, 201, 0.25);
}

.glow-gold {
  box-shadow: 0 0 35px -5px rgba(250, 204, 21, 0.25);
}

/* Marquee Animations */
@keyframes marquee-left {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee-left {
  display: flex;
  width: max-content;
  animation: marquee-left 36s linear infinite;
}

.animate-marquee-left:hover {
  animation-play-state: paused;
}

/* Floating Character Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Pulse Glow */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(0, 229, 201, 0.5)); }
  50% { opacity: 0.85; filter: drop-shadow(0 0 16px rgba(0, 229, 201, 0.85)); }
}

.animate-pulse-glow {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ============================================================
   Photo Gallery Carousel
   The track is a native horizontal scroller, so touch swipe, trackpad and
   keyboard paging come for free on every breakpoint; js/gallery.js layers the
   arrow buttons and mouse drag-to-scroll on top of it.
   ============================================================ */
.gallery-track {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Block padding leaves room for the cards' drop shadow, which a scroll container clips. */
  padding: 0.5rem 1rem;
  scroll-padding-inline: 1rem;
  cursor: grab;
  /* The app-wide scrollbar reset lives in GlobalStyles, which this page opts out of. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track:focus-visible {
  outline: 2px solid var(--boxful-mint-glow);
  outline-offset: -2px;
  border-radius: 1rem;
}

.gallery-slide {
  scroll-snap-align: start;
}

/* Dragging an image starts a native HTML5 drag, which cancels the pointer stream. */
.gallery-track img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Snapping and smooth scrolling fight the scrollLeft set on every pointermove. */
.gallery-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(2, 30, 34, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--boxful-card-border);
  color: var(--boxful-mint-glow);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: opacity 0.25s, background-color 0.25s, color 0.25s;
}

.gallery-nav:hover {
  background: var(--boxful-teal);
  color: #FFFFFF;
}

.gallery-nav-prev {
  inset-inline-start: 0.25rem;
}

.gallery-nav-next {
  inset-inline-end: 0.25rem;
}

/* Set by js/gallery.js once the track has reached that end. */
.gallery-nav[data-at-end="true"] {
  opacity: 0;
  pointer-events: none;
}

/* Touch devices swipe the track directly; arrows would only cover the photos. */
@media (hover: none), (max-width: 639px) {
  .gallery-nav {
    display: none;
  }
}

/* Gradient Masks for Marquee */
.mask-gradient {
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* Video Player Showroom */
#video-stage {
  aspect-ratio: 16 / 9;
  min-height: 380px;
  background: radial-gradient(circle at center, #084C55 0%, #021E22 100%);
}

@media (max-width: 640px) {
  #video-stage {
    min-height: 420px;
  }
}

.video-scene {
  display: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s ease;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
}

@media (min-width: 640px) {
  .video-scene {
    padding: 2.5rem;
  }
}

.video-scene.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.video-progress-bar {
  background: linear-gradient(9px, var(--boxful-mint-glow), var(--boxful-gold));
  box-shadow: 0 0 10px var(--boxful-mint-glow);
  transition: width 0.05s linear;
}

/* Scene Brand Badge */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 168, 150, 0.2);
  color: var(--boxful-mint-glow);
  border: 1px solid rgba(0, 229, 201, 0.35);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #021E22;
}

::-webkit-scrollbar-thumb {
  background: #084C55;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00A896;
}

/* Touch Friendly Mobile Targets */
button, a {
  touch-action: manipulation;
}
