/* Base layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #d4b48c; /* cork-ish */
  color: #333;
}

header {
  background: #5b4636;
  color: #fdf5e6;
  padding: 0.5rem 1.5rem;
}

header nav a {
  color: #fdf5e6;
  margin-right: 1rem;
  text-decoration: none;
  font-weight: 500;
}

header nav a:hover {
  text-decoration: underline;
}

main {
  padding: 1.5rem;
}

/* Corkboard */

.corkboard-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.corkboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.corkboard-header h1 {
  margin: 0;
  color: #3f2c1f;
}

.new-task-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.new-task-form input[type="text"] {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.new-task-form button {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: none;
  background: #4f7cac;
  color: white;
  cursor: pointer;
}

.new-task-form button:hover {
  background: #3e6288;
}

.corkboard {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
  padding: 1rem;
  border-radius: 12px;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.15) 0, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(0,0,0,0.1) 0, transparent 60%);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
}

/* Task cards */

.task-card {
  position: relative;
  width: 240px;
  min-height: 160px;
  padding: 1.2rem 1rem 0.9rem;
  background: #fffbe6;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  box-shadow:
    0 8px 12px rgba(0,0,0,0.25),
    0 0 0 1px rgba(0,0,0,0.05);
  transform-origin: center top;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Slight random-y rotations via nth-child */

.task-card:nth-child(3n+1) {
  transform: rotate(-2.5deg);
}

.task-card:nth-child(3n+2) {
  transform: rotate(2deg);
}

.task-card:nth-child(3n) {
  transform: rotate(-1deg);
}

.task-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 12px 20px rgba(0,0,0,0.35),
    0 0 0 1px rgba(0,0,0,0.07);
}

/* Thumbtack */

.thumbtack {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border-radius: 50%;
  box-shadow:
    0 2px 0px rgba(0,0,0,0.4),
    0 0 0 2px rgba(255,255,255,0.7);
}

.thumbtack::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 2px;
  height: 8px;
  background: rgba(0,0,0,0.4);
  transform: translateX(-50%);
}

/* Task card content */

.task-card-content {
  margin-top: 0.4rem;
}

.task-card-title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.task-card-desc {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.task-card-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #555;
}

.task-card-meta span {
  display: inline-block;
  margin-top: 0.1rem;
}

/* Task detail / flashcard stack */

.task-detail-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.task-detail-header {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #4f7cac;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.task-detail-header h1 {
  margin: 0 0 0.5rem;
}

.task-detail-description {
  margin: 0;
}

.timeline-section {
  margin-bottom: 2rem;
}

.timeline-section h2 {
  margin-bottom: 0.75rem;
}

.timeline-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Event flashcards */

.event-card {
  background: #fffdf6;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  box-shadow:
    0 6px 10px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
}

.event-card:nth-child(odd) {
  transform: rotate(-0.7deg);
}

.event-card:nth-child(even) {
  transform: rotate(0.7deg);
}

.event-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #4f7cac;
  color: white;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-date {
  font-size: 0.8rem;
  color: #666;
}

.event-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.event-body {
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
}

.event-meta {
  font-size: 0.85rem;
  color: #555;
}

.event-meta-item + .event-meta-item {
  margin-top: 0.2rem;
}

/* Add event form */

.add-event-section h2 {
  margin-bottom: 0.75rem;
}

.add-event-form {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 0.8rem 1rem 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.form-row {
  margin-bottom: 0.6rem;
}

.form-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.add-event-form input[type="text"],
.add-event-form input[type="number"],
.add-event-form input[type="datetime-local"],
.add-event-form textarea,
.add-event-form select {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
  font: inherit;
}

.add-event-form textarea {
  min-height: 80px;
  resize: vertical;
}

.add-event-form button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  background: #4f7cac;
  color: white;
  cursor: pointer;
}

.add-event-form button:hover {
  background: #3e6288;
}


.completed-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.completed-task-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.completed-task-item {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.completed-task-item a {
  text-decoration: none;
  color: #333;
}

.completed-task-item a:hover {
  text-decoration: underline;
}

.completed-task-date {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.completed-task-desc {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

/* Task status actions on detail page */

.task-status-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.task-status-badge {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.task-status-badge.active {
  background: #4f7cac;
  color: #fff;
}

.task-status-badge.completed {
  background: #3c9d5d;
  color: #fff;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.inline-form button {
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  border: none;
  background: #4f7cac;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

.inline-form button:hover {
  background: #3e6288;
}