/* 기본 스타일 */
.date-calculator-container {
  max-width: 1180px;
  margin: 20px auto;
  padding: 20px;
  background: #f5f5f0;
  border: 2px solid #333;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: #222;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.15);
  box-sizing: border-box;
}

.calculator-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px double #333;
}

.calculator-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}

.subtitle {
  margin: 0;
  font-size: 17px;
  color: #666;
}

/* 모드 선택 버튼 */
.mode-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.mode-btn {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  color: #333;
  font-family: inherit;
}

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

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

.mode-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #2980b9;
}

/* 메인 레이아웃 */
.calculator-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.input-section,
.result-section {
  background: #fff;
  border: 1px solid #333;
  padding: 15px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.section-title {
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

/* 입력 필드 */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 600;
  color: #555;
}

.date-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #333;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  font-family: inherit;
}

.date-input:focus {
  outline: none;
  background: #fffacd;
  border-color: #e67e22;
}

.today-btn {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  white-space: nowrap;
  font-family: inherit;
  color: #333;
}

.today-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

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

/* 빠른 설정 */
.quick-presets {
  margin: 15px 0;
  padding: 12px;
  background: #f9f9f9;
  border: 1px dashed #333;
}

.preset-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
}

.preset-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 50px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  font-family: inherit;
  color: #333;
}

.preset-btn:hover {
  background: #e3f2fd;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

.preset-btn:active,
.preset-btn.active {
  background: #3498db;
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* 기간 입력 */
.duration-wrapper {
  display: flex;
  gap: 8px;
}

.duration-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #333;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  font-family: inherit;
}

.duration-select {
  padding: 8px 10px;
  border: 1px solid #333;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #333;
}

.duration-input:focus,
.duration-select:focus {
  outline: none;
  background: #fffacd;
  border-color: #e67e22;
}

/* 옵션 박스 */
.options-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  margin: 15px 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: #333;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3498db;
  cursor: pointer;
}

/* 버튼 그룹 */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-calculate {
  flex: 1;
  padding: 12px;
  background: #e67e22;
  border: 1px solid #333;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
  transition: all 0.1s;
  font-family: inherit;
}

