/** 
 * style.css 
 * Desain Premium Modern dengan Glassmorphism & Animasi Fluid
 * v2.0 - Added next-schedule, overlay improvements, responsive, standby state
 */

:root {
  --primary-color: #4a00e0;
  --secondary-color: #8e2de2;
  --accent-color: #38bdf8;
  --bg-dark: #0f172a;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success-color: #10b981;
  --warning-color: #fbbf24;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Animations */
.bg-animation {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  overflow: hidden;
}

.blobs {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 12s infinite alternate ease-in-out;
}

.blob-1 {
  width: 450px; height: 450px;
  background: var(--primary-color);
  top: -120px; left: -120px;
}

.blob-2 {
  width: 550px; height: 550px;
  background: var(--secondary-color);
  bottom: -200px; right: -120px;
  animation-delay: -6s;
}

.blob-3 {
  width: 350px; height: 350px;
  background: #3b82f6;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 16s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}

/* Glassmorphism Container */
.main-wrapper {
  width: 100%;
  max-width: 850px;
  padding: 20px;
  z-index: 10;
  position: relative;
}

.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 45px 40px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.fade-in {
  animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Identitas */
.school-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  border-radius: 12px;
}

.identity-text {
  text-align: left;
}

.identity-text h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.identity-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Jam Besar */
.clock-display {
  margin: 35px 0 25px;
}

.time {
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 50px rgba(74, 0, 224, 0.3);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.date {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: 300;
}

/* Next Schedule Panel */
.next-schedule-panel {
  background: linear-gradient(135deg, rgba(74, 0, 224, 0.15), rgba(142, 45, 226, 0.1));
  border: 1px solid rgba(142, 45, 226, 0.2);
  border-radius: 16px;
  padding: 16px 22px;
  margin-bottom: 20px;
  display: inline-block;
  min-width: 350px;
}

.next-schedule-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-color);
  margin-bottom: 6px;
  font-weight: 600;
}

.next-schedule-value {
  font-size: 1rem;
  color: var(--text-light);
}

.next-audio-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-color);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-left: 8px;
  font-weight: 600;
}

/* Status Panel */
.status-panel {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 20px;
  display: inline-block;
  min-width: 350px;
  border: 1px solid rgba(255,255,255,0.05);
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-indicator.standby .status-dot {
  background-color: var(--success-color);
  box-shadow: 0 0 12px var(--success-color);
  animation: pulse 2s infinite;
}

.status-indicator.standby {
  color: var(--success-color);
}

.status-indicator.active .status-dot {
  background-color: var(--warning-color);
  box-shadow: 0 0 15px var(--warning-color);
  animation: pulse 0.8s infinite;
}

.status-indicator.active {
  color: var(--warning-color);
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

/* Animasi Equalizer */
.playing-info {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--warning-color);
  font-size: 0.9rem;
}

.equalizer {
  display: flex;
  gap: 3px;
  height: 18px;
  align-items: flex-end;
}

.bar {
  width: 4px;
  background-color: var(--warning-color);
  border-radius: 2px;
  animation: equalize 0.8s infinite ease-in-out;
}

.bar:nth-child(1) { height: 100%; animation-delay: 0.0s; }
.bar:nth-child(2) { height: 60%; animation-delay: 0.15s; }
.bar:nth-child(3) { height: 90%; animation-delay: 0.3s; }
.bar:nth-child(4) { height: 40%; animation-delay: 0.1s; }
.bar:nth-child(5) { height: 75%; animation-delay: 0.25s; }

@keyframes equalize {
  0%, 100% { transform: scaleY(0.2); }
  50% { transform: scaleY(1); }
}

.admin-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.3s;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.admin-link:hover {
  color: #fff;
  border-color: var(--glass-border);
  background: rgba(255,255,255,0.05);
}

/* Skeleton Loading */
.skeleton { background: rgba(255,255,255,0.08); border-radius: 12px; }
.skeleton-text { background: rgba(255,255,255,0.08); border-radius: 6px; color: transparent !important; -webkit-text-fill-color: transparent !important; }

/* ===== Audio Init Overlay ===== */
.audio-init-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.97);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  backdrop-filter: blur(16px);
  transition: opacity 0.5s, visibility 0.5s;
}

.audio-init-overlay.overlay-fade-out {
  opacity: 0;
  visibility: hidden;
}

.overlay-content {
  text-align: center;
  max-width: 420px;
  padding: 20px;
}

.overlay-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bellSwing 2s infinite ease-in-out;
}

@keyframes bellSwing {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

.overlay-content h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-weight: 800;
}

.overlay-content p {
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.overlay-hint {
  font-size: 0.75rem !important;
  color: #475569 !important;
  margin-top: 15px !important;
}

.audio-init-overlay button {
  padding: 16px 36px;
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 10px 30px rgba(74, 0, 224, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.audio-init-overlay button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(74, 0, 224, 0.5);
}

.btn-icon {
  font-size: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .glass-container {
    padding: 30px 20px;
    border-radius: 20px;
  }
  .school-identity {
    flex-direction: column;
    gap: 12px;
  }
  .identity-text { text-align: center; }
  .identity-text h1 { font-size: 1.3rem; }
  .time { font-size: 3.5rem; }
  .date { font-size: 1rem; }
  .next-schedule-panel,
  .status-panel { min-width: auto; width: 100%; }
  .overlay-content h2 { font-size: 1.4rem; }
}
