/* ==========================================================================
   3. TIMER DISPLAY (CENTER OF SCREEN)
   ========================================================================== */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  width: 100%;
  z-index: 2;
}

.status-badge-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--badge-bg);
  color: var(--badge-text);
  transition: all 0.3s ease;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  font-weight: 600;
  background: var(--badge-bg);
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #a1a1aa;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.timer-display {
  font-size: min(29vw, 48vh);
  font-weight: 850;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--timer-color);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
  transition: transform 0.2s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
  text-align: center;
  width: 100%;
}

.timer-display.is-overtime {
  font-size: min(24vw, 44vh);
  color: var(--warning-red-bright);
}

/* ==========================================================================
   RESPONSIVE: TIMER DISPLAY UNTUK IPAD & LANDSCAPE
   ========================================================================== */

/* iPad landscape: kurangi tinggi max timer agar tidak overlap kontrol bawah */
@media (max-height: 820px) and (orientation: landscape) {
  .timer-display {
    font-size: min(27vw, 36vh);
  }

  .timer-display.is-overtime {
    font-size: min(22vw, 32vh);
  }
}

/* iPad portrait: tinggi layar cukup, tapi lebarnya perlu diperhatikan */
@media (max-width: 1024px) and (min-width: 769px) and (orientation: portrait) {
  .timer-display {
    font-size: min(29vw, 42vh);
  }

  .timer-display.is-overtime {
    font-size: min(24vw, 38vh);
  }
}


/* ==========================================================================
   5. WARNING MODES
   ========================================================================== */

/* ---- Mode Terang: background kedip merah, teks timer ikut berubah ---- */
body.warning-mode.light {
  animation: blinkWarningLight 1s ease-in-out infinite;
}

/* ---- Mode Gelap: background kedip merah, teks timer ikut berubah ---- */
body.warning-mode.dark {
  animation: blinkWarningDark 1s ease-in-out infinite;
}

@keyframes blinkWarningLight {
  0%, 100% {
    background-color: #ffffff;
  }
  50% {
    background-color: #dc2626;
  }
}

@keyframes blinkWarningDark {
  0%, 100% {
    background-color: #000000;
  }
  50% {
    background-color: #dc2626;
  }
}

/* Timer display: sinkron dengan background — terang → gelap saat bg merah */
body.light.warning-mode .timer-display {
  animation: blinkTextLight 1s ease-in-out infinite;
}

@keyframes blinkTextLight {
  0%, 100% { color: #000000; }
  50%       { color: #ffffff; }
}

/* Timer display: sinkron dengan background — gelap → terang saat bg merah */
body.dark.warning-mode .timer-display {
  animation: blinkTextDark 1s ease-in-out infinite;
}

@keyframes blinkTextDark {
  0%, 100% { color: #ffffff; }
  50%       { color: #000000; }
}

/* Status badge: sinkron kontras tinggi di mode terang */
body.light.warning-mode .status-badge {
  animation: blinkBadgeLight 1s ease-in-out infinite;
}

@keyframes blinkBadgeLight {
  0%, 100% { background: #000000; color: #ffffff; }
  50%       { background: #ffffff; color: #dc2626; }
}

/* Status badge: sinkron kontras tinggi di mode gelap */
body.dark.warning-mode .status-badge {
  animation: blinkBadgeDark 1s ease-in-out infinite;
}

@keyframes blinkBadgeDark {
  0%, 100% { background: #ffffff; color: #000000; }
  50%       { background: #000000; color: #ffffff; }
}

/* Status dot: tetap merah berdenyut */
body.light.warning-mode .status-dot,
body.dark.warning-mode .status-dot,
body:not([data-theme="dark"]).warning-mode .status-dot {
  background: #ff1f1f !important;
  animation: pulseDot 0.7s ease-in-out infinite alternate;
}

[data-theme="dark"].warning-mode .status-dot {
  background: #ff1f1f !important;
  animation: pulseDot 0.7s ease-in-out infinite alternate;
}

body.overtime-active.light {
  background-color: #fff1f2;
}

body.overtime-active.dark {
  background-color: #200508;
}

@keyframes pulseDot {
  from {
    transform: scale(0.8);
    opacity: 0.6;
  }

  to {
    transform: scale(1.3);
    opacity: 1;
  }
}
