/* 
 * style.css
 * Desain Tambahan, Animasi, & Efek Visual Premium untuk App-JadwalSiswa
 * v1.8.0 — Full Premium Redesign
 */

/* ========================================================================
   TIPOGRAFI & TRANSISI GLOBAL
   ======================================================================== */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom Scrollbar Desktop Premium */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; border: 1px solid #f8fafc; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }


/* ========================================================================
   DARK PREMIUM PROFILE PAGE
   ======================================================================== */

html.viewing-profiles,
html.viewing-profiles body {
  background: #080e1a !important;
}

/* Extend profile section to fill screen */
#section-profiles {
  min-height: calc(100vh - 4.5rem);
  position: relative;
}

/* Decorative inner blobs inside profile section */
.profile-blob-a {
  position: absolute;
  top: 15%;
  left: -5%;
  width: 280px;
  height: 280px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: float-blob 10s ease-in-out infinite alternate;
}

.profile-blob-b {
  position: absolute;
  bottom: 10%;
  right: -5%;
  width: 260px;
  height: 260px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(147,51,234,0.18) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: float-blob 12s ease-in-out infinite alternate-reverse;
  animation-delay: 1.5s;
}

/* Glassmorphism Profile Cards */
.profile-glass-card {
  background: rgba(255, 255, 255, 0.055) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.08) !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.profile-glass-card:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-8px) scale(1.03) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.12) !important;
}

/* Profile Title Gradient Text */
.profile-title-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Avatar Glow Rings with Pulse */
.profile-avatar-glow-a {
  animation: avatar-pulse-a 3.5s ease-in-out infinite;
}

.profile-avatar-glow-b {
  animation: avatar-pulse-b 3.5s ease-in-out infinite;
  animation-delay: 0.8s;
}

@keyframes avatar-pulse-a {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35), 0 0 24px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.0), 0 0 48px rgba(99, 102, 241, 0.55); }
}

@keyframes avatar-pulse-b {
  0%, 100% { box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.35), 0 0 24px rgba(219, 39, 119, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(147, 51, 234, 0.0), 0 0 48px rgba(219, 39, 119, 0.55); }
}

/* App Icon Glow */
.app-icon-glow {
  animation: app-icon-shine 4s ease-in-out infinite;
}

@keyframes app-icon-shine {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.3), 0 8px 32px rgba(59,130,246,0.35); }
  50% { box-shadow: 0 0 0 12px rgba(96, 165, 250, 0.0), 0 12px 48px rgba(99,102,241,0.5); }
}


/* ========================================================================
   HEADER & LOGO
   ======================================================================== */

/* Efek Glassmorphism Modern */
.glassmorphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

/* Status Badge Awan Glassmorphism Putih Transparan */
.badge-glass {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Tombol Transparan Awan */
.btn-glass {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px);
}

.btn-glass:active {
  transform: translateY(1px);
  opacity: 0.8;
}

/* Efek bercahaya pada inisial avatar di header */
.avatar-glow {
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
}


/* ========================================================================
   DYNAMIC WAVE HERO HEADER
   ======================================================================== */

.dynamic-header {
  position: relative;
  transition: background-image 0.5s ease-in-out, background-color 0.5s ease-in-out, box-shadow 0.3s ease;
}

.header-default {
  background-image: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: none !important;
}

.header-anak-a {
  background-image: linear-gradient(135deg, #1d4ed8 0%, #2563eb 40%, #0891b2 100%);
  box-shadow: none !important;
}

.header-anak-b {
  background-image: linear-gradient(135deg, #7c3aed 0%, #9333ea 40%, #db2777 100%);
  box-shadow: none !important;
}

/* ========================================================================
   ADAPTIVE TRANSPARENT-TO-FROSTED HEADER (Pilihan 2)
   ======================================================================== */

.header-transparent {
  background-color: transparent !important;
  background-image: none !important;
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
}

/* Transisi halus saat scroll */
#app-header {
  transition: background-color 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease !important;
}

/* Efek Frosted Glass saat di-scroll */
#app-header.header-scrolled {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

#app-header.header-scrolled.header-default {
  background-color: rgba(15, 23, 42, 0.8) !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.3) !important;
}

#app-header.header-scrolled.header-anak-a {
  background-color: rgba(29, 78, 216, 0.8) !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 20px -5px rgba(29, 78, 216, 0.3) !important;
}

#app-header.header-scrolled.header-anak-b {
  background-color: rgba(124, 58, 237, 0.8) !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 20px -5px rgba(124, 58, 237, 0.3) !important;
}

