:root {
  --accent: #1e7bd2;
  --accent-dark: #155ea3;
  --weekend-bg: #fef3ef;
  --bg: #f5f8fb;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: #222;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--accent);
  color: white;
  padding: 1rem;
  text-align: center;
}
header h1 {
  margin: 0;
  font-weight: 600;
}
header form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-end;
  margin-top: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
label {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
input, button {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}
button {
  background: white;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}
button:hover {
  background: var(--accent);
  color: white;
}
.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

/* Calendar */
#month-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  gap: 1rem;
}
#month-controls h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0;
  text-transform: capitalize;
}
#calendar-wrapper {
  min-height: 420px;
  transition: opacity 0.2s ease-in;
}
#calendar {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}
#calendar th, #calendar td {
  padding: 0.7rem;
  text-align: center;
  border: 1px solid #eee;
  width: calc(100% / 7);
}
#calendar td {
  height: 64px;
  cursor: pointer;
}
#calendar td:hover {
  background: #eaf3ff;
}
.weekend {
  background-color: var(--weekend-bg);
}
.weekend-day {
  background-color: var(--weekend-bg);
}
.today {
  background: var(--accent);
  color: white;
  border-radius: 50%;
}
.selected-date {
  background: #bcd8ff;
  color: #000;
  border-radius: 50%;
}

/* Weekly view */
#week-wrapper {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-top: 1rem;
}
.week-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  border-top: 1px solid #eee;
  border-left: 1px solid #eee;
}
.hour-cell {
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 0.25rem;
  font-size: 0.85rem;
  height: 48px;
}
.day-header {
  background: #fafbfd;
  padding: 0.5rem;
  text-align: center;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}
.day-header.weekend {
  background: var(--weekend-bg);
}
.slot {
  position: relative;
}
.event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 0.15rem 0.25rem;
  border-radius: 6px;
  background: #bcd8ff;
  color: #000;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Events */
#events {
  list-style: none;
  padding: 0;
}
#events li {
  background: white;
  margin-bottom: 0.5rem;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.delete-btn {
  background: #ff4444;
  color: white;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.delete-btn:hover {
  background: #cc0000;
}

/* Footer */
footer {
  min-height: 60px;
  text-align: center;
  padding: 1rem;
  background: #f0f4f8;
  color: var(--accent-dark);
}
