/* Theme and color schemes */
:root {
  box-sizing: border-box;
}

.app-tooltip {
  position: absolute;
  z-index: 9999;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--text-color-primary);
  color: var(--background-color);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

*, *:before, *:after {
  box-sizing: inherit;
}

:root {
  --background-color: #F2F2F2;
  --background-color-secondary: #FFFFFF;

  --popup-background: rgba(230, 230, 230, 0.5);

  /* Text colors */
  --text-color-primary: #1A1A1A;
  --text-color-secondary: #333333;
  --text-color-accent: #2a9e47;

  --accent-gradient: linear-gradient(135deg, #0d7a30, #2ecc5a);

  --shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1E1E1E;
    --background-color-secondary: #2A2A2A;

    --popup-background: rgba(100, 100, 100, 0.75);

    /* Text colors */
    --text-color-primary: #EAEAEA;
    --text-color-secondary: #CCCCCC;
    --text-color-accent: #3ce065;

    --accent-gradient: linear-gradient(135deg, #1fa840, #90ffb8);

    --shadow:
      0 1px 2px rgba(0, 0, 0, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.6);
  }
}

/* Base Styles */
html,
body {
  touch-action: manipulation;
}

html {
  height: 100%;

  overflow-x: hidden;
  overflow-y: auto;

  background-color: transparent;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;

  display: flex;
  flex-direction: column;

  background-color: var(--background-color);
  scroll-behavior: smooth;
  text-align: center;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Remove the tap highlight for mobile browsers */
  -webkit-tap-highlight-color: transparent;
}

.noscript-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: var(--background-color);

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ── Splash Screen ────────────────────────────────────────────── */
html:has(.splash-overlay) {
  overflow: hidden;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--background-color);
  transition: opacity 0.65s ease-out;
  pointer-events: none;
}

.splash-overlay.splash-hiding::before {
  opacity: 0;
}

.splash-logo {
  width: 10rem;
  height: 10rem;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  opacity: 0;
  scale: 0.75;
  animation: splash-logo-fade-in 0.5s ease-out 0.1s forwards;
}

@keyframes splash-logo-fade-in {
  to {
    opacity: 1;
    scale: 1;
  }
}

.splash-logo.splash-logo-flying {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-header-item {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-header-item.splash-revealed {
  opacity: 1;
}

.splash-loading-label {
  position: absolute;
  bottom: 3.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-color-secondary);
  opacity: 0;
  scale: 0.88;
  animation: splash-loading-appear 1s ease-out 3s forwards;
}

.splash-loading-label::after {
  content: '...';
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  width: 0;
  animation: splash-loading-dots 1.4s steps(4, end) 3s infinite;
}

@keyframes splash-loading-appear {
  to {
    opacity: 0.5;
    scale: 1;
  }
}

@keyframes splash-loading-dots {
  to { width: 1.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-logo {
    animation: none;
    opacity: 1;
  }

  .splash-logo.splash-logo-flying {
    transition: transform 0s;
  }

  .splash-loading-label,
  .splash-loading-label::after {
    animation: none;
  }
}

/* Generic HTML Elements */
h1 {
  font-size: 3rem;
  font-weight: bold;
  color: var(--text-color-primary);
}

h2 {
  font-size: 2.25rem;
  font-weight: bold;
  color: var(--text-color-primary);
}

h3 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color-primary);
}

h4 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-color-primary);
}

p {
  font-size: 1rem;
  color: var(--text-color-primary);
}

a {
  color: var(--text-color-accent);
}

.body-text {
  font-size: 1rem;
  color: var(--text-color-primary);
}

.body-small-text {
  font-size: 0.85rem;
  color: var(--text-color-primary);
}

.caption-text {
  font-size: 0.75rem;
  color: var(--text-color-primary);
}

label {
  font-size: 0.75rem;
  font-weight: medium;
  color: var(--text-color-primary);
}

.quote-text {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-color-primary);
}

