/* ============================================================
   FILE: public/assets/css/app.css
   SunsetRide Bali — Premium Design System
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand */
  --color-primary:       #FF7A00;
  --color-primary-dark:  #E06D00;
  --color-primary-light: #FF9A3C;
  --color-secondary:     #FFB347;

  /* Surface */
  --color-cream:    #FFFDF8;
  --color-cream-2:  #FFF8EE;
  --color-dark:     #1F2937;
  --color-dark-2:   #111827;

  /* Text */
  --color-text-primary:   #1F2937;
  --color-text-secondary: #4B5563;
  --color-text-muted:     #9CA3AF;

  /* Border */
  --color-border:       #E5E7EB;
  --color-border-hover: #D1D5DB;

  /* Status */
  --color-success: #059669;
  --color-error:   #DC2626;
  --color-info:    #2563EB;

  /* Easing — konsisten di seluruh file */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Duration */
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-enter:  600ms;

  /* Radius */
  --radius-sm:   0.5rem;
  --radius-base: 0.75rem;
  --radius-lg:   1rem;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-primary: 0 8px 24px rgba(255,122,0,0.25);
}


/* ============================================================
   2. BASE
   ============================================================ */
html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--color-primary);
  color: #ffffff;
}

::-moz-selection {
  background: var(--color-primary);
  color: #ffffff;
}


/* ============================================================
   3. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: var(--radius-full);
  transition: background var(--duration-base) var(--ease-smooth);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}


/* ============================================================
   4. ACCESSIBILITY — FOCUS
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}


/* ============================================================
   5. WELCOME SCREEN
   ============================================================ */
@keyframes welcomeFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-fade-up {
  animation: welcomeFadeUp 0.7s var(--ease-out) forwards;
  opacity: 0;
}


/* ============================================================
   6. NAVBAR
   ============================================================ */

/* --- Transparent state (di atas hero) --- */
.navbar-transparent {
  background: transparent;
}

.navbar-transparent .navbar-logo-text {
  color: #ffffff;
}

.navbar-transparent .navbar-logo-sub {
  color: rgba(255,255,255,0.55);
}

.navbar-transparent .navbar-menu-item {
  color: rgba(255,255,255,0.80);
}

.navbar-transparent .navbar-menu-item:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.10);
}

.navbar-transparent .navbar-menu-active {
  color: var(--color-secondary);
  background: rgba(255,122,0,0.18);
}

/* --- Scrolled state --- */
.navbar-scrolled {
  background: rgba(255,253,248,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.navbar-scrolled .navbar-logo-text {
  color: var(--color-dark);
}

.navbar-scrolled .navbar-logo-sub {
  color: var(--color-text-muted);
}

.navbar-scrolled .navbar-menu-item {
  color: var(--color-text-secondary);
}

.navbar-scrolled .navbar-menu-item:hover {
  color: var(--color-dark);
  background: rgba(0,0,0,0.04);
}

.navbar-scrolled .navbar-menu-active {
  color: var(--color-primary);
  background: rgba(255,122,0,0.08);
}

.navbar-scrolled .mobile-menu-line {
  background-color: var(--color-dark);
}

/* --- Mobile hamburger animation --- */
.mobile-menu-open .mobile-menu-line:nth-child(1) {
  transform: rotate(45deg) translate(3.5px, 3.5px);
}

.mobile-menu-open .mobile-menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-open .mobile-menu-line:nth-child(3) {
  width: 1.25rem;
  transform: rotate(-45deg) translate(2px, -2px);
}


/* ============================================================
   7. HERO
   ============================================================ */
.hero-slide img {
  -webkit-user-drag: none;
  user-select: none;
}

@media (max-width: 640px) {
  .hero-slide img {
    object-fit: cover;
    object-position: center 30%;
  }

  #heroSearchBox {
    border-radius: var(--radius-lg);
  }
}

@media (min-width: 1024px) {
  #heroSearchBox {
    border-radius: var(--radius-full);
  }
}


/* ============================================================
   8. SCROLL ANIMATIONS
   ============================================================ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  var(--duration-enter) var(--ease-out),
    transform var(--duration-enter) var(--ease-out);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition:
    opacity  var(--duration-enter) var(--ease-out),
    transform var(--duration-enter) var(--ease-out);
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity  var(--duration-enter) var(--ease-out),
    transform var(--duration-enter) var(--ease-out);
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Reduced motion — wajib untuk accessibility */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .welcome-fade-up {
    animation: none;
    opacity: 1;
  }

  .skeleton {
    animation: none;
  }
}


/* ============================================================
   9. LINE CLAMP UTILITIES
   ============================================================ */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ============================================================
   10. FAQ ACCORDION
   ============================================================ */
.faq-toggle {
  transition:
    background var(--duration-base) var(--ease-smooth),
    color      var(--duration-base) var(--ease-smooth);
}

.faq-toggle .faq-icon {
  transition: transform var(--duration-base) var(--ease-spring);
}

.faq-toggle[aria-expanded="true"] {
  background: var(--color-primary);
}

