@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==================================================================
   ACCESSIBILITY & UTILITIES
   ================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================================
   MARQUEE
   ================================================================== */
.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 60s linear infinite;
}

/* ==================================================================
   MOBILE MENU
   ================================================================== */
#mobileMenu {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#mobileMenu.show {
  opacity: 1;
  visibility: visible;
}
#mobileMenu .menu-link {
  position: relative;
  overflow: hidden;
}
#mobileMenu .menu-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(to right, #FFD700, #FF6B35);
  transition: all 0.4s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}
#mobileMenu .menu-link:hover::after,
#mobileMenu .menu-link:active::after {
  width: 80%;
}
.menu-link:active {
  transform: scale(0.95) !important;
  transition: transform 0.1s ease;
}

/* ==================================================================
   HERO SLIDER + PARTICLES (INI YANG DULU BERMASALAH, SEKARANG 100% KELIHATAN)
   ================================================================== */
.sws-hero-container {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.sws-bg-slider {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.sws-bg-slider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.92));
  z-index: 3;
}
.sws-slider-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: swsSliderFade 12s infinite;
  will-change: opacity;
}
.sws-slider-img:nth-child(1) { animation-delay: 0s; }
.sws-slider-img:nth-child(2) { animation-delay: 4s; }
.sws-slider-img:nth-child(3) { animation-delay: 8s; }

.sws-glow-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,215,0,0.03), transparent 50%, rgba(255,107,53,0.03));
  z-index: 2;
  pointer-events: none;
}

.sws-particle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.sws-particle {
  position: absolute;
  background: radial-gradient(circle at center, #FFD700 0%, rgba(255, 215, 0, 0.3) 50%, transparent 80%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
  will-change: transform, opacity;
}
@keyframes sws-float {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.4; }
  50%  { transform: translateY(-35vh) translateX(20vw) rotate(180deg); opacity: 0.8; }
  100% { transform: translateY(0) translateX(0) rotate(360deg); opacity: 0.4; }
}

/* ==================================================================
   TOAST NOTIFICATION (PROFESSIONAL & BEAUTIFUL)
   ================================================================== */
.toast {
  min-width: 320px;
  max-width: 420px;
  padding: 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  border: 1px solid;
  pointer-events: auto;
  transform: translateY(100px);
  opacity: 0;
  animation: toastSlideIn 0.5s ease-out forwards, toastSlideOut 0.5s ease-in 3.5s forwards;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  background: linear-gradient(to bottom right, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
  border-color: rgba(34, 197, 94, 0.5);
}
.toast.error {
  background: linear-gradient(to bottom right, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
  border-color: rgba(248, 113, 113, 0.5);
}
.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: #10b981; }
.toast.error   .toast-icon { background: #ef4444; }
.toast-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s;
}
.toast-close:hover { background: rgba(255,255,255,0.15); }

@keyframes toastSlideIn {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100px); opacity: 0; }
}
.toast:hover {
  animation-play-state: paused;
  transform: scale(1.03);
}

/* ==================================================================
   KEYFRAMES (dipindah dari Tailwind config biar bisa dipakai di CSS biasa)
   ================================================================== */
@keyframes marquee {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
@keyframes swsSliderFade {
  0%, 100% { opacity: 0; }
  25%      { opacity: 1; }
  50%      { opacity: 1; }
  75%      { opacity: 0; }
}