
body {
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 600;
  font-size:x-large;
  margin: 0;
  padding: 0;
  background-color: #f4f4f9;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.back-page-btn {
  display: none;
}

h1, h2 {
  margin: 20px 0;
  font-size: 4vh;
  color: #2c3e50;
  padding: 1vh;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.day {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: 200px;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.day:hover {
  background: #e8f0fe;
  border-color: #a0c4ff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.day span {
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 10px;
  color: #2c3e50;
}

.day .requests {
  font-size: 0.9em;
  line-height: 1.5;
  flex-grow: 1;
  overflow-y: auto;
  width: 100%;
}

.day .requests div {
  margin: 5px 0;
  padding: 5px 8px;
  background: #dff9fb;
  color: #130f40;
  border: 1px solid #c7ecee;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day .requests div:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  background: #74b9ff;
  color: #fff;
}

.calendar-container {
  width: 95%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  background: #2c3e50;
  color: #ffffff;
  padding: 10px 0;
  border-radius: 8px 8px 0 0;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  max-width: 100%;
  padding: 20px;
  background: #ffffff;
  border-radius: 0 0 12px 12px;
}

.day .requests::-webkit-scrollbar {
  width: 8px;
}

.day .requests::-webkit-scrollbar-thumb {
  background: #a0c4ff;
  border-radius: 5px;
}

.day .requests::-webkit-scrollbar-thumb:hover {
  background: #74b9ff;
}

@media (max-width: 90%) {
  .calendar {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar::before {
    content: none;
  }
}

@media (min-width: 90%) and (max-width: 100%) {
  .calendar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dayHeader {
  font-size: 1.2em;
  text-align: center;
  display: flex; 
  align-items: center; 
  justify-content: center;
  background: #eaf1f4;
  color: #2c3e50;
  height: 50px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

/* Mobile Calendar */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  #calendar {
    display: flex;
    flex-direction: column;
    width: 95vw;
    gap: 0;
    max-width: 100%;
    margin: 0;
    padding: 5px;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    box-shadow: none;
  }

  /* Header and Navigation */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4f4f9;
    padding: 0px 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-header h2 {
    font-size: clamp(1.2rem, 3.5vw, 1.3rem);
    color: #2c3e50 !important;
    margin: 0;
  }

  .back-button {
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .back-icon {
    width: clamp(20px, 5vw, 28px);
    height: clamp(20px, 5vw, 28px);
    object-fit: contain;
  }

  /* Month View */
  .mobile-weekday {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    background: #f4f4f9;
    padding: 8px 0;
    border: 1px solid #ddd;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
  }

  .month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    border-radius: 8px;
  }

  .month-header h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 0;
  }

  .month-nav {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    background-color: transparent;
    cursor: pointer;
  }

  .prev-month {
    background-image: url('/pic/backbtn.png');
  }

  .next-month {
    background-image: url('/pic/forwardbtn.png');
  }

  .mobile-day-month.outside-month {
    background: #f0f0f0;
    color: #999;
    border: 1px solid #ddd;
    opacity: 0.8;
  }

  .mobile-month-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-day-month {
    padding: clamp(6px, 2vw, 10px);
    border: 1px solid #ddd;
    background: #f9f9f9;
    transition: background 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    min-width: 0; 
    min-height: 50px;
  }

  .day-num {
    font-size: clamp(1rem, 2.5vw, 1rem);
  }

  .mobile-day-month.today {
    background: #e0f7fa;
    border: 2px solid #74b9ff;
    border-radius: 6px;
  }

  .mobile-day-month.clickable {
    cursor: pointer;
  }

  .indicator {
    display: block;
    background: #6ab2ff;
    color: white;
    font-size: clamp(0.9rem, 1.8vw, 0.75rem);
    border-radius: 50%;
    padding: 2px 7px;
    margin: 4px auto 0;
    width: fit-content;
  }

  /* Week View */
  .mobile-week-grid {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    background: #f4f4f9;
    border: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-day-header {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .week-header {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 20px;
    margin: 10px 0;
    justify-content: space-between;
  }

  .week-header .week-range {
    margin: 0;
    font-size: 1em;
    text-align: center;
    flex: 0 0 auto;
  }

  .week-nav {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    touch-action: manipulation; /* prevent zoom */
  }

  .week-nav img {
    width: 100%;
    height: auto;
  }

  .mobile-day-week {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    border: 1px solid #ddd;
    flex: 1;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: clamp(1rem, 2.5vw, 1rem);
    padding:  6px 4px;
  }
  
  .mobile-day-week.selected {
    background: #e0f7fa;
    border: 2px solid #74b9ff;
    border-radius: 6px;
  }

  /* PTO List */
  .mobile-requests {
    flex-grow: 1;
    min-height: 45vh;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #f9f9f9;
    padding: 12px;
    border: 1px solid #ddd;
  }

  .pto-entry {
    padding: 10px;
    background: #e0f7fa;
    color: #2c3e50;
    border: 1px solid #c7ecee;
    border-radius: 5px;
    margin-bottom: 6px;
    font-size: clamp(1.2rem, 2.5vw, 0.95rem);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .no-pto {
    text-align: center;
    color: #666;
    flex-grow: 1;
    margin-top: 10px;
  }

  .top-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }

  .back-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f4f4f9;
  }

  .back-page-btn img {
    display: inline-flex;
    width: 30px;
    height: auto;
  }

  .week-nav,
  .back-page-btn {
    touch-action: none;            /* Stronger than 'manipulation' on iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }

  .week-nav img,
  .back-page-btn img {
    pointer-events: none;          /* Ensure the button, not the img, gets the tap */
  }

}