/* ==========================================================================
   Portal Aplikasi Sekolah - Custom Styles
   ========================================================================== */

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-secondary: #6366f1;
  --color-accent: #fbbf24;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Animated gradient for hero banner ===== */
.gradient-animated {
  background: linear-gradient(-45deg, #1e3a8a, #2563eb, #4f46e5, #6366f1, #1e40af);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Floating blob shapes for hero ===== */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: blobMove 20s ease-in-out infinite;
  pointer-events: none;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: #6366f1;
  top: -150px;
  left: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: #fbbf24;
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
  opacity: 0.3;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #3b82f6;
  top: 30%;
  right: 10%;
  animation-delay: -10s;
  opacity: 0.4;
}

@keyframes blobMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ===== Grid pattern overlay ===== */
.grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== Glassmorphism (navbar) ===== */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

/* ===== Hero slider transitions ===== */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
  overflow-x: hidden;
}

@media (max-width: 380px) {
  .slide h1 {
    font-size: 2rem;
    line-height: 1.1;
  }
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ===== App card hover effect ===== */
.app-card {
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #3b82f6, #6366f1, #fbbf24);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.app-card:hover::before {
  opacity: 1;
}

.app-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
}

.app-card .card-image {
  transition: transform 0.6s ease;
}

.app-card:hover .card-image {
  transform: scale(1.08);
}

/* ===== Cursor spotlight in hero ===== */
.spotlight {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 60%);
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.hero-section:hover .spotlight {
  opacity: 1;
}

/* ===== Floating animation for hero illustration ===== */
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ===== Pulse glow for CTA buttons ===== */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(251, 191, 36, 0); }
}

/* ===== Scroll-to-top button ===== */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  z-index: 50;
  border: none;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5);
}

/* ===== Slide indicators ===== */
.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slide-dot.active {
  width: 32px;
  background: #fbbf24;
}

/* ===== Search input focus ring ===== */
.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
}

/* ===== Stat card shine effect ===== */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: rotate(25deg);
  transition: left 0.7s ease;
}

.stat-card:hover::after {
  left: 130%;
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #6366f1);
  border-radius: 9999px;
  border: 3px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563eb, #4f46e5);
}

/* ===== Selection color ===== */
::selection {
  background: #6366f1;
  color: #ffffff;
}

/* ===== No-results message ===== */
.no-results {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.no-results.visible {
  display: block;
}
