/* Sky Text Regular */
@font-face {
  src: url('/fonts/Sky-Regular.woff2') format('woff2');
  font-family: 'Sky-Regular';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Sky Text Headline */
@font-face {
  src: url('/fonts/Sky-Headline.woff2') format('woff2');
  font-family: 'Sky-Headline';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'Sky-Regular', sans-serif;
}

.no-select {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body.view-mode .view-mode-hide {
  display: none !important;
}

/* Loading spinner — centered in the area below the 64px navbar */
#loadingSpinner {
  display: none;
  position: absolute;
  top: calc(64px + 200px);
  left: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#loadingSpinner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 200%;
  z-index: -1;
  border-radius: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.15);
  border-top: 5px solid #78716c; /* stone-500 */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top: 2px solid #78716c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

iframe {
  background-color: #28333a;
}

.side_bar_elements_active {
  opacity: 1;
  pointer-events: auto;
}

.side_bar_elements_inactive {
  opacity: 0.5;
  pointer-events: none;
}

/* Notifications */
#notificationContainer {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notification {
  padding: 10px 16px;
  border-radius: 2px;
  font-size: 0.8125rem;
  font-family: 'Sky-Regular', sans-serif;
  max-width: 340px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
}

.notification-visible {
  opacity: 1;
  transform: translateX(0);
}

.notification-error {
  background-color: #dc2626;
  color: #fff;
}

.notification-info {
  background-color: #44403c;
  color: #f5f5f4;
}

.notification-success {
  background-color: #16a34a;
  color: #fff;
}

/* Row tags — mirrors content-data-tag from ol-creative */
.content-data-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(250 250 249);
  background-color: var(--stone-button);
  user-select: none;
}
.content-data-tag > span:first-child {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  flex: 1;
  padding-block: 0.25rem;
  padding-left: 0.625rem;
  padding-right: 0.5rem;
  border-radius: 2px 0 0 2px;
  cursor: pointer;
  transition: background-color 200ms;
}
.content-data-tag > span:first-child:hover {
  background-color: var(--stone-button-hover);
}
.tag-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 1.25rem;
  background-color: var(--stone-button);
  border: 0;
  border-left: 1px solid #f5f5f4;
  border-radius: 0 2px 2px 0;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  transition: background-color 200ms;
}
.tag-remove-btn:hover {
  background-color: var(--stone-button-hover);
}

/* Row sections — one per loaded sheet row */
.row-section {
  width: 100%;
  margin-bottom: 2rem;
}
.row-section-header {
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-text-muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stone-frame-border);
  margin-bottom: 1rem;
  text-align: center;
}
.row-section-frames {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  align-content: flex-start;
}

/* Size filter — chips built by sizeFilter.view.js */
#size_filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.size-filter-label {
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--stone-text-muted);
  margin-right: 0.25rem;
}
.size-filter-chip {
  height: 1.75rem;
  padding-inline: 0.625rem;
  border: 1px solid var(--stone-input-border);
  border-radius: 2px;
  background-color: transparent;
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.8125rem;
  color: var(--stone-text);
  cursor: pointer;
  user-select: none;
  transition: background-color 200ms, border-color 200ms;
}
.size-filter-chip:hover {
  background-color: var(--stone-hover-bg);
}
.size-filter-chip.is-active {
  border-color: var(--stone-button);
  background-color: var(--stone-button);
  color: rgb(250 250 249);
}
.size-filter-chip.is-active:hover {
  border-color: var(--stone-button-hover);
  background-color: var(--stone-button-hover);
}
.row-section-empty {
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.875rem;
  color: var(--stone-text-subtle);
  text-align: center;
  padding-block: 1rem;
}

/* By size layout — set by sizeFilter.view.js. Row boxes drop out of the layout
   (display: contents) so every banner flows in #framesContainer, grouped by order. */
