* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f8f9fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.header p {
  font-size: 1.2em;
  color: #666666;
  margin-bottom: 30px;
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.header-actions .save-btn,
.header-actions .export-btn,
.header-actions .reset-btn {
  padding: 10px 20px;
  font-size: 0.9em;
  border-radius: 6px;
}

.template-section {
  background: #ffffff;
  margin-bottom: 30px;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e5e5;
}

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

.section-header h2 {
  color: #1a1a1a;
  font-size: 1.8em;
  font-weight: 600;
  margin: 0;
}

.help-tooltip {
  position: relative;
  cursor: pointer;
  width: 32px;
  height: 32px;
  background: #1a1a1a;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.2s ease;
}

.help-tooltip:hover {
  background: #333333;
  transform: scale(1.1);
}

.help-content {
  display: none;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #1a1a1a;
}

.help-content.show {
  display: block;
}

.help-content p {
  font-weight: 600;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.help-content ul {
  list-style: none;
  padding-left: 0;
}

.help-content li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
  color: #333333;
}

.help-content li::before {
  content: "•";
  color: #1a1a1a;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.input-area {
  margin-top: 20px;
}

.text-input,
.textarea-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background: #ffffff;
  height: 48px;
  box-sizing: border-box;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.textarea-input {
  min-height: 100px;
  height: auto;
  resize: vertical;
}

.textarea-input.small {
  min-height: 60px;
}

.subsection {
  margin-bottom: 24px;
}

.subsection h3 {
  color: #333333;
  font-size: 1.2em;
  margin-bottom: 12px;
  font-weight: 600;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.date-input,
.version-input,
.author-input,
.change-input,
.milestone-input {
  padding: 12px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1em;
  height: 48px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background: #ffffff;
}

.date-input:focus,
.version-input:focus,
.author-input:focus,
.change-input:focus,
.milestone-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.criteria-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.criteria-item h4 {
  color: #1a1a1a;
  margin-bottom: 12px;
  font-size: 1.1em;
  font-weight: 600;
}

.timeline-container,
.persona-container,
.scenario-container,
.story-container,
.feature-container,
.requirements-container,
.qa-container {
  margin-bottom: 20px;
}

.timeline-item,
.persona-item,
.scenario-item,
.story-item,
.feature-item,
.requirement-item,
.qa-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  margin-bottom: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.persona-item,
.scenario-item,
.story-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: start;
}

.requirement-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.priority-select,
.req-type-select {
  padding: 12px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1em;
  background: #ffffff;
  height: 48px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.priority-select:focus,
.req-type-select:focus {
  outline: none;
  border-color: #1a1a1a;
}

.add-btn {
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.add-btn:hover {
  background: #333333;
}

.action-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.save-btn,
.export-btn,
.reset-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.2s ease;
}

.save-btn {
  background: #1a1a1a;
  color: #ffffff;
}

.save-btn:hover {
  background: #333333;
}

.export-btn {
  background: #ffffff;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.export-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.reset-btn {
  background: #dc3545;
  color: #ffffff;
}

.reset-btn:hover {
  background: #c82333;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #e5e5e5;
  color: #666666;
  font-size: 0.9em;
}

.footer p {
  margin: 0;
}

/* 디자인 링크 스타일 */
.design-links-container {
  margin-bottom: 15px;
}

.design-link-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.design-link-item .text-input,
.design-link-item .url-input {
  height: 48px;
  padding: 12px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.design-link-item .text-input:focus,
.design-link-item .url-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.design-link-item .text-input {
  flex: 1;
  min-width: 200px;
}

.design-link-item .url-input {
  flex: 2;
  min-width: 300px;
}

.design-link-item .add-btn {
  padding: 12px 16px;
  font-size: 1em;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* 위로 가기 버튼 */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
}

.scroll-to-top:hover {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.show {
  display: block;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .header-actions {
    flex-direction: column;
    align-items: center;
  }

  .header-actions .save-btn,
  .header-actions .export-btn,
  .header-actions .reset-btn {
    width: 200px;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .template-section {
    padding: 20px;
  }

  .header h1 {
    font-size: 2em;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .feature-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* 애니메이션 */
.template-section {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #1a1a1a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #333333;
}
