/* ======== GLOBAL RESET ======== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f6f8;
  color: #2c3e50;
  padding: 20px;
}

/* ======== CALENDAR CONTAINER ======== */
.calendar-container {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  transition: all 0.3s ease;
}

.calendar-container:hover {
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.12);
}

/* ======== HEADER ======== */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.4em;
  font-weight: 500;
  color: #34495e;
  margin-bottom: 8px;
}

.header p {
  color: #7f8c8d;
  font-size: 1.1em;
}

/* ======== LOADING & ERROR ======== */
.loading {
  text-align: center;
  padding: 40px;
  color: #667eea;
  font-size: 1.2em;
}

.error {
  text-align: center;
  padding: 20px;
  background: #e74c3c;
  color: #fff;
  border-radius: 10px;
  display: none;
}

/* ======== NAVIGATION ======== */
.calendar-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.nav-btn {
  background: #667eea;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  background: #5a6fd8;
  transform: scale(1.1);
}

.current-period {
  font-weight: 600;
  font-size: 1.2em;
  color: #2c3e50;
  min-width: 300px;
  text-align: center;
}

/* ======== MONTH SELECTOR ======== */
.month-selector {
  text-align: center;
  margin-bottom: 25px;
}

#month-select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#month-select:focus {
  outline: none;
  border-color: #667eea;
}

/* ======== CALENDAR GRID ======== */
.calendar-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.month {
  background: #fafafa;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e8e8e8;
  transition: transform 0.25s ease;
}

.month:hover {
  transform: translateY(-4px);
}

.month h2 {
  text-align: center;
  color: #34495e;
  font-size: 1.3em;
  margin-bottom: 20px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

/* ======== DAY GRID ======== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-name {
  text-align: center;
  font-weight: 600;
  font-size: 0.85em;
  color: #2c3e50;
  text-transform: uppercase;
  background: #f1f3f5;
  border-radius: 6px;
  padding: 10px 0;
}

.day {
  height: 65px;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
  background: #fff;
  text-align: center;
  line-height: 65px;
  font-weight: 600;
  font-size: 1em;
  position: relative;
  cursor: default;
  transition: all 0.2s ease;
}

.day.empty {
  border: none;
  background: transparent;
  cursor: default;
}

/* ======== STATUS COLORS ======== */
.day.available {
  background: #e9f7ef;
  border-color: #2ecc71;
}

.day.occupied {
  background: #fdecea;
  border-color: #e74c3c;
}

.day.check-in {
  background: linear-gradient(135deg, #e9f7ef 50%, #fdecea 50%);
  border-color: #2ecc71;
}

.day.check-out {
  background: linear-gradient(135deg, #fdecea 50%, #e9f7ef 50%);
  border-color: #e74c3c;
}

/* ======== TOOLTIP ======== */
.tooltip {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: #fff;
  font-size: 0.75em;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}

.day:hover .tooltip {
  opacity: 1;
}

/* ======== LEGEND ======== */
.legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 35px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2c3e50;
  font-weight: 500;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid;
}

.legend-available {
  background: #e9f7ef;
  border-color: #2ecc71;
}

.legend-occupied {
  background: #fdecea;
  border-color: #e74c3c;
}

.legend-check-in {
  background: linear-gradient(135deg, #e9f7ef 50%, #fdecea 50%);
  border-color: #2ecc71;
}

.legend-check-out {
  background: linear-gradient(135deg, #fdecea 50%, #e9f7ef 50%);
  border-color: #e74c3c;
}

/* ======== RESPONSIVE ======== */
@media (max-width: 992px) {
  .calendar-wrapper {
    grid-template-columns: 1fr;
  }

  .month {
    padding: 15px;
  }

  .day {
    height: 55px;
    line-height: 55px;
  }

  .header h1 {
    font-size: 2em;
  }

  .legend {
    flex-wrap: wrap;
    gap: 20px;
  }
}

@media (max-width: 576px) {
  .calendar-container {
    padding: 20px;
  }

  .day {
    height: 45px;
    line-height: 45px;
    font-size: 0.9em;
  }

  .day-name {
    padding: 6px 0;
    font-size: 0.75em;
  }

  .current-period {
    font-size: 1em;
    min-width: 220px;
  }
}
