/* Reset & base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #14131a;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated canvas background */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Page header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background-color: #1e1d2b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
}

header button {
  background-color: #7c3aed;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

header button:hover {
  background-color: #9a53ff;
  transform: scale(1.05);
}

/* Main layout */
main {
  padding: 30px;
  position: relative;
  z-index: 1;
}

/* Calendar month controls */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.calendar-header h2 {
  font-size: 1.6rem;
  font-weight: 600;
}

.calendar-header button {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #ccc;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.calendar-header button:hover {
  transform: scale(1.2);
  color: #fff;
}

/* Weekday labels */
.weekday-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 0 20px;
  margin-top: 20px;
  font-weight: 600;
  color: #f5f5f5;
  text-align: center;
  font-size: 1rem;
}
.weekday-labels div {
  padding: 10px 0;
  border-radius: 10px;
  background-color: transparent;
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding-top: 10px;
}

.calendar-grid div {
  aspect-ratio: 1 / 1;
  background-color: #e5dcc1;
  color: #14131a;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
  font-weight: 500;
}

.calendar-grid div:hover {
  background-color: #f5eedb;
  transform: scale(1.02);
}

.calendar-grid div.today {
  border: 2px solid #a56aff;
  box-shadow: 0 0 10px rgba(165, 106, 255, 0.6);
}

.calendar-grid div .date {
  font-size: 0.9rem;
  font-weight: 500;
}

.calendar-grid div.event-dot::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #7c3aed;
}

.blank-day {
  background: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #232236;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  position: relative;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content input,
.modal-content textarea {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #1a1928;
  color: #fff;
  font-size: 0.95rem;
}

.modal-content button[type="submit"] {
  background-color: #7c3aed;
  border: none;
  padding: 12px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-content button[type="submit"]:hover {
  background-color: #9a53ff;
}

.calendar-grid div {
  background-color: rgba(229, 220, 193, 0.75);
  backdrop-filter: blur(6px);
}
.calendar-grid {
  transition: opacity 0.4s ease;
}
.fade-out {
  opacity: 0;
}
.fade-in {
  opacity: 1;
}
.calendar-grid div.today {
  border: 2px solid #a56aff;
  animation: pulse 2s infinite;
  box-shadow: 0 0 0px rgba(165, 106, 255, 0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0px rgba(165, 106, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(165, 106, 255, 0.8);
  }
  100% {
    box-shadow: 0 0 0px rgba(165, 106, 255, 0.4);
  }
}



.close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.4rem;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
}
.calendar-grid div:hover {
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
  transform: scale(1.03);
}


.close:hover {
  color: white;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .calendar-grid {
    gap: 8px;
  }

  .calendar-grid div {
    padding: 4px;
  }

  .modal-content {
    padding: 20px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
