/* ═══════════════════════════════════════════════════════════
   helltide-timer.css  v5
   타이머 + Firebase 실시간 동기화 + 알림 + 알림설정 패널
   ═══════════════════════════════════════════════════════════ */

/* ── 페이지 공통 ─────────────────────────────────────────── */
#helltide-app {
  padding: 24px 20px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── 페이지 헤더 ──────────────────────────────────────────── */
.ht-page-header {
  text-align: center;
  margin-bottom: 20px;
}
.ht-page-title {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 800;
  color: #ff6633;
  margin: 0 0 8px;
}
.ht-page-title i { margin-right: 8px; }
.ht-page-desc { color: #888; font-size: 14px; margin: 0 0 16px; }

/* ── 알림 켜기 버튼 (패널 헤더 우측) ─────────────────────── */
.btn-notify-enable { display: none; }  /* 미사용 제거 */

/* ── 알림 안내 배너 ───────────────────────────────────────── */
.ht-notify-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #ff9900;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 28px;
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}
.ht-notify-info i {
  color: #ff9900;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.ht-notify-info strong { color: #ccc; }
.ht-notify-info ul {
  margin: 6px 0 0 0;
  padding-left: 16px;
}
.ht-notify-info li { margin-bottom: 2px; }

/* ── Firebase 연결 배지 ───────────────────────────────────── */
.ht-conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 10px;
  border: 1px solid transparent;
  transition: all 0.3s;
}
.ht-conn-badge.live        { background: transparent; border-color: transparent; color: #4caf50; }
.ht-conn-badge.connecting  { background: #1a1a0a; border-color: #4a4a1a; color: #aaa;    }
.ht-conn-badge.error       { background: #1a0a0a; border-color: #4a1a1a; color: #888;    }

/* ── 카드 라벨 행 (라벨 + 소스배지 가로 배치) ──────────────── */
.ht-card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  gap: 6px;
}

/* ── 데이터 소스 배지 ─────────────────────────────────────── */
.ht-source-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ht-source-badge.firebase { background: transparent; color: #4caf50; border: none; }
.ht-source-badge.local    { background: transparent; color: #555;    border: none; }

/* ── 헬타이드 활성 구역 표시 ─────────────────────────────── */
.ht-zone-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #ff8844;
  background: rgba(255,69,0,0.08);
  border: 1px solid rgba(255,69,0,0.25);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
}
.ht-zone-display i    { color: #ff4500; }
.ht-zone-display strong { color: #ffaa66; }

/* 월드보스 위치 표시 — 보스 테마 색상 */
#wb-zone-display {
  color: #ff6680;
  background: rgba(255,50,80,0.08);
  border-color: rgba(255,50,80,0.30);
}
#wb-zone-display i    { color: #ff3355; }
#wb-zone-display strong { color: #ffaabb; }

/* ── 월드보스 이름 표시 ── */
.ht-boss-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffcccc;
  letter-spacing: 0.03em;
  margin: 2px 0 4px 0;
  text-shadow: 0 0 8px rgba(255,80,80,0.5);
}

/* ── 스케줄 활성 중 항목 ──────────────────────────────────── */
.ht-schedule-item.sched-now {
  background: #1a1208;
  border-color: #ff6600;
}
.ht-schedule-item.sched-now .ht-sched-countdown { color: #ff6633; }


.ht-timers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 860px) {
  .ht-timers-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* 카드 기본 */
.ht-card {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.ht-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.ht-card.active-event {
  border-color: #ff4500;
  box-shadow: 0 0 22px rgba(255,69,0,0.25);
}
.ht-card.active-event::before { opacity: 1; }
.ht-card-helltide.active-event::before { background: radial-gradient(ellipse at 30% 0%, rgba(255,69,0,0.08) 0%, transparent 70%); }
.ht-card-boss.active-event::before     { background: radial-gradient(ellipse at 30% 0%, rgba(224,51,90,0.08) 0%, transparent 70%); }
.ht-card-legion.active-event::before   { background: radial-gradient(ellipse at 30% 0%, rgba(68,136,255,0.08) 0%, transparent 70%); }

/* 카드 아이콘 */
.ht-card-icon {
  font-size: 24px;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ht-card-helltide .ht-card-icon { background: rgba(255,69,0,0.15);   color: #ff4500; }
.ht-card-boss     .ht-card-icon { background: rgba(180,0,60,0.15);   color: #e0335a; }
.ht-card-legion   .ht-card-icon { background: rgba(68,136,255,0.15); color: #4488ff; }

/* 카드 바디 */
.ht-card-body { flex: 1; min-width: 0; }
.ht-card-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: #bbb; margin-bottom: 3px;
}
.ht-card-status {
  font-size: 12px; font-weight: 600;
  margin-bottom: 4px; color: #aaa;
}
.ht-card-status.status-active  { color: #ff6633; background: transparent; border: none; }
.ht-card-status.status-waiting { color: #5599ff; background: transparent; border: none; }

/* 카운트다운 숫자 */
.ht-countdown {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 6px;
}
.ht-card.active-event .ht-countdown { color: #ff6633; }
.ht-card-boss.active-event   .ht-countdown { color: #e0335a; }
.ht-card-legion.active-event .ht-countdown { color: #4488ff; }

.ht-card-sub { font-size: 11px; color: #555; margin-bottom: 8px; }

/* 프로그레스 바 */
.ht-progress-bar {
  height: 4px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
}
.ht-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear;
  width: 0;
}
.ht-card-helltide .ht-progress-fill { background: linear-gradient(90deg, #c62a00, #ff4500); }
.ht-card-boss     .ht-progress-fill { background: linear-gradient(90deg, #8b003a, #e0335a); }
.ht-card-legion   .ht-progress-fill { background: linear-gradient(90deg, #1144aa, #4488ff); }

/* active glow animation */
.ht-card.active-event .ht-progress-fill {
  animation: ht-bar-glow 1.5s ease-in-out infinite alternate;
}
@keyframes ht-bar-glow {
  from { filter: brightness(1); }
  to   { filter: brightness(1.6); }
}

/* ── 스케줄 섹션 ──────────────────────────────────────────── */
.ht-schedule-section { margin-bottom: 28px; }

.ht-section-title {
  font-size: 16px; font-weight: 700;
  color: #ddd; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.ht-section-title i { color: #ff6633; }

.ht-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ht-schedule-loading { color: #555; font-size: 14px; padding: 20px; }

.ht-schedule-item {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.2s, background 0.2s;
}
.ht-schedule-item:hover { background: #1a1a1a; }
.ht-schedule-item.sched-helltide { border-left: 3px solid #ff4500; }
.ht-schedule-item.sched-boss     { border-left: 3px solid #e0335a; }
.ht-schedule-item.sched-legion   { border-left: 3px solid #4488ff; }

.ht-sched-type {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px; color: #555;
}
.ht-sched-name {
  font-size: 12px; font-weight: 600; color: #ddd;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ht-sched-zone {
  font-size: 10px; color: #ff8899;
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ht-sched-zone i { font-size: 9px; }
.ht-sched-time    { font-size: 11px; color: #777; }
.ht-sched-countdown { font-size: 13px; font-weight: 700; color: #ff9900; }

/* ══════════════════════════════════════════════════════════
   알림 설정 패널 (항상 표시)
   ══════════════════════════════════════════════════════════ */
.ht-notify-panel {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.ht-notify-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #161616;
  border-bottom: 1px solid #222;
  font-size: 14px;
  font-weight: 700;
  color: #ddd;
}
.ht-notify-panel-header i { color: #ff9900; margin-right: 6px; }

.ht-notify-panel-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── 이벤트별 행 ─────────────────────────────────────────── */
.ht-notify-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #1e1e1e;
  flex-wrap: wrap;
}
.ht-notify-row:last-child { border-bottom: none; }

.ht-notify-row-title {
  font-size: 13px;
  font-weight: 700;
  color: #ccc;
  min-width: 100px;
  flex-shrink: 0;
}
.ht-notify-row-title i { margin-right: 5px; }

/* ── 토글 그룹 ───────────────────────────────────────────── */
.ht-notify-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

/* ── 개별 토글 아이템 (label + 슬라이더 + 텍스트) ──────────── */
.ht-toggle-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

/* 체크박스 숨기기 */
.ht-toggle-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* CSS 슬라이더 스위치 */
.ht-toggle-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ht-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.ht-toggle-item input:checked ~ .ht-toggle-slider {
  background: #ff6600;
}
.ht-toggle-item input:checked ~ .ht-toggle-slider::after {
  transform: translateX(16px);
  background: #fff;
}

.ht-toggle-label {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.ht-toggle-item input:checked ~ .ht-toggle-slider + .ht-toggle-label,
.ht-toggle-item input:checked + .ht-toggle-slider + .ht-toggle-label {
  color: #ff9900;
}

/* ── 헤더 (5분 전 고정 표시) ───────────────────────────────── */
.ht-notify-fixed-min {
  font-size: 11px;
  font-weight: 400;
  color: #555;
  margin-left: 6px;
}

/* ── 볼륨 슬라이더 ─────────────────────────────────────── */
.ht-volume-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
}

.ht-vol-icon {
  color: #888;
  font-size: 13px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.ht-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #333;
  outline: none;
  cursor: pointer;
  min-width: 80px;
}
.ht-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6600;
  cursor: pointer;
  border: 2px solid #1a1a1a;
  transition: background 0.15s, transform 0.1s;
}
.ht-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6600;
  cursor: pointer;
  border: 2px solid #1a1a1a;
  transition: background 0.15s;
}
.ht-volume-slider::-webkit-slider-thumb:hover {
  background: #ff9900;
  transform: scale(1.2);
}
/* 슬라이더 채워진 부분 색상 (Chrome/Edge) */
.ht-volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #ff6600 var(--val, 80%), #333 var(--val, 80%));
}

.ht-vol-pct {
  font-size: 11px;
  color: #aaa;
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ht-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #444;
  background: rgba(255,102,0,0.12);
  color: #ff6600;
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  padding: 0;
}
.ht-preview-btn:hover {
  background: rgba(255,102,0,0.28);
  color: #ff9900;
  transform: scale(1.1);
}
.ht-preview-btn:active {
  transform: scale(0.95);
}

/* ── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ht-notify-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ht-notify-row-title { min-width: unset; }
  .ht-notify-toggles { gap: 12px; }
  .ht-volume-wrap { width: 100%; box-sizing: border-box; }
  .ht-volume-slider { min-width: 60px; }
}