.button-text {
  font-size: 0.8rem;
  font-weight: medium;
  color: var(--text-color-primary);
}

.transparent-button {
  background-color: transparent;
  border-color: transparent;

  cursor: pointer;
}

.secondary {
  color: color-mix(in srgb, var(--text-color-primary) 70%, transparent);
}

.info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;

  padding: 1rem 1.25rem;
  border-radius: 12px;

  background: color-mix(in srgb, #f5a623 15%, transparent);
  border: 1px solid color-mix(in srgb, #f5a623 30%, transparent);

  mix-blend-mode: multiply;

  width: fit-content;
  align-self: center;
  margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
  .info-box {
    mix-blend-mode: screen;
  }
}

.info-box-icon {
  margin: 0;
  font-size: 1.5rem;
}

.info-box-title {
  margin: 0;
  color: #d4820a;
  font-weight: bold;
}

@media (prefers-color-scheme: dark) {
  .info-box-title {
    color: #f5a623;
  }
}

.info-box-content {
  margin: 0;
  font-size: 0.9rem;
  color: color-mix(in srgb, #d4820a 80%, var(--text-color-primary));
  font-weight: 600;
}

/* --- Styles --- */

/* Header */
.header {
  padding-top: calc(env(safe-area-inset-top));

  display: flex;
  flex-direction: column;
  gap: 0;

  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  user-select: none;

  isolation: isolate;
}

.header-top-line-container {
  padding: 0 1rem;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  line-height: 2rem;

  background: var(--background-color);

  box-shadow: var(--shadow);
}

.header-title-container {
  display: flex;
  flex-direction: row;

  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.header-title-beta-container>h4 {
  margin: 0;
  padding: 0;

  line-height: 0;
}

.header-title-beta-container {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 0.2em;
}

.header-title {
  font-size: 2rem;
  font-weight: bold;

  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .header-title {
    mix-blend-mode: normal;
  }
}

.header-logo {
  height: 2rem;

  user-select: none;
  -webkit-user-drag: none;
}

.header-buttons-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.header-button {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: transparent;

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

  display: flex;
  align-items: center;
  justify-content: center;

  border-color: transparent;

  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px rgba(255, 255, 255, 0.1),
    var(--shadow);

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    scale 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);

  &:hover {
    background: color-mix(in srgb, var(--text-color-primary) 10%, transparent);
    scale: 1.1;
  }
}

.pulse-indicator {
  --pulse-color: var(--text-color-secondary);
}

.pulse-indicator.green {
  --pulse-color: var(--text-color-accent);
}

.pulse-indicator.yellow {
  --pulse-color: #f0b429;
}

.pulse-indicator.red {
  --pulse-color: #e53935;
}

.pulse-indicator {
  position: relative;
  width: 1rem;
  height: 1rem;
}

.pulse-indicator::before,
.pulse-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.pulse-indicator::before {
  width: 100%;
  height: 100%;
  background: var(--pulse-color);
  animation: pulse-dot 2s ease-out infinite;
}

.pulse-indicator::after {
  width: 100%;
  height: 100%;
  border: 2px solid var(--pulse-color);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }

  70% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  70% {
    transform: translate(-50%, -50%) scale(1.1);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.data-fetch-popover-container {
  display: flex;
  flex-direction: column;

  gap: 0;
}

.header-nav-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem 0.5rem;
}

.tabbar {
  position: relative;

  display: flex;

  background: #dddddd67;

  padding: 0.2rem;
  border-radius: 999px;
  width: calc((70% / var(--tabs)) - 4px);

  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px rgba(255, 255, 255, 0.1),
    var(--shadow);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  will-change: transform;
}

@media (max-width: 800px) {
  .tabbar {
    width: calc((120% / var(--tabs)) - 4px);
  }
}


/* Fallback for browsers that don't support backdrop-filter (Samsung Internet) */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar {
    background: rgba(220, 220, 220, 0.92);
    /* opaque enough to fake the frosted look */
  }

  @media (prefers-color-scheme: dark) {
    .tabbar {
      background: rgba(55, 55, 55, 0.96);
    }
  }
}

.tab {
  flex: 1;
  min-width: 0;
  overflow: hidden;

  border: none;
  background: none;

  padding: 8px 2px;

  font-size: 14px;
  font-weight: 500;

  border-radius: 999px;

  cursor: pointer;

  z-index: 1;

  color: #555;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  will-change: color;
}

.material-symbols-outlined {
  font-size: 22px !important;
}

.tab span:not(.material-symbols-outlined) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tab.active {
  color: var(--text-color-accent);

  font-weight: bold;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;

  width: calc((100% / var(--tabs)) - 4px);

  background: rgba(218, 218, 218, 0.821);
  border-radius: 999px;

  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.04);

  will-change: transform, width;
  transition:
    transform 0.28s cubic-bezier(.2, .8, .2, 1),
    width 0.28s cubic-bezier(.2, .8, .2, 1);

  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .tabbar {
    background: rgba(71, 71, 71, 0.294);
  }

  .tab {
    color: #AAA;
  }

  .tab-indicator {
    background: #5e5e5e70;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

@keyframes slide-in-top {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(-32px);
    scale: 0.75;
  }

  to {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
    scale: 1;
  }
}

/* Footer */
.footer {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;

  padding: 1rem;
}

.version-info-button>label {
  text-decoration: underline;
}

.info-label {
  text-align: end;
}

.slide-in-top {
  animation: slide-in-top 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tab content */
.body-container {
  padding-top: 1rem;

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

.tab-content {
  padding: 0 1rem;

  display: none;
}

.tab-content.visible {
  flex: 1;
  display: flex;
  flex-direction: column;

  animation: appear 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes appear {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95, 1);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1, 1);
  }
}

@keyframes disappear {
  from {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }

  to {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
  }
}

@keyframes i18n-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    filter: blur(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.i18n-animate {
  animation: i18n-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section-header {
  display: flex;
  flex-direction: column;

  justify-content: flex-start;
  text-align: start;

  padding: 1rem 0;
}

.section-header-title,
.section-header-subtitle,
.subsection-header-title,
.subsection-header-subtitle {
  margin: 0;
  padding: 0;
}

.section-header-title {
  font-size: 2rem;
  font-weight: bold;
}

.section-header-subtitle {
  font-size: 1.35rem;
}

@media (max-width: 600px) {
  .section-header-title {
    font-size: 1.75rem;
  }

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

.subsection-header-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.subsection-header-subtitle {
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .subsection-header-title {
    font-size: 1.25rem;
  }

  .subsection-header-subtitle {
    font-size: 0.75rem;
  }
}

.form {
  display: flex;
  flex-direction: column;

  text-align: center;
  justify-content: center;

  gap: 1rem;
}

.available-classroom-results {
  color: var(--text-color-primary);
}

/* ── Skeleton loading states ──────────────────────────────────── */

@keyframes skeleton-shimmer {
  from {
    background-position: 200% center;
  }

  to {
    background-position: -200% center;
  }
}

.campus-chips-skeleton,
.date-picker-skeleton,
.time-pickers-skeleton {
  display: none;
}

form[data-loading] .campus-chips-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.campus-section-sk {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.campus-label-sk {
  height: 0.9rem;
  border-radius: 4px;
}

.campus-section-sk:nth-child(1) .campus-label-sk {
  width: 3rem;
}

.campus-section-sk:nth-child(2) .campus-label-sk {
  width: 4rem;
}

.campus-row-sk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.campus-row-sk>div {
  height: 2.3rem;
  border-radius: 999px;
}

/* Milan row: Città Studi, Bovisa */
.campus-section-sk:nth-child(1) .campus-row-sk>div:nth-child(1) {
  width: 7rem;
}

.campus-section-sk:nth-child(1) .campus-row-sk>div:nth-child(2) {
  width: 4.5rem;
}

/* Other row: Cremona, Lecco, Mantova */
.campus-section-sk:nth-child(2) .campus-row-sk>div:nth-child(1) {
  width: 5.5rem;
}

.campus-section-sk:nth-child(2) .campus-row-sk>div:nth-child(2) {
  width: 4.5rem;
}

.campus-section-sk:nth-child(2) .campus-row-sk>div:nth-child(3) {
  width: 5.5rem;
}

form[data-loading] .date-picker-skeleton {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  margin-top: 2rem;
  align-self: center;
  background-color: var(--background-color-secondary);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px rgba(255, 255, 255, 0.1),
    var(--shadow);
}

form[data-loading] .date-picker-skeleton>div {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  flex-shrink: 0;
}

form[data-loading] .time-pickers-skeleton {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

form[data-loading] .time-pickers-skeleton>div {
  height: 3.9rem;
  border-radius: 18px;
  flex: 1;
}

@media (min-width: 52rem) {
  form[data-loading] .time-pickers-skeleton>div {
    flex: 0 0 17rem;
    height: 17rem;
  }
}

form[data-loading] .campus-label-sk,
form[data-loading] .campus-row-sk>div,
form[data-loading] .date-picker-skeleton>div,
form[data-loading] .time-pickers-skeleton>div {
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--text-color-primary) 6%, transparent) 25%,
      color-mix(in srgb, var(--text-color-primary) 12%, transparent) 50%,
      color-mix(in srgb, var(--text-color-primary) 6%, transparent) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s linear infinite;
}

ul li::marker {
  color: var(--text-color-accent);
}

.popover {
  position: absolute;
  z-index: 1000;

  max-width: 35%;
  word-wrap: break-word;

  padding: 12px 16px;

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

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 12px;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px rgba(255, 255, 255, 0.1),
    var(--shadow);

  opacity: 0;
  transform: scale(0);

  pointer-events: none;

  transition:
    opacity 120ms ease,
    transform 120ms ease;

  will-change: opacity, transform;
}

@media (max-width: 600px) {
  .popover {
    max-width: 60%;
  }
}

.popover[data-show] {
  opacity: 1;
  transform: scale(1);

  pointer-events: auto;
}

.arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
}

@supports (anchor-name: --a) {
  .popover {
    position: fixed;
    inset: auto;
    top: anchor(bottom);
    right: anchor(right);
    margin: 8px 0 0 0;
    position-try-fallbacks: --popover-above, flip-inline, --popover-above flip-inline;
    position-visibility: anchors-visible;
  }

  @position-try --popover-above {
    inset: auto;
    bottom: anchor(top);
    right: anchor(right);
    margin: 0 0 8px 0;
  }
}

.popover-title {
  font-size: 1.65rem;

  margin: 0;
  align-self: center;

  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .popover-title {
    mix-blend-mode: normal;
  }
}

.popover-title.green {
  background: linear-gradient(135deg, #0d7a30, #2ecc5a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popover-title.yellow {
  background: linear-gradient(135deg, #b07d00, #f0b429);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popover-title.red {
  background: linear-gradient(135deg, #a01010, #e53935);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popover-subtitle {
  font-size: 1.2rem;

  margin: 0 0 0.5rem 0;
}

.changelog-logo {
  height: 4rem;
  margin-bottom: 0.5rem;

  user-select: none;
  -webkit-user-drag: none;
}

.changelog-container {
  text-align: start;

  display: flex;
  flex-direction: column;
}

.popover ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;

  text-align: start;
}

.popover ul li {
  font-size: 0.9rem;
  color: var(--text-color-secondary);
  padding-left: 16px;
  position: relative;
}

.popover ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-color-secondary);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: center;

  padding: 0.6rem 1rem;
  margin: 0.5rem;

  background-color: rgba(30, 30, 30, 0.08);
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  color: #24292f;

  box-shadow: var(--shadow);

  transition: transform 0.2s ease, background-color 0.2s ease;
}

.hero-badge:hover {
  transform: scale(1.1);
  background-color: rgba(30, 30, 30, 0.15);
}

.hero-icon {
  width: 1.4rem;
  height: 1.4rem;
  color: #24292f;
}

.hero-text {
  font-size: 0.9rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .hero-badge {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .hero-badge:hover {
    background-color: rgba(255, 255, 255, 0.15);
  }

  .hero-icon {
    color: #fff;
  }
}

.button-primary {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;

  align-items: center;
  justify-content: center;

  font-size: 1rem;
  font-weight: bold;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  width: fit-content;
  align-self: center;

  padding: 0.5rem 1rem;

  border-radius: 999px;

  background-color: color-mix(in srgb, var(--text-color-accent) 28%, var(--background-color-secondary));
  border: 1.5px solid color-mix(in srgb, var(--text-color-accent) 45%, transparent);
  color: var(--text-color-accent);

  box-shadow:
    inset 1px 2px 0 rgba(255, 255, 255, 0.4),
    inset -1px -1px 0 rgba(255, 255, 255, 0.15),
    var(--shadow);

  transition:
    scale 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease;

  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
}

@media (hover: hover) {
  .button-primary:hover {
    scale: 1.05;
    background-color: color-mix(in srgb, var(--text-color-accent) 38%, var(--background-color-secondary));
    box-shadow:
      inset 1px 2px 0 rgba(255, 255, 255, 0.4),
      inset -1px -1px 0 rgba(255, 255, 255, 0.15),
      0 4px 20px color-mix(in srgb, var(--text-color-accent) 35%, transparent),
      var(--shadow);
  }
}

.button-primary:active {
  scale: 0.96;
  transition:
    scale 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

.button-primary:not(:active) {
  transition:
    scale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background-color 0.3s ease;
}

.button-primary.button-secondary {
  background: color-mix(in srgb, var(--text-color-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--text-color-accent) 25%, transparent);
  box-shadow: none;
}

@media (hover: hover) {
  .button-primary.button-secondary:hover {
    background: color-mix(in srgb, var(--text-color-accent) 20%, transparent);
    box-shadow: none;
  }
}

.button-secondary:active {
  scale: 0.93;
}

/* 
Variants for Samsung Internet,
since it doesn't support many features
in its compositor.
All fancy elements like blurs or blend modes
are rendered as solid colors
*/
.samsung .tabbar,
.samsung .popover,
.samsung .header-button {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--background-color-secondary);
}

.samsung .header-title,
.samsung .popover-title {
  mix-blend-mode: normal;
  -webkit-text-fill-color: unset;
  /* fallback to plain color */
  background: none;
  color: var(--text-color-accent);
}

.samsung .info-box {
  mix-blend-mode: normal;
}

.samsung .arrow {
  display: none;
  /* background: inherit is broken, just hide it */
}

/* ── Desktop two-column layout (Available screen) ── */
@media (min-width: 1100px) {
  .section-header-title {
    font-size: 1.75rem;
  }

  .section-header-subtitle {
    font-size: 1.1rem;
  }

  .subsection-header-title {
    font-size: 1.25rem;
  }

  .building-name {
    font-size: 1.5rem;
  }

  .classroom-name,
  .classroom-status-txt {
    font-size: 1.25rem;
  }

  #available-classrooms-container.visible {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 1.5rem;
    padding: 0 2rem;
  }

  #available-classrooms-container>.section-header {
    grid-column: 1;
    grid-row: 1;
  }

  #available-classrooms-form {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }

  #available-classrooms-results {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;

    position: sticky;
    top: calc(var(--header-height, 80px) + 1rem);

    max-height: calc(100dvh - var(--header-height, 80px) - 2rem);
    overflow-y: auto;

    margin: 1rem 0;
  }

  #available-classrooms-results.empty {
    position: static;
    align-self: stretch;
    max-height: none;
  }
}