/* === CALENDAR: Layout and Wrapper === */
.calendar-wrapper {
  max-width: 100%;
  width: calc(100% - var(--sidebar-width) - var(--right-sidebar-width) - 40px);
  margin-left: calc(var(--sidebar-width) + 20px);
  margin-right: calc(var(--right-sidebar-width) + 20px);
  margin-top: 30px;
  margin-bottom: 15px;
  background-color: white;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
  overflow-x: auto;
}

/* === CALENDAR: Header === */
.calendar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.calendar-header h1 {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
}

/* === CALENDAR: Filter Bar === */
.calendar-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 20px;
  background-color: #f7f7f7;
  border-radius: 8px;
  position: sticky;
  top: 70px;
  z-index: 100;
}

.filter-tab {
  position: relative;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 14px;
}

.filter-tab a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.filter-tab.active {
  background-color: #d0d0d0;
  font-weight: bold;
}

.filter-tab:hover {
  background-color: #e0e0e0;
}

/* === CALENDAR: Shared Table Base === */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto; /* ✅ allow natural column width */
}

.calendar-table th {
  resize: horizontal;
  background-color: #f5f5f5;
  font-weight: bold;
  color: #333;
  text-align: left;
  white-space: nowrap; /* ✅ keep headers single-line */
}

.calendar-table td {
  color: #333;
  background-color: white;
  text-align: left;
  white-space: nowrap; /* ✅ keep content in-line */
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-table th,
.calendar-table td {
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}

.calendar-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.calendar-table tr.calendar-parent-row {
  height: auto; /* ✅ allow full height */
}

.calendar-table .toggle-icon {
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  width: 24px;
  color: #333;
}

.calendar-table td.toggle-icon {
  min-width: 24px;
  width: 24px;
  text-align: center;
  vertical-align: middle;
}

/* ✅ Prevent compression on important content (e.g. Event title, Instrument) */
.calendar-table th:nth-child(5),
.calendar-table td:nth-child(5),
.calendar-table th:nth-child(6),
.calendar-table td:nth-child(6) {
  min-width: 150px;
}


/* === CALENDAR: Matrix View === */
.auction-matrix-scroll-wrapper {
  overflow-x: auto;
  padding: 10px;
}

.auction-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* Locks widths */
}

/* All cells: default formatting */
.auction-matrix-table th,
.auction-matrix-table td {
  border: 1px solid #ccc;
  padding: 4px 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* First column: Label/Metric */
.auction-matrix-table th:first-child,
.auction-matrix-table td:first-child {
  text-align: left;
  font-weight: 600;
  background-color: #f5f5f5;

  min-width: 200px;
  max-width: 220px;
  width: 220px;

  overflow: visible;
  text-overflow: unset;
}

/* All other columns (date/value) */
.auction-matrix-table th:not(:first-child),
.auction-matrix-table td:not(:first-child) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  text-align: right;
}

/* CED Identifier Column */
.auction-matrix-table td:nth-child(2),
.auction-matrix-table th:nth-child(2) {
  text-align: left;  /* Left align CED Identifier */
}

/* Header row style */
.auction-matrix-table th {
  background-color: #f0f0f0;
  font-weight: bold;
}

/* Alternating row shading */
.auction-matrix-table tr:nth-child(even) td {
  background-color: #f9f9f9;
}

/* === CALENDAR: Scroll Container === */
.calendar-scroll-container {
  overflow-y: auto;
  flex-grow: 1;
  padding: 20px;
  max-height: calc(100vh - var(--header-height) - var(--subheader-height) - 150px);
}

/* Highlight Today row */
.highlight-today {
  background-color: #fff4d6 !important;
  font-weight: bold;
}

/* === Responsive Styles === */
@media (max-width: 1024px) {
  .calendar-wrapper {
    width: calc(100% - 40px);
    margin: 20px auto;
  }

  .calendar-filter-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 10px;
  }

  .calendar-table {
    font-size: 13px;
  }

  .auction-matrix-table td,
  .auction-matrix-table th {
    font-size: 13px;
    padding: 3px 6px;
  }

  .auction-matrix-table td:first-child,
  .auction-matrix-table th:first-child {
    min-width: 200px;
    max-width: 240px;
    width: 240px;
  }

  .auction-matrix-table td:not(:first-child),
  .auction-matrix-table th:not(:first-child) {
    min-width: 90px;
    max-width: 100px;
  }
}

@media (max-width: 768px) {
  .calendar-table th,
  .calendar-table td {
    padding: 4px 6px;
    font-size: 12px;
  }

  .filter-tab {
    font-size: 13px;
    padding: 4px 8px;
  }

  .dropdown-menu {
    min-width: 100px;
  }
}

/* === Parent Row Alignment (Right-align specific columns) === */
body[data-calendar-category="auctions"] .calendar-table th:nth-child(7),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(8),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(9),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(10),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(11),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(12),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(13),
body[data-calendar-category="auctions"] .calendar-table th:nth-child(14),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(7),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(8),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(9),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(10),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(11),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(12),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(13),
body[data-calendar-category="auctions"] .calendar-table td:nth-child(14) {
  text-align: right; /* Right-align both the labels and the data */
}