.faq-toggle[aria-expanded="true"] span {
  color: #ffffff;
}

.faq-toggle[aria-expanded="true"] .faq-icon {
  color: #ffffff;
  transform: rotate(45deg);
}


/* ============================================================
   11. SKELETON LOADING
   ============================================================ */
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #F3F4F6 25%,
    #EAECEF 50%,
    #F3F4F6 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s var(--ease-smooth) infinite;
  border-radius: var(--radius-sm);
}


/* ============================================================
   12. TOAST NOTIFICATION
   ============================================================ */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.96);
  }
}

.toast {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-base);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  /* Default: hidden via transform */
  transform: translateX(110%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

/* Progress bar di bawah toast */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,0.35);
  transform-origin: left;
  animation: toastProgress 3.5s linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast.show {
  transform: translateX(0);
}

.toast-success { background: var(--color-success); }
.toast-error   { background: var(--color-error); }
.toast-info    { background: var(--color-info); }


/* ============================================================
   13. BACK TO TOP
   ============================================================ */
#backToTop {
  position: fixed;
  bottom: 6.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--color-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition:
    opacity    var(--duration-slow) var(--ease-out),
    transform  var(--duration-slow) var(--ease-spring),
    background var(--duration-base) var(--ease-smooth),
    box-shadow var(--duration-base) var(--ease-smooth);
  box-shadow: var(--shadow-md);
}

#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#backToTop:hover {
  background: var(--color-primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-primary);
}

#backToTop:active {
  transform: translateY(0) scale(0.97);
}


/* ============================================================
   14. LIGHTBOX
   ============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-smooth);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    opacity         var(--duration-slow) var(--ease-smooth),
    backdrop-filter var(--duration-slow) var(--ease-smooth);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-base);
  box-shadow: var(--shadow-lg);
  transform: scale(0.92) translateY(8px);
  transition:
    transform var(--duration-slow) var(--ease-spring),
    opacity  var(--duration-slow) var(--ease-out);
  opacity: 0;
}

.lightbox-overlay.active img {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition:
    background var(--duration-base) var(--ease-smooth),
    color      var(--duration-base) var(--ease-smooth),
    transform  var(--duration-base) var(--ease-spring);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  transform: scale(1.08);
}


/* ============================================================
   15. TOUR DETAIL TABS
   ============================================================ */
.tour-tab-btn {
  position: relative;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-smooth);
  white-space: nowrap;
}

.tour-tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  transform: scaleX(0);
  transition: transform var(--duration-base) var(--ease-spring);
}

.tour-tab-btn.active {
  color: var(--color-primary);
}

.tour-tab-btn.active::after {
  transform: scaleX(1);
}

.tour-tab-btn:hover:not(.active) {
  color: var(--color-text-primary);
}


/* ============================================================
   16. ITINERARY TIMELINE
   ============================================================ */
.itinerary-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 1.75rem;
}

/* Garis vertikal */
.itinerary-item::before {
  content: '';
  position: absolute;
  left: 0.5625rem;        /* center dari dot 1.25rem / 2 - linewidth/2 */
  top: 1.5rem;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    var(--color-primary) 0%,
    var(--color-border) 100%
  );
}

.itinerary-item:last-child::before {
  display: none;
}

/* Dot */
.itinerary-dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 3px solid var(--color-cream);
  /* Glow ring — lebih premium dari double shadow */
  box-shadow: 0 0 0 2.5px var(--color-primary), var(--shadow-sm);
  z-index: 1;
}


/* ============================================================
   17. BOOKING FORM
   ============================================================ */
.booking-form label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-base);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  background: #ffffff;
  font-family: inherit;
  transition:
    border-color var(--duration-base) var(--ease-smooth),
    box-shadow   var(--duration-base) var(--ease-smooth),
    background   var(--duration-base) var(--ease-smooth);
}

.booking-form input:hover,
.booking-form select:hover,
.booking-form textarea:hover {
  border-color: var(--color-border-hover);
}

.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255,122,0,0.12);
  background: #ffffff;
  outline: none;
}

.booking-form input::placeholder,
.booking-form textarea::placeholder {
  color: var(--color-text-muted);
}


/* ============================================================
   18. STAR RATING
   ============================================================ */
/*
   Mengganti rtl trick dengan pointer-events approach
   yang lebih reliable di semua browser
*/
.star-rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.125rem;
}

.star-rating-input input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.star-rating-input label {
  font-size: 1.5rem;
  color: var(--color-border);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-smooth),
              transform var(--duration-fast) var(--ease-spring);
  /* Reset overrides dari .booking-form label */
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
  display: inline-block;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
  color: var(--color-secondary);
}

.star-rating-input label:hover {
  transform: scale(1.15);
}


/* ============================================================
   19. PRINT
   ============================================================ */
@media print {
  header,
  footer,
  #welcomeScreen,
  #backToTop,
  .fixed,
  #heroSection {
    display: none !important;
  }

  main {
    padding: 0 !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}