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

/* Example: Thin, rounded, gray scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}

html {
  background-color: #f5e6d3; /* Fallback color */
  min-height: 100vh;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Layered Background System */
.background-layers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.layer {
  position: absolute;
  height: auto;
  object-fit: contain;
}

/* Base background layer - z-index: 0 */
.layer-background {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Background bamboos - z-index: 1-2 */
.layer-bl-bamboos {
  bottom: 0;
  left: 0;
  width: calc(195 / 1920 * 90vw); /* ~9% viewport width */
  z-index: 1;
}

.layer-br-bamboos {
  bottom: 0;
  right: 0;
  width: calc(195 / 1920 * 90vw);
  z-index: 2;
}

/* Horses - z-index: 3-4 (in front of background bamboos) */
.layer-l-horse {
  bottom: 0;
  left: 0;
  width: calc(448 / 1920 * 90vw); /* ~21% viewport width */
  z-index: 3;
}

.layer-r-horse {
  bottom: 0;
  right: 0;
  width: calc(448 / 1920 * 90vw);
  z-index: 4;
}

/* Flower - z-index: 5 (center-bottom) */
.layer-flower {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(626 / 1920 * 90vw); /* ~29% viewport width */
  z-index: 5;
}

/* Foreground bamboos - z-index: 6-7 (in front of horses) */
.layer-fl-bamboos {
  bottom: 0;
  left: 0;
  width: calc(82 / 1920 * 90vw); /* ~4% viewport width */
  z-index: 6;
}

.layer-fr-bamboos {
  bottom: 0;
  right: 0;
  width: calc(82 / 1920 * 90vw);
  z-index: 7;
}

/* Clouds - z-index: 8-11 (above all foreground elements) */
.layer-ul-cloud {
  top: 0;
  left: 0;
  width: calc(1920 / 1920 * 90vw);
  z-index: 8;
}

.layer-ur-cloud {
  top: 0;
  right: 0;
  width: calc(1920 / 1920 * 90vw);
  z-index: 9;
}

.layer-bl-cloud {
  bottom: 0;
  left: 0;
  width: calc(1920 / 1920 * 90vw);
  z-index: 10;
}

.layer-br-cloud {
  bottom: 0;
  right: 0;
  width: calc(1920 / 1920 * 90vw);
  z-index: 11;
}

/* Glow - z-index: 12 (top center, above clouds) */
.layer-glow {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(1920 / 1920 * 90vw);
  z-index: 12;
}

/* Title - z-index: 13 (above glow) */
.layer-title {
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(500 / 1920 * 90vw);
  z-index: 13;
}

.outer-container {
  display: flex;
  height: 100vh;
}

.layout-container {
  display: flex;
  gap: 2%;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.left-div,
.right-div {
  /* height: 60%; */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 40px;
}

.left-div::before,
.right-div::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.1);
  filter: url(#noise);
  z-index: -1;
}

.left-div {
  width: 45%;
}

.right-div {
  width: 15%;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: 5%;
}

h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.upcoming-events {
  margin-top: 8px;
  overflow: hidden;
}

.upcoming-events h3 {
  font-size: 1.1em;
  color: #ffffff;
  margin-bottom: 16px;
  font-weight: 600;
}

.event-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.event-color-indicator {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.event-details {
  flex: 1;
}

.event-title {
  font-weight: 600;
  color: #f6f1f1;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.event-date {
  font-size: 0.85em;
  color: #ced1d6;
}

.event-description {
  font-size: 0.8em;
  color: #9ca3af;
  margin-top: 4px;
}

/* Calendar Grid Styling */
.calendar-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.calendar-header {
  text-align: center;
  margin-bottom: 8px;
}

.calendar-header h2 {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0px;
  flex: 1;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-cell {
  aspect-ratio: 1;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px;
  display: block;
}

.calendar-date {
  font-size: 0.7rem;
  font-weight: 400;
  color: #ffffff;
  opacity: 0.95;
  display: block;
  position: relative;
  z-index: 1;
}

.calendar-cell.calendar-previous-month .calendar-date,
.calendar-cell.calendar-next-month .calendar-date {
  color: rgba(255, 255, 255, 0.3);
}

/* Calendar Events */
.calendar-event {
  position: absolute;
  left: 3px;
  right: 0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: #1a1a1a;
  font-weight: 500;
  z-index: 10;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  min-height: 18px;
  background-color: var(--event-color, #FF6B6B);
}

/* Event types */
.event-start {
  left: 8px;
  right: -3px;
  border-radius: 4px 0 0 4px;
}

.event-middle {
  left: 0;
  right: -3px;
  border-radius: 0;
}

.event-end {
  left: 0;
  right: 8px;
  border-radius: 0 4px 4px 0;
}

.event-continue-start,
.event-continue-end {
  left: 0;
  right: -3px;
  border-radius: 0;
}

/* Event layers */
.event-layer-1 {
  top: 20px;
}

.event-layer-2 {
  top: 42px;
}

.event-layer-3 {
  top: 64px;
}

.event-layer-4 {
  top: 86px;
}

.calendar-event[data-span='2'] {
  right: calc(-100% - 4px);
}

.calendar-event[data-span='3'] {
  right: calc(-200% - 8px);
}

.calendar-event-text {
  display: block;
  padding: 1px 0;
}

/* Event stacking - fallback CSS in case multiple events in same cell */
.calendar-cell .calendar-event:nth-child(3) {
  top: 42px;
}

.calendar-cell .calendar-event:nth-child(4) {
  top: 64px;
}

.calendar-cell .calendar-event:nth-child(5) {
  top: 86px;
}

/* Error */
.error {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fee;
  color: #c33;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .left-div,
  .right-div {
    width: 90%;
    height: 40%;
  }

  h1 {
    font-size: 1.8rem;
  }

  /* Calendar mobile adjustments */
  .calendar-header h2 {
    font-size: 1.1rem;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-cell {
    padding: 3px;
  }

  .calendar-date {
    font-size: 0.7rem;
  }

  .calendar-day-header {
    font-size: 0.65rem;
  }
}