.size-group-header,
.banner-row-label {
  display: none;
}
#framesContainer.by-size .row-section,
#framesContainer.by-size .row-section-frames {
  display: contents;
}
#framesContainer.by-size .row-section-header,
#framesContainer.by-size .row-section-empty,
#framesContainer.by-size .banner-label {
  display: none;
}
#framesContainer.by-size .size-group-header {
  display: block;
  flex-basis: 100%;
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-text-muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stone-frame-border);
  text-align: center;
}
#framesContainer.by-size .banner-row-label {
  display: block;
  font-family: 'Sky-Regular', sans-serif;
  font-size: 0.75rem;
  color: var(--stone-text-muted);
}

/* ── Toggle ─────────────────────────────────────────────── */
.toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
}

.toggle input[type='checkbox'] {
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--stone-input-bg);
  border-radius: 2px;
  border: 1.5px solid var(--stone-button);
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.toggle input[type='checkbox']:checked {
  background-color: var(--stone-button);
}

.toggle input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: 2px solid #fafaf9;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.toggle input[type='checkbox']:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 767px) {
  .iframe-refresh-btn,
  .iframe-close-btn {
    display: none !important;
  }

  #login_page > div {
    width: 100%;
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  #login_page h2 {
    margin-bottom: 0.375rem;
  }

  #mobile_notice,
  #desktop_notice {
    max-width: 100%;
  }

  #intro_page > span {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Nav: reduce height, padding and gap */
  #sidebar > div:first-child {
    height: 2.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    gap: 0.5rem;
  }

  /* Hamburger menu button: smaller visual, extended hit area */
  #rowTagsMenuBtn {
    position: relative;
    height: 1.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  #rowTagsMenuBtn::before {
    content: '';
    position: absolute;
    inset: -0.5rem;
  }

  /* Sign out: smaller visual size, pushed right, hit area extended via ::before */
  #signoutButton {
    position: relative;
    margin-left: auto;
    width: auto;
    height: 1.75rem;
    font-size: 0.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  #signoutButton::before {
    content: '';
    position: absolute;
    inset: -0.5rem;
  }

  /* Row tags strip: tighter vertical padding */
  #row_tags_strip {
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
  }

  .content-data-tag {
    font-size: 0.75rem;
    height: 1.75rem;
  }

  .size-filter-chip {
    font-size: 0.75rem;
    padding-inline: 0.5rem;
  }

  .content-data-tag > span:first-child {
    position: relative;
    padding-block: 0.3125rem;
    padding-left: 0.5rem;
    padding-right: 0.375rem;
  }
  .content-data-tag > span:first-child::before {
    content: '';
    position: absolute;
    inset: -0.5rem -0.25rem;
  }

  .tag-remove-btn {
    position: relative;
    width: 1.75rem;
    font-size: 1rem;
  }
  .tag-remove-btn::before {
    content: '';
    position: absolute;
    inset: -0.5rem;
  }

  .row-section {
    margin-bottom: 0.75rem;
  }

  .row-section-header {
    font-size: 0.8125rem;
    padding-bottom: 0.2rem;
    margin-bottom: 0.25rem;
  }

  .row-section-frames {
    justify-content: center;
  }

  #framesContainer {
    gap: 0.5rem;
    margin-bottom: 0;
  }

  .banner-label {
    font-size: 0.75rem;
  }

  #row_tags_strip > div {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  #mobile_only_toggle_wrapper {
    order: 1;
  }

  #row_tags {
    order: 2;
    width: 100%;
  }

  #sheet_title_divider {
    display: none !important;
  }

  .notification {
    max-width: calc(100vw - 2rem);
  }

  /* Footer: switch to stacked column, reorder children */
  .site-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    height: auto;
    padding: 0.25rem 1rem;
    gap: 0 0.75rem;
    text-align: center;
  }
  .site-footer span,
  .site-footer a {
    font-size: 0.6875rem;
  }
  .site-footer > span:first-child {
    order: 2;
  }
  .site-footer > div {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.125rem;
  }
  .site-footer > span:last-child {
    order: 1;
  }

  #app {
    padding-bottom: 2.5rem;
  }
}
