/* ===============================
   기본 레이아웃
================================= */

body {
  margin: 0;
  height: 100vh;
  background: #0f172a;
  color: #e5e7eb;
  font-family: system-ui, sans-serif;
}

.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#clock {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #38bdf8;
}

#task {
  font-size: 2rem;
  padding: 20px 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

/* ===============================
   설정 버튼 및 모달
================================= */

#settingsBtn {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.hidden {
  display: none;
}

.modal-card {
  background: #111;
  padding: 24px;
  border-radius: 14px;
  width: 320px;
  box-sizing: border-box;
  max-height: 85vh;
  overflow-y: auto;
}

/* ===============================
   설정 항목 및 컨트롤
================================= */

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}

.setting-item button {
  min-width: 80px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #222;
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
}

#soundVolume {
  width: 90px;
  -webkit-appearance: none;
  height: 6px;
  background: #333;
  border-radius: 6px;
  outline: none;
}

#soundVolume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #38bdf8;
  border-radius: 50%;
  cursor: pointer;
}

.test-button, .close-btn {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
}

.test-button { background: #2563eb; }
.close-btn { background: #1a1a1a; }

/* ===============================
   시간표 관리 및 스크롤 UI
================================= */

#scheduleList {
  margin-top: 15px;
  max-height: 280px; /* 2개 정도 표시 후 스크롤 발생 */
  overflow-y: auto;
  padding-right: 8px;
}

#scheduleList::-webkit-scrollbar {
  width: 5px;
}

#scheduleList::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}

#scheduleList::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.schedule-row {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: 0.2s;
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.time-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.schedule-row input {
  background: #0f172a;
  border: 1px solid #334155;
  padding: 6px 8px;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.start-time, .end-time {
  width: 55px;
  text-align: center;
}

.schedule-text {
  width: 100%;
  box-sizing: border-box;
}

.deleteBtn {
  background: #7f1d1d;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.overlap-warning {
  color: #f87171;
  font-size: 0.7rem;
  font-weight: bold;
}

#addScheduleItem {
  margin-top: 12px;
  background: #0ea5e9;
  font-weight: bold;
}

/* ===============================
   Select 커스텀
================================= */

select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e5e7eb;
  padding: 6px 30px 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23e5e7eb' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}
