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

body {
  font-family: 'Arial', sans-serif;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
}

/* Common Container */
.calendar-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 20px;
}

/* Typography */
h1 {
  font-size: 28px;
  color: #4caf50;
}

h2 {
  font-size: 24px;
  font-weight: normal;
  color: #333;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

/* Navigation Button */
.nav-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* Calendar Layout */
.month-year {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-body {
  margin-top: 20px;
}

/* Calendar Table */
table.calendar {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

th {
  background-color: #4caf50;
  color: white;
  padding: 10px;
  font-weight: bold;
}

/* Table Cells */
td {
  width: 120px;
  height: 120px;
  border: 1px solid #ddd;
  position: relative;
  vertical-align: middle;
  padding: 25px 0; /* Create space for header and footer */
}

/* Cell Content */
td .cell-content,
td .holiday-description {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

td .cell-content {
  font-size: 32px;
  font-weight: bold;
  z-index: 1;
}

td .holiday-description {
  font-size: 12px;
  color: black;
  z-index: 2;
  white-space: nowrap;
  text-shadow:
    -1px -1px 2px white,
    1px -1px 2px white,
    -1px 1px 2px white,
    1px 1px 2px white;
}

/* Holiday Date Color */
td.holiday .cell-content {
  color: red;
}

/* Header and Footer Styles */
td .cell-header,
td .cell-footer {
  font-size: 10px;
  width: calc(100% - 10px);
  display: flex;
  justify-content: space-between;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

td .cell-header {
  top: 5px;
}

td .cell-footer {
  bottom: 5px;
}

.cell-header div,
.cell-footer div {
  flex: 1;
  text-align: center;
}

/* Responsive Styles */

/* For Medium Screens (Tablets) */
@media (max-width: 768px) {
  td {
    width: 90px;
    height: 100px;
    padding: 20px 0; /* Adjust padding for header and footer */
  }

  td .cell-content {
    font-size: 24px;
  }

  td .holiday-description {
    font-size: 10px;
  }

  td .cell-header,
  td .cell-footer {
    font-size: 9px;
  }

  th {
    padding: 8px;
    font-size: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .nav-button {
    font-size: 20px;
  }
}

/* For Small Screens (Phones) */
@media (max-width: 480px) {
  td {
    width: 60px;
    height: 90px;
    padding: 15px 0; /* Adjust padding for header and footer */
  }

  td .cell-content {
    font-size: 20px;
  }

  td .holiday-description {
    font-size: 9px;
    top: 45%; /* Slightly adjust the position */
  }

  td .cell-header,
  td .cell-footer {
    font-size: 8px;
    flex-direction: column;
    align-items: center;
  }

  td .cell-header {
    top: 2px;
  }

  td .cell-footer {
    bottom: 2px;
  }

  .cell-header div,
  .cell-footer div {
    width: 100%;
    padding: 2px 0;
    border-bottom: 1px solid #ddd;
  }

  .cell-header div:last-child,
  .cell-footer div:last-child {
    border-bottom: none;
  }

  th {
    padding: 6px;
    font-size: 12px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  .nav-button {
    font-size: 18px;
  }
}

.hidden {
  display: none;
}

#calendar-month {
  display: inline-flex;
  gap: 5px;
  cursor: pointer;
  align-items: center;
}

#calendar-month select {
  font-size: 1rem;
  margin-left: 5px;
}
