/* ============================================
   27학년도 수능 디데이 계산기 CSS
   네오브루탈리즘 디자인 + 다크모드 지원
   ============================================ */

/* 전역 box-sizing */
.suneung-dday-calculator-container,
.suneung-dday-calculator-container *,
.suneung-dday-calculator-container *::before,
.suneung-dday-calculator-container *::after {
  box-sizing: border-box;
}

/* 라이트 모드 (기본) */
.suneung-dday-calculator-container {
  /* 배경색 */
  --bg-primary: #f5f5f0;
  --bg-secondary: #fff;
  --bg-section: #fff;
  
  /* 테두리 */
  --border-color: #333;
  
  /* 텍스트 */
  --text-primary: #222;
  --text-secondary: #555;
  --text-light: #666;
  
  /* 브랜드 색상 */
  --color-accent: #3498db;
  --color-success: #27ae60;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;
  --color-purple: #9b59b6;
  --color-teal: #1abc9c;
  
  /* 그림자 (네오브루탈리즘) */
  --shadow-sm: 2px 2px 0 rgba(0,0,0,0.1);
  --shadow-md: 4px 4px 0 rgba(0,0,0,0.15);
  --shadow-lg: 8px 8px 0 rgba(0,0,0,0.15);
  
  /* 입력 포커스 */
  --input-focus-bg: #fffacd;
  
  /* 헤더 타이틀 */
  --title-color: #2c3e50;
  --title-shadow: 2px 2px 0 rgba(255,255,255,0.5);
  
  /* 버튼 호버 배경 */
  --btn-hover-overlay: rgba(0,0,0,0.1);
  
  /* 복사 버튼 배경 */
  --copy-btn-bg: #fff;
  --copy-btn-hover-bg: #f0f0f0;
  
  /* 메인 컨테이너 */
  position: relative;
  max-width: 1180px;
  width: 100%;
  margin: 15px auto;
  padding: 12px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  font-family: 'Noto Sans KR', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  line-height: 1.5;
}

/* 수동 다크 모드 */
.suneung-dday-calculator-container.dark {
  /* 배경색 - 다크 그레이 톤 */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-section: #2d2d2d;
  
  /* 테두리 - 밝은 그레이로 대비 */
  --border-color: #e0e0e0;
  
  /* 텍스트 - 밝은 색상으로 가독성 확보 */
  --text-primary: #e8e8e8;
  --text-secondary: #b0b0b0;
  --text-light: #909090;
  
  /* 브랜드 색상 - 다크 배경에서 더 밝게 조정 */
  --color-accent: #5dade2;
  --color-success: #52c77a;
  --color-warning: #f5b041;
  --color-danger: #ec7063;
  --color-purple: #af7ac5;
  --color-teal: #48d1cc;
  
  /* 그림자 - 밝은 색으로 변경 (네오브루탈리즘) */
  --shadow-sm: 2px 2px 0 rgba(255,255,255,0.08);
  --shadow-md: 4px 4px 0 rgba(255,255,255,0.12);
  --shadow-lg: 8px 8px 0 rgba(255,255,255,0.12);
  
  /* 입력 포커스 - 약간 밝은 다크 그레이 */
  --input-focus-bg: #3a3a3a;
  
  /* 헤더 타이틀 - 밝은 파란색 계열 */
  --title-color: #7fb3d5;
  --title-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  
  /* 버튼 호버 배경 */
  --btn-hover-overlay: rgba(255,255,255,0.1);
  
  /* 복사 버튼 배경 */
  --copy-btn-bg: #3a3a3a;
  --copy-btn-hover-bg: #4a4a4a;
}

