/* Alex_Time 대시보드의 미려하고 현대적인 Glassmorphism 다크 테마 디자인 시스템 스타일시트 */

:root {
  --bg-color: #070913;
  --glass-bg: rgba(16, 22, 47, 0.55);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-color: #0ea5e9; /* Sky Blue */
  --primary-hover: #0284c7;
  --success-color: #10b981; /* Emerald */
  --success-hover: #059669;
  --danger-color: #f43f5e; /* Rose */
  --danger-hover: #e11d48;
  --purple-color: #a855f7; /* Violet */
  --purple-hover: #9333ea;
  
  --mother-color: #f472b6; /* Pink */
  --father-color: #38bdf8; /* Blue */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ----------------------------------------------------
   1. 헤더 영역 스타일
   ---------------------------------------------------- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 26px;
  color: var(--primary-color);
  animation: logo-rotate 6s infinite linear;
}

@keyframes logo-rotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(180deg); }
}

.header-logo h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.accent-text {
  color: var(--primary-color);
}

.week-indicator {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

/* ----------------------------------------------------
   2. Glassmorphism 카드 공통 스타일
   ---------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.glass-card:hover {
  box-shadow: 0 15px 35px rgba(14, 165, 233, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 20px;
  color: var(--primary-color);
}

.glass-card h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.card-description {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ----------------------------------------------------
   3. 메인 타임 요약 카드 특별 스타일
   ---------------------------------------------------- */
.main-time-card {
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.card-pulse-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 60%);
  pointer-events: none;
  animation: pulse-glow 8s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

.time-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.time-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.warning {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger-color);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.time-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.time-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.time-display.warning .time-value {
  background: linear-gradient(135deg, #ff94b1 0%, var(--danger-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.time-unit {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-display.warning ~ .progress-container .progress-bar-fill {
  background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%);
}

.progress-values {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.progress-values strong {
  color: var(--text-primary);
}

/* ----------------------------------------------------
   4. 대시보드 그리드 레이아웃
   ---------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ----------------------------------------------------
   5. 타이머 스타일
   ---------------------------------------------------- */
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-card .card-description {
  text-align: center;
  align-self: flex-start;
}

.timer-display-wrapper {
  margin: 10px 0 24px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.timer-circle-visual {
  position: relative;
  width: 160px;
  height: 160px;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.35s;
  transform-origin: 50% 50%;
}

.timer-text-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.timer-countdown {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.timer-session-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* 타이머 활성화 시 카드 펄스 효과 */
.timer-active-pulse {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.15);
}

.timer-controls {
  display: flex;
  gap: 12px;
  width: 100%;
}

.timer-controls button {
  flex: 1;
}

.wake-lock-status {
  margin-top: 16px;
  font-size: 12px;
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  display: none;
  align-items: center;
  gap: 6px;
}

/* ----------------------------------------------------
   6. 폼 및 폼 요소 디자인
   ---------------------------------------------------- */
.entry-form, .parent-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-row {
  display: flex;
  gap: 12px;
}

.form-group-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
input[type="date"] {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 40px;
}

.input-unit {
  position: absolute;
  right: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}

/* ----------------------------------------------------
   7. 버튼 스타일 시스템
   ---------------------------------------------------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.btn-success {
  background: var(--success-color);
  color: #fff;
}
.btn-success:hover {
  background: var(--success-hover);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

.btn-purple {
  background: var(--purple-color);
  color: #fff;
}
.btn-purple:hover {
  background: var(--purple-hover);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ----------------------------------------------------
   8. 부모 선택용 라디오 카드 버튼 스타일
   ---------------------------------------------------- */
.parent-select-container {
  display: flex;
  gap: 12px;
}

.parent-radio-card {
  flex: 1;
  cursor: pointer;
}

.parent-radio-card input {
  display: none;
}

.radio-visual {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.radio-visual i {
  font-size: 20px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.radio-visual span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* 엄마 선택 상태 */
.parent-radio-card.mother input:checked + .radio-visual {
  border-color: var(--mother-color);
  background: rgba(244, 114, 182, 0.08);
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.15);
}
.parent-radio-card.mother input:checked + .radio-visual i {
  color: var(--mother-color);
}
.parent-radio-card.mother input:checked + .radio-visual span {
  color: var(--text-primary);
}

/* 아빠 선택 상태 */
.parent-radio-card.father input:checked + .radio-visual {
  border-color: var(--father-color);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}
.parent-radio-card.father input:checked + .radio-visual i {
  color: var(--father-color);
}
.parent-radio-card.father input:checked + .radio-visual span {
  color: var(--text-primary);
}

/* 상벌 액션 라디오 */
.action-type-container {
  display: flex;
  gap: 12px;
}

.action-btn-card {
  flex: 1;
  cursor: pointer;
}

.action-btn-card input {
  display: none;
}

.action-visual {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.action-visual i {
  font-size: 16px;
  color: var(--text-muted);
}

.action-visual span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* 상(+30) 선택 */
.action-btn-card.reward input:checked + .action-visual {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.08);
}
.action-btn-card.reward input:checked + .action-visual i,
.action-btn-card.reward input:checked + .action-visual span {
  color: var(--success-color);
}

/* 벌(-30) 선택 */
.action-btn-card.penalty input:checked + .action-visual {
  border-color: var(--danger-color);
  background: rgba(244, 63, 94, 0.08);
}
.action-btn-card.penalty input:checked + .action-visual i,
.action-btn-card.penalty input:checked + .action-visual span {
  color: var(--danger-color);
}

/* ----------------------------------------------------
   9. 타임라인 로그 스타일
   ---------------------------------------------------- */
.timeline-limit-label {
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 600;
  border: 1px solid var(--glass-border);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* 스크롤바 커스터마이징 */
.timeline-container::-webkit-scrollbar {
  width: 5px;
}
.timeline-container::-webkit-scrollbar-track {
  background: transparent;
}
.timeline-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

.timeline-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timeline-empty i {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.05);
}

.timeline-empty p {
  font-size: 13px;
  font-weight: 500;
}

.timeline-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.timeline-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.timeline-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

/* 타임라인 유형별 스타일 */
.timeline-item.daily_usage .timeline-icon-box {
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-color);
}
.timeline-item.reward .timeline-icon-box {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success-color);
}
.timeline-item.penalty .timeline-icon-box {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger-color);
}
.timeline-item.week_transition .timeline-icon-box {
  background: rgba(168, 85, 247, 0.12);
  color: var(--purple-color);
}

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.timeline-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-change {
  font-size: 13px;
  font-weight: 800;
}

.timeline-item.daily_usage .timeline-change { color: var(--danger-color); }
.timeline-item.reward .timeline-change { color: var(--success-color); }
.timeline-item.penalty .timeline-change { color: var(--danger-color); }
.timeline-item.week_transition .timeline-change { 
  color: var(--text-primary);
}
.timeline-item.week_transition.positive .timeline-change { color: var(--success-color); }
.timeline-item.week_transition.negative .timeline-change { color: var(--danger-color); }

.timeline-memo {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ----------------------------------------------------
   10. 토스트 메시지 스타일
   ---------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  white-space: nowrap;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ----------------------------------------------------
    11. 푸터 디자인
   ---------------------------------------------------- */
.app-footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 12px;
}

.app-footer p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ----------------------------------------------------
   11.5 타임라인 주차별 그룹화 헤더 디자인
   ---------------------------------------------------- */
.timeline-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--primary-color);
  border-radius: 6px;
  margin: 16px 0 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.timeline-week-header.current {
  border-left-color: var(--success-color);
  background: rgba(16, 185, 129, 0.04);
}

