/*
  Simple Availability Calendar - Modern Redesign
  Inspired by the user's request for a minimalist, airy, and modern aesthetic.
*/

/* --- General Calendar Container --- */
.sac-calendar {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 2em auto;
  max-width: 900px; /* Allow for wider layout */
}

/* --- Calendar Header (Month/Year Navigation) --- */
.sac-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  width: 100%;
}

.sac-nav span {
  font-size: 2em; /* Large title */
  font-weight: 700;
  color: #222;
  flex-grow: 1;
  text-align: center;
  text-transform: uppercase; /* Uppercase the date title */
}

.sac-nav a {
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 600;
  color: #555;
  transition: color 0.2s ease;
}

.sac-nav a:hover {
  color: #000;
}

/* --- Room Title --- */
.sac-calendar h3 {
  text-align: center;
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 1em;
  color: #333;
}

/* --- Main Calendar Table --- */
.sac-calendar table {
  width: 100%;
  border-collapse: collapse; /* Use collapse for cleaner lines */
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07); /* Keep the shadow, but make it softer */
  overflow: hidden; /* Important for border-radius */
  border-style: hidden; /* Hide the border created by border-collapse */
}

/* --- Day of Week Headers (TH) --- */
.sac-calendar th {
  font-weight: 500;
  font-size: 0.9em;
  color: #666;
  padding: 1em 0;
  background: none;
  border-bottom: 1px solid #eaeaea; /* Thin line under days of week */
}

/* --- Day Cells (TD) --- */
.sac-calendar td {
  text-align: center;
  vertical-align: top;
  border: 1px solid #eaeaea; /* Thin lines for the grid */
  height: 100px; /* Taller cells for an airy feel */
  padding: 0;
  background: none;
}

/* Remove outer borders */
.sac-calendar td:first-child,
.sac-calendar th:first-child {
  border-left: none;
}
.sac-calendar td:last-child,
.sac-calendar th:last-child {
  border-right: none;
}
.sac-calendar tr:last-child td {
  border-bottom: none;
}

/* --- Day Cell Content --- */
.sac-calendar .sac-day-cell {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 8px;
  box-sizing: border-box;
}

.sac-calendar .sac-day-cell.grayed {
  background-color: #fcfcfc;
}

.sac-calendar .sac-day-cell.grayed .sac-day-number {
  color: #ccc;
}

.sac-calendar .sac-day-cell.today {
  background-color: #f0f8ff;
}

.sac-calendar .sac-day-cell.today .sac-day-number {
  background-color: #007bff;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  line-height: 28px;
  display: inline-block;
  text-align: center;
  margin-left: -4px; /* Adjust for centering */
}

/* --- Day Number --- */
.sac-calendar .sac-day-number {
  font-size: 0.9em;
  font-weight: 500;
  color: #333;
  text-align: left;
  margin-bottom: 8px;
}

/* --- Slot Grid & Dots --- */
.sac-calendar .sac-slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
}

.sac-calendar .sac-slot-mini {
  /* Style as a small block with text */
  font-size: 9px; /* Very small font */
  font-weight: 700;
  text-transform: uppercase; /* Uppercase text */
  border-radius: 3px;
  padding: 4px 2px;
  line-height: 1;
  text-align: center;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

/* Slot Status Colors */
.sac-calendar .sac-slot-mini.available {
  background-color: #e8f5e9; /* Lighter Green */
  color: #388e3c;
  border: 1px solid #c8e6c9;
}

.sac-calendar .sac-slot-mini.pending {
  background-color: #fff8e1; /* Lighter Yellow */
  color: #f57c00;
  border: 1px solid #ffecb3;
}

.sac-calendar .sac-slot-mini.unavailable {
  background-color: #ffebee; /* Lighter Red */
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

.sac-calendar .sac-slots span.not-available:hover {
  background-color: #ffebee; /* A very light red for unavailable slots on hover */
}

/* Navigation Form Styles */
.sac-nav-form-container {
  text-align: left; /* Align dropdowns to the left */
  margin-bottom: 10px; /* Space below dropdowns, above title */
  margin: 0 auto;
  margin-top: 1em;
}

.sac-nav-form {
  display: flex; /* Use flex to align items in a row */
  align-items: center; /* Vertically align items in the middle */
  gap: 10px; /* Add space between the dropdowns */
  /* Removed inline-flex as the container is now block and text-align:left handles positioning */
}

.sac-nav-form select {
  padding: 5px 30px 5px 10px; /* Adjust right padding for FA icon */
  border: 1px solid #ccc;
  border-radius: 4px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative; /* Needed for absolute positioning of pseudo-element */
  background-color: #fff; /* Ensure select background is opaque */
}

.sac-today-button {
  text-decoration: none;
  color: #0073aa; /* A standard WordPress link color */
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f7f7f7;
  white-space: nowrap; /* Prevent the button text from wrapping */
}

.sac-today-button:hover {
  background-color: #f0f0f0;
  border-color: #999;
}