/* 시스템 다크모드 자동 감지 (수동 설정 없을 때만) */
@media (prefers-color-scheme: dark) {
  .suneung-dday-calculator-container:not(.dark):not(.light) {
    /* 배경색 */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-section: #2d2d2d;
    
    /* 테두리 */
    --border-color: #e0e0e0;
    
    /* 텍스트 */
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-light: #909090;
    
    /* 브랜드 색상 */
    --color-accent: #5dade2;
    --color-success: #52c77a;
    --color-warning: #f5b041;
    --color-danger: #ec7063;
    --color-purple: #af7ac5;
    --color-teal: #48d1cc;
    
    /* 그림자 */
    --shadow-sm: 2px 2px 0 rgba(255,255,255,0.08);
    --shadow-md: 4px 4px 0 rgba(255,255,255,0.12);
    --shadow-lg: 8px 8px 0 rgba(255,255,255,0.12);
    
    /* 입력 포커스 */
    --input-focus-bg: #3a3a3a;
    
    /* 헤더 타이틀 */
    --title-color: #7fb3d5;
    --title-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    
    /* 버튼 호버 배경 */
    --btn-hover-overlay: rgba(255,255,255,0.1);
    
    /* 복사 버튼 배경 */
    --copy-btn-bg: #3a3a3a;
    --copy-btn-hover-bg: #4a4a4a;
  }
}

/* ============================================
   다크모드 토글 버튼
   ============================================ */
.dark-mode-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 10;
}

.dark-mode-toggle:hover {
  transform: translate(0.5px, 0.5px);
  box-shadow: 1.5px 1.5px 0 rgba(0,0,0,0.15);
}

.dark-mode-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.theme-icon {
  font-size: 18px;
  display: inline-block;
}

/* ============================================
   헤더
   ============================================ */
.calculator-header {
  text-align: center;
  margin-bottom: 12px;
  padding: 0 40px 10px 40px;
  border-bottom: 3px double var(--border-color);
}

.calculator-header h2 {
  margin: 0 0 6px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--title-color);
  text-shadow: var(--title-shadow);
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.4;
}

/* ============================================
   메인 그리드
   ============================================ */
.calculator-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ============================================
   섹션 공통
   ============================================ */
.dday-main-section,
.strategy-motivation-section,
.study-check-section,
.schedule-section,
.share-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px;
  box-shadow: var(--shadow-md);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title svg {
  flex-shrink: 0;
}

/* ============================================
   디데이 메인 섹션
   ============================================ */
.dday-display {
  text-align: center;
  margin-bottom: 15px;
}

.big-dday {
  font-size: 3.2em;
  font-weight: bold;
  color: var(--color-danger);
  margin-bottom: 5px;
  font-family: 'Courier New', monospace;
}

.dday-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 5px;
}