/* Hubungkan Hero Section ke atas agar menyatu di belakang Header Transparan */
#app-hero {
  margin-top: -3.5rem;
  padding-top: 3.5rem;
}

.header-wave {
  position: absolute;
  bottom: -2.5px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 10;
  pointer-events: none;
}

.header-wave svg {
  position: relative;
  display: block;
  width: 100%;
  height: 24px;
}

@media (min-width: 768px) {
  .header-wave svg { height: 36px; }
}


/* ========================================================================
   HERO DYNAMIC ELEMENTS
   ======================================================================== */

/* Quote fade-in animation */
.hero-quote-text {
  animation: quote-slide-in 0.7s ease forwards;
}

@keyframes quote-slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 0.65; transform: translateY(0); }
}

/* Next lesson chip */
.next-lesson-badge {
  animation: lesson-badge-blink 2.5s ease-in-out infinite;
}

@keyframes lesson-badge-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}


/* ========================================================================
   FLOATING PILL TABS
   ======================================================================== */

.tab-inactive {
  background-color: #ffffff !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9999px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
}

.tab-inactive:hover {
  color: #1e293b !important;
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

/* Anak A Active Tab */
.tab-active-a {
  background-image: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 9999px !important;
  box-shadow: 0 6px 18px -3px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-2px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
}

/* Anak B Active Tab */
.tab-active-b {
  background-image: linear-gradient(135deg, #7c3aed 0%, #db2777 100%) !important;
  color: #ffffff !important;
  border: 1px solid #a855f7 !important;
  border-radius: 9999px !important;
  box-shadow: 0 6px 18px -3px rgba(124, 58, 237, 0.4) !important;
  transform: translateY(-2px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
}


/* ========================================================================
   VIEW PANEL TRANSITIONS (with slide)
   ======================================================================== */

.view-panel {
  opacity: 0;
  transform: translateY(8px);
  will-change: opacity, transform;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-panel.active {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from right (navigasi maju) */
.view-panel.slide-in-right {
  animation: panel-slide-right 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide from left (navigasi mundur) */
.view-panel.slide-in-left {
  animation: panel-slide-left 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes panel-slide-right {
  from { opacity: 0; transform: translateX(28px) translateY(0); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes panel-slide-left {
  from { opacity: 0; transform: translateX(-28px) translateY(0); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}


/* ========================================================================
   COMPACT SCHEDULE CARDS
   ======================================================================== */

.schedule-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.schedule-card:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Colored left-border accent */
.schedule-card-accent {
  border-left-width: 4px !important;
  border-left-style: solid !important;
  padding-left: 10px !important;
}


/* ========================================================================
   DAY TABS WITH DATE NUMBERS
   ======================================================================== */

.day-tab-number {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  display: block;
}

.day-tab-label {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.72;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.day-tab-today-dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  margin: 3px auto 0;
  display: block;
  background: currentColor;
  opacity: 0.7;
  animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
}


/* ========================================================================
   TASK PROGRESS BAR
   ======================================================================== */

.task-progress-track {
  height: 5px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.task-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Shimmer effect on progress bar */
.task-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}


/* ========================================================================
   BACKGROUND BLOB ANIMATION
   ======================================================================== */

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

.animate-blob-1 {
  animation: float-blob 10s infinite alternate ease-in-out;
  will-change: transform;
}

.animate-blob-2 {
  animation: float-blob 12s infinite alternate-reverse ease-in-out;
  animation-delay: 2s;
  will-change: transform;
}

/* Animate fade-in for schedule day columns */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in-up 0.35s ease forwards;
}


/* ========================================================================
   EFEK TOMBOL & MODAL
   ======================================================================== */

/* Sentuhan ramah HP */
.mobile-btn-active:active { opacity: 0.7; }

/* Scroll lock saat modal aktif */
body.modal-open { overflow: hidden; }

/* Spinner Loader */
.spinner-animate { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


/* ========================================================================
   FAB BUTTON VISIBILITY
   ======================================================================== */

#mobile-fab-quick-add { display: none !important; }

body.profile-selected:not(.modal-open) #mobile-fab-quick-add { display: flex !important; }

@media (min-width: 640px) {
  body.profile-selected:not(.modal-open) #mobile-fab-quick-add { display: none !important; }
}


/* ========================================================================
   MAIN CONTAINER PADDING
   ======================================================================== */

.main-app-container { padding-bottom: 2rem; }

@media (max-width: 639px) {
  body.profile-selected .main-app-container {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)) !important;
  }
}
