.available-classrooms-container {
  margin: 0.5rem 0;
  padding: 0.5rem;

  background-color: var(--background-color-secondary);
  border: 4px solid var(--background-color-secondary);

  border-radius: 1.5rem;

  display: flex;
  flex-direction: column;

  justify-content: space-evenly;
}

.results-filter-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  padding: 0.25rem 0.5rem 0;
  gap: 1rem;
}

.results-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;

  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--text-color-accent) 40%, transparent);
  background: color-mix(in srgb, var(--text-color-accent) 15%, transparent);
  color: var(--text-color-accent);

  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;

  transition: background 0.2s ease, opacity 0.2s ease;
}

.results-filter-btn:not(.active) {
  background: transparent;
  opacity: 0.45;
}

.results-filter-btn .material-symbols-outlined {
  font-size: 1rem !important;
}

.available-classrooms-container.hide-partial [data-status="partially-free"] {
  display: none;
}

.available-classrooms-container.empty {
  flex: 1;
  padding: 4rem 0;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.empty-container-icon {
  color: var(--text-color-secondary);
  opacity: 0.75;

  font-size: 7rem !important;
}

.empty-container-title {
  font-size: 1.5rem;
  font-weight: 700;

  color: var(--text-color-secondary);
  opacity: 0.75;

  margin: 0;
}

.empty-container-subtitle {
  font-size: 0.9rem;
  font-weight: 630;

  color: var(--text-color-secondary);
  opacity: 0.60;

  margin: 0 3rem;
}

.list-outer-container {
  list-style: none;
  margin: 0;
  padding: 0.25rem;

  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-inner-container {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.5rem;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.building-card {
  background-color: var(--background-color);
  border-radius: 1.5rem;
  padding: 0.75rem;
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  
  animation: card-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.building-card-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--text-color-primary) 8%, transparent);
  cursor: pointer;
  user-select: none;
}

.building-card.collapsed .building-card-header {
  border-bottom-color: transparent;
  padding-bottom: 0.25rem;
}

.building-card.collapsed {
  gap: 0;
  cursor: pointer;
}

.building-card-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: start;
}

.building-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.building-alt-name {
  font-size: 0.75em;
  font-weight: 600;
  color: color-mix(in srgb, var(--text-color-primary) 50%, transparent);
  margin-left: 0.15rem;
}

.building-counts {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.building-count {
  font-size: 0.75rem;
  font-weight: 700;
}

.building-count.free          { color: var(--text-color-accent); }
.building-count.partially-free { color: #f0b429; }
.building-count.not-free       { color: #e53935; }

.building-count-sep {
  font-size: 0.65rem;
  color: color-mix(in srgb, var(--text-color-primary) 25%, transparent);
}

.building-chevron {
  color: color-mix(in srgb, var(--text-color-primary) 45%, transparent);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  transform: rotate(-180deg);
}

.building-card.collapsed .building-chevron {
  transform: rotate(0deg);
}

.building-card-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.building-card.collapsed .building-card-body {
  grid-template-rows: 0fr;
}

.building-card-body > .list-inner-container {
  overflow: hidden;
  min-height: 0;
}

.classroom-list-item-container {
  padding: 1rem;

  border-radius: 1rem;

  background-color: var(--background-color-secondary);

  box-shadow: var(--shadow);

  animation: card-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: scale 0.15s ease;

  &:hover {
    scale: 1.025;
  }
}

/* Prevent re-triggering the staggered animation after the first load */
.list-outer-container.appeared .classroom-list-item-container,
.list-outer-container.appeared > li,
.list-outer-container.appeared .building-card {
  animation: none !important;
}

/* Also disable the parent tab-content animation if it has appeared once */
:has(> .list-outer-container.appeared) {
  animation: none !important;
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.classroom-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: start;

  cursor: pointer;
  padding: 1rem;
  margin: -1rem; /* Offset the container padding to fill it completely */
  border-radius: 1rem;
  transition: background-color 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  
   contain: layout paint style;
}

.classroom-card:hover {
  background-color: color-mix(in srgb, var(--text-color-primary) 5%, transparent);
}

.classroom-card:hover .classroom-detail-btn {
  color: var(--text-color-accent);
  transform: translateX(4px);
}

.classroom-card-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.classroom-card-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.classroom-detail-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-color-secondary);
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.classroom-detail-btn .material-symbols-outlined {
  font-size: 1.5rem !important;
}

.classroom-features {
  display: flex;
  flex-direction: row;
  gap: 0.1rem;
  flex-shrink: 0;
}

.classroom-feature-icon {
  font-size: 1.1rem !important;
  color: color-mix(in srgb, var(--text-color-primary) 40%, transparent);
}

.classroom-name {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: start;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.classroom-status-txt {
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.classroom-status-txt.free {
  color: var(--text-color-accent);
}

.classroom-status-txt.free-soon {
  color: #a6ce39; /* Yellow-green */
}

.classroom-status-txt.partially-free,
.classroom-status-txt.occupied-soon {
  color: #f0b429; /* Yellow/Orange */
}

.classroom-status-txt.not-free,
.classroom-status-txt.occupied {
  color: #e53935; /* Red */
}

.classroom-timeline {
  padding: 1rem;
  
  contain: layout paint;
}

.timeline-bar-wrapper {
  position: relative;
  padding-top: 2rem;
}

.timeline-time-indicator {
  position: absolute;
  top: 0;
  transform: translateX(-50%);

  background: var(--text-color-accent);
  color: white;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--text-color-accent) 40%, transparent);

  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .timeline-time-indicator:not(.timeline-time-indicator--now) {
    /* Use a slightly darker/more saturated green for better white text contrast on dark background */
    background: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
  }
}

.timeline-time-indicator::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text-color-accent);
}