.current-time {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================
   시간 분해
   ============================================ */
.time-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.time-item {
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 8px 5px;
}

.time-value {
  display: block;
  font-size: 1.5em;
  font-weight: bold;
  color: var(--color-accent);
  font-family: 'Courier New', monospace;
}

.time-unit {
  display: block;
  font-size: 0.75em;
  color: var(--text-light);
  margin-top: 2px;
}

/* ============================================
   전환 버튼
   ============================================ */
.switch-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-switch:hover {
  transform: translate(0.5px, 0.5px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.btn-switch:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-switch.active {
  background: var(--color-accent);
  color: #fff;
  border-width: 1.5px;
}

.btn-switch svg {
  flex-shrink: 0;
}

/* ============================================
   진행률
   ============================================ */
.progress-section {
  margin-bottom: 12px;
}

.progress-label {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 5px;
  text-align: center;
  font-weight: 600;
}

.progress-description {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

.progress-description span {
  font-weight: bold;
  color: var(--color-accent);
}

.progress-bar {
  position: relative;
  height: 25px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-teal));
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: bold;
  color: var(--text-primary);
}

/* ============================================
   추가 정보
   ============================================ */
.additional-info {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  color: var(--text-secondary);
}

.info-value {
  font-weight: bold;
  color: var(--color-purple);
}

/* ============================================
   전략 콘텐츠
   ============================================ */
.strategy-content {
  background: var(--bg-primary);
  border: 1px solid var(--color-accent);
  padding: 12px;
  margin-bottom: 12px;
}

.strategy-phase {
  font-size: 15px;
  font-weight: bold;
  color: var(--color-accent);
  margin-bottom: 8px;
  text-align: center;
}

.strategy-tips ul {
  margin: 0;
  padding-left: 18px;
}

.strategy-tips li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  line-height: 1.4;
}

/* ============================================
   동기부여 영역
   ============================================ */
.motivation-area {
  background: var(--bg-primary);
  border: 1px solid var(--color-success);
  padding: 12px;
}

.cheer-message {
  background: linear-gradient(135deg, var(--color-accent), var(--color-teal));
  color: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.btn-new-message {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-success);
  color: white;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-new-message:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.btn-new-message:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* ============================================
   학습 체크리스트
   ============================================ */
.study-checklist {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 12px;
  margin-bottom: 12px;
}

.study-checklist h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 700;
}

.checklist-items {
  margin-bottom: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  padding: 6px;
  border-radius: 4px;
  transition: background-color 0.2s;
  position: relative;
}

.checkbox-item:hover {
  background-color: var(--btn-hover-overlay);
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.checkbox-item span {
  flex: 1;
  cursor: pointer;
  color: var(--text-primary);
}

.checkbox-item input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  color: var(--text-light);
  opacity: 0.7;
}

.btn-delete-task {
  width: 20px;
  height: 20px;
  background: var(--color-danger);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
}

.btn-delete-task:hover {
  opacity: 1;
}

/* ============================================
   학습 항목 추가
   ============================================ */
.add-task-area {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.add-task-input {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.add-task-input input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: background 0.2s;
}

.add-task-input input:focus {
  outline: none;
  background: var(--input-focus-bg);
}

.btn-add-task {
  padding: 8px 14px;
  background: var(--color-accent);
  color: white;
  border: 1.5px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-add-task:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.btn-add-task:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-reset-tasks {
  width: 100%;
  padding: 8px;
  background: var(--color-warning);
  color: white;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-reset-tasks:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.btn-reset-tasks:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.progress-summary {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-weight: 600;
}

/* ============================================
   학습 팁
   ============================================ */
.study-tips {
  background: var(--bg-primary);
  border: 1px solid var(--color-warning);
  padding: 12px;
}

.study-tips h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 700;
}

.study-tips ul {
  margin: 0;
  padding-left: 18px;
}

.study-tips li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  line-height: 1.4;
}

/* ============================================
   하단 섹션
   ============================================ */
.bottom-section {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ============================================
   일정 섹션
   ============================================ */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.schedule-date {
  font-weight: bold;
  color: var(--color-danger);
}

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

/* ============================================
   공유 섹션
   ============================================ */
.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-share {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.btn-share:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.btn-share:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-share svg {
  flex-shrink: 0;
}

/* ============================================
   공지사항
   ============================================ */
.notice {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--color-warning);
}

/* ============================================
   토스트 알림
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 250px;
  max-width: 350px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  border-color: var(--color-success);
}

.toast-error {
  border-color: var(--color-danger);
}

.toast-info {
  border-color: var(--color-accent);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   반응형 디자인
   ============================================ */

/* 태블릿 */
@media (max-width: 768px) {
  .suneung-dday-calculator-container {
    margin: 8px auto;
    padding: 10px;
    border-width: 1px;
  }
  
  .calculator-header {
    padding: 0 35px 8px 35px;
  }
  
  .calculator-header h2 {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 13px;
  }
  
  .calculator-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .big-dday {
    font-size: 2.5em;
  }
  
  .time-breakdown {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .time-value {
    font-size: 1.2em;
  }
  
  .time-unit {
    font-size: 0.7em;
  }
  
  .bottom-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* 모바일 */
@media (max-width: 480px) {
  .suneung-dday-calculator-container {
    padding: 8px;
    margin: 5px auto;
  }
  
  .calculator-header {
    padding: 0 30px 8px 30px;
  }
  
  .calculator-header h2 {
    font-size: 20px;
  }
  
  .subtitle {
    font-size: 12px;
  }
  
  .big-dday {
    font-size: 2em;
  }
  
  .time-breakdown {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  .time-item {
    padding: 6px 3px;
  }
  
  .time-value {
    font-size: 1em;
  }
  
  .time-unit {
    font-size: 0.65em;
  }
  
  .switch-buttons {
    gap: 6px;
  }
  
  .btn-switch {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .add-task-input {
    flex-direction: column;
    gap: 6px;
  }
  
  .add-task-input input {
    width: 100%;
  }
  
  .btn-add-task {
    width: 100%;
    padding: 8px;
  }
  
  .share-buttons {
    gap: 6px;
  }
  
  .schedule-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}