body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f3f5f8;
  color: #222;
  -webkit-tap-highlight-color: transparent;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header-left {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4caf50;
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.page-description {
  margin: 12px 0 0;
  max-width: 640px;
  color: #555;
  line-height: 1.6;
}

.user-actions {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.user-info {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  background: #333;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.1s ease;
}

.logout-button:hover {
  background: #222;
}

.logout-button:active {
  background: #111;
  transform: scale(0.98);
}

.page-content {
  display: grid;
  gap: 20px;
}

.section-card {
  background: white;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.calendar-wrapper {
  margin-bottom: 16px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 1rem;
}

.calendar-header button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.calendar-header button:hover {
  background: #f5f7fa;
}

.calendar-header button:active {
  background: #e8ecf1;
  transform: scale(0.97);
}

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

.calendar-weekdays div {
  font-weight: 700;
  text-align: center;
  font-size: 0.8rem;
  color: #555;
}

.calendar-cell {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #e3e7ed;
  background: #fbfcfd;
  color: #202124;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 0.95rem;
}

.calendar-cell.available-day {
  background: #e7f5ea;
  cursor: pointer;
}

.calendar-cell.available-day:not(.selected-day):hover {
  background: #d2ebd4;
  transform: translateY(-1px);
}

.calendar-cell.available-day:not(.selected-day):active {
  background: #c0e6c2;
  transform: scale(0.95);
}

.calendar-cell.selected-day {
  background: #4caf50;
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.25);
}

.calendar-cell.disabled-day {
  color: #b1b7bd;
  background: #f1f4f7;
  cursor: not-allowed;
}

.calendar-cell.booked-day {
  border-left: 6px solid #f9d966;
}

.calendar-cell.full-day {
  border-right: 6px solid #f44336;
}

.calendar-cell.selected-day.booked-day {
  box-shadow: inset 6px 0 0 rgba(255, 235, 59, 0.24);
}

.calendar-cell.selected-day.full-day {
  box-shadow: inset -6px 0 0 rgba(244, 67, 54, 0.24);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.legend-item {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease, filter 0.2s ease;
}

.legend-item.available { background: #4caf50; color: white; }
.legend-item.booked { background: #ffeb3b; color: #222; }
.legend-item.full { background: #f44336; color: white; }

.legend-item:hover {
  filter: brightness(0.9);
}

.legend-item.active {
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.legend-item:active {
  transform: scale(0.95);
}

#slot-details {
  width: 100%;
}

#selected-date-title {
  margin: 0 0 14px;
  font-size: 1rem;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.slot-button {
  padding: 10px 12px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.slot-time {
  font-weight: 500;
  font-size: 0.9rem;
}

.slot-avatars {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.slot-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.slot-button.available {
  background-color: #4CAF50;
  color: white;
}

.slot-button.available:active {
  background-color: #3d8b40;
  transform: scale(0.97);
}

.slot-button.booked {
  background-color: #ffeb3b;
  color: #1f1f1f;
}

.slot-button.booked:active {
  background-color: #fde92f;
  transform: scale(0.97);
}

.slot-button.user-booked {
  background-color: #ffeb3b;
  color: #1f1f1f;
  font-weight: 700;
  cursor: alias;
}

.slot-button.user-booked:active {
  background-color: #fde92f;
  transform: scale(0.97);
}

.slot-button.full {
  background-color: #f44336;
  color: white;
  cursor: not-allowed;
}

.slot-button.full:active {
  background-color: #f44336;
  transform: scale(0.97);
}

.slot-button.fullWithMe { 
  background-color: #f44336;
  color: white;
  cursor: alias;
  font-weight: bold;
}

.slot-button.fullWithMe:active {
  background-color: #da190b;
  transform: scale(0.97);
}

.slot-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.empty-state {
  padding: 18px;
  color: #666;
  background: #fafafa;
  border-radius: 14px;
  text-align: center;
}

.price-info {
  margin: 12px 0 20px;
  color: #555;
  font-size: 0.95rem;
}

/* Tablet (768px - 899px) */
@media (min-width: 768px) and (max-width: 899px) {
  .page-header {
    flex-direction: column;
  }

  .page-content {
    grid-template-columns: 1fr;
  }

  .user-actions {
    text-align: left;
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Desktop (900px+) */
@media (min-width: 900px) {
  .page-content {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }

  .calendar-panel {
    max-height: none;
  }
}

/* Mobile (up to 479px) */
@media (max-width: 479px) {
  body {
    padding: 12px;
  }

  .page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .page-header-left {
    flex: 1;
    min-width: 0;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .user-actions {
    padding: 0;
    text-align: right;
    flex-direction: row;
    gap: 0;
    z-index: auto;
  }

  .user-info {
    display: none;
  }

  .logout-button {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .page-content {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 14px;
    border-radius: 14px;
  }

  .calendar-weekdays,
  .calendar {
    gap: 3px;
  }

  .calendar-cell {
    min-height: 32px;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .calendar-header button {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  .slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .slot-button {
    min-height: 60px;
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .legend {
    gap: 8px;
    margin-top: 8px;
  }

  .legend-item {
    padding: 6px 10px;
    font-size: 0.75rem;
    flex: 1;
    text-align: center;
  }

  #selected-date-title {
    font-size: 0.95rem;
    margin-bottom: 10px;
  }

  .price-info {
    font-size: 0.9rem;
    margin: 10px 0 16px;
  }

  .eyebrow {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }

  .page-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 8px;
  }
}

/* Small Mobile (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
  body {
    padding: 14px;
  }

  .page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .page-header-left {
    flex: 1;
    min-width: 0;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .user-actions {
    padding: 0;
    text-align: right;
    flex-direction: row;
    gap: 0;
    z-index: auto;
  }

  .user-info {
    display: none;
  }

  .logout-button {
    align-self: auto;
  }

  .page-content {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 16px;
  }

  .calendar-cell {
    min-height: 36px;
    font-size: 0.8rem;
  }

  .slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
  }

  .slot-button {
    min-height: 65px;
    font-size: 0.92rem;
  }

  .legend-item {
    padding: 6px 11px;
    font-size: 0.8rem;
  }
}

/* Medium Mobile / Small Tablet (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
  body {
    padding: 16px;
  }

  .page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-header-left {
    flex: 1;
    min-width: 0;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .user-actions {
    padding: 0;
    text-align: right;
    flex-direction: row;
    gap: 0;
    z-index: auto;
  }

  .user-info {
    display: none;
  }

  .logout-button {
    align-self: auto;
  }

  .page-content {
    grid-template-columns: 1fr;
  }

  .slots-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .slot-button {
    min-height: 70px;
    font-size: 0.93rem;
  }
}