.btn-calculate:hover {
  background: #d35400;
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

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

.btn-reset {
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #333;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transition: all 0.1s;
  font-family: inherit;
}

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

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

/* 결과 섹션 */
.main-result {
  margin-bottom: 15px;
  padding: 15px;
  background: #fffacd;
  border: 2px dashed #333;
  min-height: 60px;
}

.result-empty {
  text-align: center;
  color: #666;
  font-size: 15px;
  padding: 10px 0;
}

.result-text {
  font-size: 15px;
  line-height: 1.6;
  color: #222;
}

.result-text strong {
  color: #e67e22;
  font-weight: 700;
}

/* 결과 카드 */
.result-cards {
  margin-bottom: 15px;
}

.total-card {
  background: #ebf5fb;
  border: 1px solid #3498db;
  padding: 12px;
  margin-bottom: 10px;
  text-align: center;
}

.total-card .card-header {
  font-size: 14px;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 5px;
}

.total-card .card-value {
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.result-card-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.result-card {
  flex: 1;
  background: #f9f9f9;
  border: 1px solid #333;
  padding: 10px;
  text-align: center;
}

.card-label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.card-value-small {
  font-size: 20px;
  font-weight: 700;
  color: #222;
}

/* 추가 정보 카드 */
.info-cards {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.info-card {
  flex: 1;
  background: #f0f0f0;
  border: 1px solid #999;
  padding: 10px 8px;
  text-align: center;
}

.info-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.info-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

/* 액션 버튼 */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  flex: 1;
  padding: 10px;
  background: #fff;
  border: 1px solid #333;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transition: all 0.1s;
  font-family: inherit;
  color: #333;
}

.action-btn:hover {
  background: #f0f0f0;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

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

/* 날짜 정보 섹션 */
.date-info-section {
  background: #fff;
  border: 1px solid #333;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.date-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.date-info-box {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 12px;
}

.date-info-box h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
}

.date-info-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.date-info-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.date-info-label {
  color: #666;
}

.date-info-value {
  font-weight: 600;
  color: #222;
}

/* 계산 이력 */
.history-section {
  background: #fff;
  border: 1px solid #333;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

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

.clear-history-btn {
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #333;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  transition: all 0.1s;
  font-family: inherit;
  color: #333;
}

.clear-history-btn:hover {
  background: #fee;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

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

.history-list {
  max-height: 200px;
  overflow-y: auto;
}

.history-empty {
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 20px 0;
}

.history-item {
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.1s;
}

.history-item:hover {
  background: #f0f0f0;
  border-color: #999;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-date {
  font-weight: 600;
  color: #222;
  margin-bottom: 3px;
}

.history-result {
  color: #666;
  font-size: 11px;
}

/* 푸터 노트 */
.footer-note {
  margin-top: 15px;
  padding: 12px;
  background: #f0f0f0;
  border: 2px dashed #999;
  text-align: center;
}

.footer-note p {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* 반응형 */
@media (max-width: 768px) {
  .calculator-main {
    grid-template-columns: 1fr;
  }
  
  .date-info-grid {
    grid-template-columns: 1fr;
  }
  
  .mode-selector {
    flex-direction: column;
  }
  
  .preset-buttons {
    gap: 4px;
  }
  
  .preset-btn {
    min-width: calc(33.333% - 3px);
  }
  
  .result-card-row {
    flex-wrap: wrap;
  }
  
  .btn-group {
    flex-direction: column;
  }
}

/* 다크모드 테마 */
@media (prefers-color-scheme: dark) {
  .date-calculator-container {
    background: #2c2c2c;
    border-color: #555;
    color: #e0e0e0;
  }
  
  .calculator-header h2 {
    color: #e0e0e0;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  }
  
  .subtitle {
    color: #aaa;
  }
  
  .input-section,
  .result-section,
  .date-info-section,
  .history-section {
    background: #1a1a1a;
    border-color: #555;
  }
  
  .section-title {
    color: #e0e0e0;
    border-color: #555;
  }
  
  .mode-btn {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
  }
  
  .mode-btn.active {
    background: #3498db;
    color: #fff;
  }
  
  .date-input,
  .duration-input,
  .duration-select,
  .today-btn,
  .preset-btn,
  .btn-reset,
  .action-btn,
  .clear-history-btn {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
  }
  
  .date-input:focus,
  .duration-input:focus,
  .duration-select:focus {
    background: #3a3a00;
    border-color: #e67e22;
  }
  
  .quick-presets,
  .options-box {
    background: #252525;
    border-color: #555;
  }
  
  .preset-label {
    color: #aaa;
  }
  
  .checkbox-item {
    color: #e0e0e0;
  }
  
  .main-result {
    background: #3a3a00;
    border-color: #555;
  }
  
  .result-empty {
    color: #aaa;
  }
  
  .result-text {
    color: #e0e0e0;
  }
  
  .total-card {
    background: #1a2a3a;
    border-color: #3498db;
  }
  
  .total-card .card-value {
    color: #e0e0e0;
  }
  
  .result-card {
    background: #252525;
    border-color: #555;
  }
  
  .card-value-small {
    color: #e0e0e0;
  }
  
  .info-card {
    background: #252525;
    border-color: #555;
  }
  
  .info-value {
    color: #e0e0e0;
  }
  
  .date-info-box {
    background: #252525;
    border-color: #555;
  }
  
  .date-info-value {
    color: #e0e0e0;
  }
  
  .history-item {
    background: #252525;
    border-color: #555;
  }
  
  .history-item:hover {
    background: #333;
  }
  
  .history-date {
    color: #e0e0e0;
  }
  
  .footer-note {
    background: #252525;
    border-color: #555;
  }
}

/* 다크모드 클래스 버전 (워드프레스 토글용) */
body.dark-mode .date-calculator-container,
.dark-mode .date-calculator-container {
  background: #2c2c2c;
  border-color: #555;
  color: #e0e0e0;
}

body.dark-mode .calculator-header h2,
.dark-mode .calculator-header h2 {
  color: #e0e0e0;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

body.dark-mode .subtitle,
.dark-mode .subtitle {
  color: #aaa;
}

body.dark-mode .input-section,
body.dark-mode .result-section,
body.dark-mode .date-info-section,
body.dark-mode .history-section,
.dark-mode .input-section,
.dark-mode .result-section,
.dark-mode .date-info-section,
.dark-mode .history-section {
  background: #1a1a1a;
  border-color: #555;
}

body.dark-mode .section-title,
.dark-mode .section-title {
  color: #e0e0e0;
  border-color: #555;
}

body.dark-mode .mode-btn,
.dark-mode .mode-btn {
  background: #333;
  border-color: #555;
  color: #e0e0e0;
}

body.dark-mode .mode-btn.active,
.dark-mode .mode-btn.active {
  background: #3498db;
  color: #fff;
}

body.dark-mode .date-input,
body.dark-mode .duration-input,
body.dark-mode .duration-select,
body.dark-mode .today-btn,
body.dark-mode .preset-btn,
body.dark-mode .btn-reset,
body.dark-mode .action-btn,
body.dark-mode .clear-history-btn,
.dark-mode .date-input,
.dark-mode .duration-input,
.dark-mode .duration-select,
.dark-mode .today-btn,
.dark-mode .preset-btn,
.dark-mode .btn-reset,
.dark-mode .action-btn,
.dark-mode .clear-history-btn {
  background: #333;
  border-color: #555;
  color: #e0e0e0;
}

body.dark-mode .date-input:focus,
body.dark-mode .duration-input:focus,
body.dark-mode .duration-select:focus,
.dark-mode .date-input:focus,
.dark-mode .duration-input:focus,
.dark-mode .duration-select:focus {
  background: #3a3a00;
  border-color: #e67e22;
}

body.dark-mode .quick-presets,
body.dark-mode .options-box,
.dark-mode .quick-presets,
.dark-mode .options-box {
  background: #252525;
  border-color: #555;
}

body.dark-mode .preset-label,
.dark-mode .preset-label {
  color: #aaa;
}

body.dark-mode .checkbox-item,
.dark-mode .checkbox-item {
  color: #e0e0e0;
}

body.dark-mode .main-result,
.dark-mode .main-result {
  background: #3a3a00;
  border-color: #555;
}

body.dark-mode .result-empty,
.dark-mode .result-empty {
  color: #aaa;
}

body.dark-mode .result-text,
.dark-mode .result-text {
  color: #e0e0e0;
}

body.dark-mode .total-card,
.dark-mode .total-card {
  background: #1a2a3a;
  border-color: #3498db;
}

body.dark-mode .total-card .card-value,
.dark-mode .total-card .card-value {
  color: #e0e0e0;
}

body.dark-mode .result-card,
.dark-mode .result-card {
  background: #252525;
  border-color: #555;
}

body.dark-mode .card-value-small,
.dark-mode .card-value-small {
  color: #e0e0e0;
}

body.dark-mode .info-card,
.dark-mode .info-card {
  background: #252525;
  border-color: #555;
}

body.dark-mode .info-value,
.dark-mode .info-value {
  color: #e0e0e0;
}

body.dark-mode .date-info-box,
.dark-mode .date-info-box {
  background: #252525;
  border-color: #555;
}

body.dark-mode .date-info-value,
.dark-mode .date-info-value {
  color: #e0e0e0;
}

body.dark-mode .history-item,
.dark-mode .history-item {
  background: #252525;
  border-color: #555;
}

body.dark-mode .history-item:hover,
.dark-mode .history-item:hover {
  background: #333;
}

body.dark-mode .history-date,
.dark-mode .history-date {
  color: #e0e0e0;
}

body.dark-mode .footer-note,
.dark-mode .footer-note {
  background: #252525;
  border-color: #555;
}