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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f7f9fc;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

body.dark {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

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

h1 {
  font-size: 2rem;
}

button {
  padding: 0.5em 1em;
  border: none;
  background-color: #8952d0;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: #5258d0;
}

.controls {
  margin-bottom: 20px;
}

.controls button {
  margin-right: 10px;
}

section {
  background: #ffffff;
  padding: 15px;
  margin-top: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

body.dark section {
  background-color: #2c2c2c;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.6em;
  margin-top: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  background-color: white;
  color: black;
}

body.dark input,
body.dark select,
body.dark textarea {
  background-color: #3c3c3c;
  color: white;
  border: 1px solid #555;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

#calendarDays {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.day {
  background-color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
  font-size: 0.9em;
  transition: background 0.3s;
}

.day.has-event {
  font-weight: bold;
  background-color: #eef5ff;
}

body.dark .day {
  background-color: #2a2a2a;
}

body.dark .day.has-event {
  background-color: #334155;
}

#calendar div,
#searchResults div {
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  padding: 10px;
  margin-bottom: 10px;
}

body.dark #calendar div,
body.dark #searchResults div {
  background-color: #2c2c2c;
}

.day[style*="blue"] { border-left: 5px solid blue; }
.day[style*="green"] { border-left: 5px solid green; }
.day[style*="red"] { border-left: 5px solid red; }
.day[style*="yellow"] { border-left: 5px solid goldenrod; }
.day[style*="gray"] { border-left: 5px solid gray; }


@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  .controls button {
    width: 100%;
  }

  section {
    padding: 10px;
  }

  input[type="text"],
  input[type="date"],
  select,
  textarea,
  button {
    font-size: 1rem;
  }

  #calendarDays {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .day {
    font-size: 0.8em;
    padding: 6px;
  }

  #calendar div,
  #searchResults div {
    font-size: 0.9em;
    padding: 8px;
  }
}

