/* =============================================
   PLANIX Timer v1.0.1 — Common Stylesheet
   Redesigned: Pretendard, refined animations,
   Bootstrap Icons, clean dark aesthetic
   ============================================= */

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: black;
  color: #fff;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ── No-interaction guards ── */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}
.no-drag { -webkit-user-drag: none; }
body.lock-interactions {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ── Timer wrapper (centered layout) ── */
.timer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ── Timer display ── */
.timer-display {
  font-size: 300px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -6px;
  transition: color 0.3s ease, transform 0.15s ease;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 100%;
}

/* ── Timer label ── */
.timer-label {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

/* ── Current time (v1.0.4: label + larger size) ── */
.current-time-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.current-time-label {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.current-time {
  font-size: 3.5rem;
  font-weight: 600;
  opacity: 0.55;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s ease;
}

/* ── Timer color states ── */
.timer-display.color-white  { color: #ffffff; }
.timer-display.color-yellow { color: #ffff00; }
.timer-display.color-red    { color: #ff0000; }
.timer-display.color-pink   { color: #ff69b4; }

/* ── Overtime background flash ── */
body.overtime-flash { background-color: #ff0000 !important; }

/* ── Message popup overlay ── */
.message-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(180, 0, 0, 0.94);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.message-popup.visible {
  display: flex;
  animation: popupSlideIn 0.35s ease-out forwards;
}

@keyframes popupSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-popup__text {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  word-break: keep-all;
  max-width: 85vw;
}

.message-popup__close {
  margin-top: 2rem;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.5;
}

/* ── Connection status indicator ── */
.connection-status {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0;
  color: #fff;
  transition: opacity 0.5s ease;
  animation: fadeInStatus 1s 0.5s ease forwards;
}

@keyframes fadeInStatus {
  to { opacity: 0.4; }
}

/* ── Console layout ── */
.console-container {
  background: #0a0a0a;
  min-height: 100vh;
  padding: 1.5rem;
}

.console-timer {
  font-size: 5rem;
  font-weight: 800;
  text-align: center;
  margin: 1rem 0;
}

/* ── Auth pages ── */
.auth-card {
  max-width: 400px;
  margin: 10vh auto;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 2.5rem;
}

.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* ── Responsive: Timer font size ── */
@media (max-width: 480px) {
  .timer-display {
    font-size: 100px;
    letter-spacing: -2px;
  }
  .timer-label { font-size: 1rem; }
  .current-time { font-size: 1.8rem; }
  .current-time-label { font-size: 0.7rem; }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .timer-display {
    font-size: 220px;
    letter-spacing: -4px;
  }
}

@media (min-width: 1025px) {
  .timer-display {
    font-size: 300px;
    letter-spacing: -6px;
  }
}

/* ── Bootstrap dark overrides ── */
.btn-dark-outline {
  border: 1px solid #333;
  color: #999;
  background: transparent;
  transition: all 0.25s ease;
}
.btn-dark-outline:hover {
  background: #1a1a1a;
  border-color: #555;
  color: #fff;
}

/* ── Room-users badge ── */
.room-users-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  transition: all 0.25s ease;
}

/* ── Shared button refinements ── */
.btn {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ── Form control dark refinements ── */
.form-control.bg-dark {
  background: #111 !important;
  border-color: #222 !important;
  color: #fff !important;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control.bg-dark:focus {
  border-color: #444 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.form-control.bg-dark::placeholder {
  color: #555;
}

/* ── Divider refinement ── */
hr.border-secondary {
  border-color: #1a1a1a !important;
  opacity: 1;
}

/* ── Zoom/Pan overlay (v1.0.4) ── */
#zpOverlay {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9000;
}

.zp-btn {
  width: 44px;
  height: 44px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.zp-btn:hover {
  background: rgba(40, 40, 40, 0.95);
  border-color: #444;
  color: #fff;
}