@media (prefers-color-scheme: dark) {
  .timeline-time-indicator:not(.timeline-time-indicator--now)::after {
    border-top-color: #28a745;
  }
}

.timeline-time-indicator--now {
  background: #2196F3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);

  opacity: 0;
  transform-origin: bottom center;
  animation: today-indicator-appear 0.65s linear 0.35s forwards;
}

.timeline-time-indicator--now::after {
  border-top-color: #2196F3;
}

.timeline-bar {
  position: relative;
  height: 2.5rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text-color-primary) 10%, transparent);
  overflow: hidden;
}

.timeline-query-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--text-color-accent) 22%, transparent);
}

.timeline-block {
  position: absolute;
  top: 0;
  bottom: 0;
}

.timeline-block--busy {
  background: color-mix(in srgb, #e53935 70%, transparent);
}

.timeline-block--context {
  background: color-mix(in srgb, var(--text-color-primary) 22%, transparent);
}

.timeline-bar-wrapper .timeline-hover-cursor {
  position: absolute;
  top: 0;
  transform: translateX(-50%);

  background: var(--background-color);
  color: var(--text-color-primary);
  border: 1px solid color-mix(in srgb, var(--text-color-primary) 18%, transparent);
  border-radius: 0.5rem;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: var(--shadow);

  pointer-events: none;
  user-select: none;
  z-index: 10;
}

/* Border triangle (1px larger, in border color, sits behind the fill triangle) */
.timeline-bar-wrapper .timeline-hover-cursor::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: color-mix(in srgb, var(--text-color-primary) 18%, transparent);
}

/* Fill triangle (covers the border triangle except the bottom tip) */
.timeline-bar-wrapper .timeline-hover-cursor::after {
  content: '';
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--background-color);
}

.timeline-bar .timeline-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--text-color-primary) 35%, transparent);
  pointer-events: none;
  z-index: 5;
}

.timeline-ticks {
  position: relative;
  height: 1.2rem;
  margin-top: 0.2rem;
}

.timeline-tick-label {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  user-select: none;
}

.timeline-tick-label::before {
  content: '';
  display: block;
  width: 1px;
  height: 3px;
  background: color-mix(in srgb, var(--text-color-primary) 35%, transparent);
}

.timeline-tick-label span {
  font-size: 0.62rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--text-color-primary) 50%, transparent);
  white-space: nowrap;
}

.classroom-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.classroom-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;

  padding: 0.2rem 0.6rem;
  border-radius: 999px;

  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-color-accent);

  background: color-mix(in srgb, var(--text-color-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-color-accent) 30%, transparent);
}

.classroom-slot-icon {
  font-size: 0.95rem !important;
}