:root {
  --primary: #4a90e2;
  --bg: #f5f7fa;
  --text: #333;
  --container-bg: white;
  --border-color: #ddd;
  --grid-border: #eee;
  --highlight: rgba(74, 144, 226, 0.5);
  --task-line: #f0f0f0;
}

body.dark-mode {
  --bg: #121212;
  --text: #e0e0e0;
  --container-bg: #1e1e1e;
  --border-color: #444;
  --grid-border: #333;
  --highlight: rgba(74, 144, 226, 0.7);
  --task-line: #2a2a2a;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1rem;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--text);
  color: var(--container-bg);
}

.planner-wrapper {
  width: 100%;
  max-width: 900px;
}

.planner-container {
  background: var(--container-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

/* Header styling */
.planner-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: bold;
}

.date-inputs input {
  width: 3rem;
  text-align: center;
  font-size: 1.2rem;
  border: none;
  border-bottom: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  font-weight: bold;
  outline: none;
}

.label {
  font-size: 0.9rem;
  color: #888;
  margin-right: 1rem;
}

.d-day {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.d-day-label {
  font-size: 1.5rem;
  font-weight: bold;
}

.d-day input {
  width: 4rem;
  font-size: 1.5rem;
  border: none;
  border-bottom: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  font-weight: bold;
  outline: none;
  text-align: center;
}

.header-right {
  display: flex;
  gap: 2rem;
}

.time-summary {
  display: flex;
  gap: 1.5rem;
}

.time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-title {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.time-inputs input {
  width: 2.5rem;
  text-align: center;
  font-size: 1.2rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  color: var(--text);
  outline: none;
}

/* Body styling */
.planner-body {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .planner-body {
    flex-direction: column;
  }
}

/* Task Section */
.task-section {
  flex: 1;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--task-line);
  padding-bottom: 0.4rem;
}

.task-checkbox {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  accent-color: var(--text);
}

.task-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.task-row.completed .task-input {
  text-decoration: line-through;
  color: #999;
}

.delete-task-btn {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  display: none;
}

.task-row:hover .delete-task-btn {
  display: block;
}

.delete-task-btn:hover {
  color: #ff4d4f;
}

.add-task-btn {
  margin-top: 1rem;
  background: transparent;
  border: 1px dashed var(--border-color);
  color: #888;
  padding: 0.5rem;
  width: 100%;
  cursor: pointer;
  border-radius: 4px;
}

.add-task-btn:hover {
  background: var(--grid-border);
  color: var(--text);
}

/* Time Grid Section */
.time-grid-section {
  flex: 1;
  border-left: 1px solid var(--border-color);
  padding-left: 2rem;
}

@media (max-width: 768px) {
  .time-grid-section {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
  }
}

.time-grid-header {
  display: grid;
  grid-template-columns: 2rem repeat(6, 1fr);
  gap: 1px;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}

.time-grid-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background-color: var(--grid-border); /* Acts as border between cells */
  border: 1px solid var(--grid-border);
}

.time-grid-row {
  display: grid;
  grid-template-columns: 2rem repeat(6, 1fr);
  gap: 1px;
  background-color: var(--grid-border);
}

.time-hour {
  background-color: var(--container-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #888;
  padding: 0.2rem 0;
}

.time-cell {
  background-color: var(--container-bg);
  height: 1.2rem;
  cursor: pointer;
  transition: background-color 0.1s;
}

.time-cell:hover {
  background-color: var(--grid-border);
}

.time-cell.active {
  background-color: var(--highlight);
}

/* Footer Section */
.review-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.review-label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.review-input {
  width: 100%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text);
  padding: 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

/* Contact Form Styles */
.contact-form {
  background: var(--container-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  text-align: left;
}

.contact-form h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  margin-top: 0;
}

.form-group {
  margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
  background-color: var(--bg);
  color: var(--text);
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
}

.contact-form textarea {
  height: 100px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  background-color: var(--text);
  color: var(--container-bg);
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  opacity: 0.9;
}