.timeline-week-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.timeline-week-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.timeline-week-header.current .timeline-week-status {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}

/* ----------------------------------------------------
   11.6 타임라인 대형 날짜 카드 및 삭제 버튼 디자인
   ---------------------------------------------------- */
.timeline-date-card {
  width: 48px;
  height: 52px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.timeline-item.daily_usage .timeline-date-card {
  border-left: 3.5px solid var(--primary-color);
}
.timeline-item.reward .timeline-date-card {
  border-left: 3.5px solid var(--success-color);
}
.timeline-item.penalty .timeline-date-card {
  border-left: 3.5px solid var(--danger-color);
}
.timeline-item.week_transition .timeline-date-card {
  border-left: 3.5px solid var(--purple-color);
}

.date-month {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1;
  margin-bottom: 3px;
}

.date-day {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

/* 삭제 쓰레기통 버튼 */
.timeline-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.timeline-delete-btn:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--danger-color);
}

.timeline-delete-btn:active {
  transform: scale(0.9);
}

/* ----------------------------------------------------
   12. 모바일 반응형 미디어 쿼리
   ---------------------------------------------------- */
@media (max-width: 900px) {
  body {
    padding: 12px;
  }
  
  .app-container {
    gap: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .time-value {
    font-size: 40px;
  }
  
  .glass-card {
    padding: 20px;
  }
}
