/**
 * Seminar Configuration Pages
 * Refined, editorial design for Zoom and Settings tabs
 * Clean BEM structure with distinctive professional aesthetics
 */

/* =============================================================================
   ZOOM TAB - MEETING MANAGEMENT
   ============================================================================= */

#zoom-content {
  animation: fadeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Zoom Container */
.zoom-container {
  width: 100%;
}

/* Zoom Header */
.zoom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-base);
}

.zoom-header__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--ctp-text);
  letter-spacing: -0.03em;
  margin: 0;
}

.zoom-header__action {
  box-shadow: 0 2px 8px rgba(30, 102, 245, 0.2);
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-base);
}

.zoom-header__action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 102, 245, 0.3);
}

/* Zoom Warning */
.zoom-warning {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: linear-gradient(
    135deg,
    rgba(223, 142, 29, 0.08) 0%,
    rgba(254, 100, 11, 0.04) 100%
  );
  border: 1px solid rgba(223, 142, 29, 0.2);
  border-left: 4px solid var(--ctp-yellow);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.zoom-warning__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.zoom-warning__content {
  flex: 1;
}

.zoom-warning__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--ctp-text);
  margin: 0 0 var(--space-2) 0;
}

.zoom-warning__text {
  color: var(--ctp-subtext1);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-relaxed);
}

.zoom-warning__action {
  margin-top: var(--space-3);
}

/* Zoom Form Panel */
.zoom-form-panel {
  background: linear-gradient(
    to bottom,
    var(--ctp-base) 0%,
    var(--color-bg-base) 100%
  );
  border: 1px solid var(--color-border-base);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* Zoom Meetings Section */
.zoom-meetings {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-base);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.zoom-meetings__header {
  margin-bottom: var(--space-5);
}

.zoom-meetings__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--ctp-text);
  margin: 0 0 var(--space-2) 0;
  letter-spacing: -0.02em);
}

.zoom-meetings__notice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(223, 142, 29, 0.1);
  border-radius: var(--radius-md);
  color: var(--ctp-yellow);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.zoom-meetings__notice::before {
  content: "⚠";
  font-size: var(--font-size-base);
}

.zoom-meetings__table {
  overflow-x: auto;
  margin: 0 calc(var(--space-6) * -1);
  padding: 0 var(--space-6);
}

/* Zoom Empty State */
.zoom-empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
}

.zoom-empty__icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.zoom-empty__text {
  color: var(--ctp-subtext1);
  font-size: var(--font-size-lg);
  margin: 0;
}

/* Zoom Alert (for dynamic warnings) */
.zoom-alert {
  margin-top: var(--space-6);
}

/* =============================================================================
   SETTINGS TAB - CONFIGURATION
   ============================================================================= */

#settings-content {
  animation: fadeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

/* Settings Box - Refined Card */
#settings-content .box {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-base);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

#settings-content .box:hover {
  box-shadow: var(--shadow-md);
}

/* Settings Section Headers */
#settings-content .is-size-5 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--ctp-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--ctp-mauve);
}

/* Hint Text */
#settings-content .has-text-grey {
  color: var(--ctp-subtext1) !important;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-5);
}

/* Form Field Groups */
#settings-content .field.has-addons {
  display: inline-flex;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ctp-base);
}

#settings-content .field.has-addons .control {
  flex-shrink: 0;
}

#settings-content .field.has-addons .control.is-expanded {
  flex: 1;
}

#settings-content .field.has-addons .button,
#settings-content .field.has-addons .input {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--color-border-base);
}

#settings-content .field.has-addons .control:last-child .button,
#settings-content .field.has-addons .control:last-child .input {
  border-right: none;
}

/* Multi-line Field Groups */
#settings-content .field.is-grouped.is-grouped-multiline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Buttons - Enhanced States */
#settings-content .button {
  font-weight: var(--font-weight-medium);
  padding: var(--space-3) var(--space-5);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-base);
  background: var(--color-bg-base);
  color: var(--color-text-base);
}

#settings-content .button:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

#settings-content .button.is-info {
  background: var(--ctp-sapphire);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

#settings-content .button.is-info:hover {
  background: var(--ctp-teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#settings-content .button.is-success {
  background: var(--color-success);
  color: white;
  border: none;
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-sm);
}

#settings-content .button.is-success:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#settings-content .button.is-success::before {
  content: "✓";
  margin-right: var(--space-2);
  font-weight: var(--font-weight-bold);
}

#settings-content .button.is-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-sm);
}

#settings-content .button.is-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#settings-content .button.is-danger.is-light {
  background: var(--color-bg-base);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

#settings-content .button.is-danger.is-light:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-error);
  transform: translateY(-1px);
}

/* Input Fields */
#settings-content .input {
  background-color: white;
  transition: all var(--transition-base);
}

#settings-content .input:hover {
  border-color: var(--color-border-strong);
}

#settings-content .input:focus {
  border-color: var(--ctp-mauve);
  box-shadow: 0 0 0 4px rgba(136, 57, 239, 0.1);
  background-color: white;
}

#settings-content .input::placeholder {
  color: var(--ctp-overlay0);
  font-style: italic;
  font-weight: var(--font-weight-normal);
}

/* Help Text */
#settings-content .help {
  color: var(--ctp-subtext1);
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
  font-style: italic;
}

/* Multiple Top-Level Sections */
#settings-content .box + .box {
  margin-top: var(--space-6);
}

/* =============================================================================
   SHARED ENHANCEMENTS
   ============================================================================= */

/* Focus States */
.zoom-header__action:focus,
#settings-content .button:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

/* Responsive */
@media (max-width: 767px) {
  .zoom-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .zoom-header__action {
    width: 100%;
    justify-content: center;
  }

  .zoom-warning {
    flex-direction: column;
  }

  .zoom-meetings__table {
    margin: 0 calc(var(--space-4) * -1);
    padding: 0 var(--space-4);
  }

  #settings-content .field.is-grouped {
    flex-direction: column;
    gap: var(--space-2);
  }

  #settings-content .field.has-addons {
    flex-direction: column;
  }

  #settings-content .field.has-addons .button,
  #settings-content .field.has-addons .input {
    border-right: none;
    border-bottom: 1px solid var(--color-border-base);
  }

  #settings-content .field.has-addons .control:last-child .button,
  #settings-content .field.has-addons .control:last-child .input {
    border-bottom: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading States */
[up-submit][up-active] {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

[up-submit][up-active]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   ANNOUNCEMENT PREVIEW
   Match Telegram/editor spacing: paragraphs are lines, empty paragraphs are
   intentional blank lines, and lists do not add their own extra top gap.
   ============================================================================= */

.announcement-preview {
  line-height: 1.2;
}

.announcement-preview p {
  margin: 0 !important;
  line-height: 1.2;
}

.announcement-preview p:empty::before {
  content: "\00a0";
}

.announcement-preview ul,
.announcement-preview ol {
  margin: 0 0 1.2em 0 !important;
  padding-left: 1.5em !important;
}

.announcement-preview li {
  margin: 0 !important;
  padding-left: 0.25em;
  line-height: 1.2;
}

/* Rooms panel (seminar accommodation tab): one column, switch per room */
.rooms-panel__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.rooms-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}

.rooms-stat__value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.1;
}

.rooms-stat__label {
  font-size: var(--font-size-xs);
  color: var(--color-muted-foreground);
}

.rooms-panel .table-wrapper {
  margin-top: var(--space-2);
}

.rooms-panel .table-toolbar__left {
  flex-wrap: wrap;
}


.rooms-occupants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 0;
  font-size: var(--font-size-sm);
}

.rooms-occupant {
  display: inline-flex;
  align-items: center;
  max-width: 13rem;
  gap: 0.1em;
  padding: 0.1em 0.15em 0.1em 0.55em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-card);
  font-size: var(--font-size-xs);
  line-height: 1.7;
}

.rooms-occupant__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rooms-occupant__unplace {
  display: inline-flex;
  margin: 0;
}

.rooms-occupant__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted-foreground);
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
}

.rooms-occupant__remove:hover,
.rooms-occupant__remove:focus-visible {
  background: color-mix(in srgb, var(--color-destructive) 12%, transparent);
  color: var(--color-destructive);
}

.rooms-occupants__empty {
  font-size: var(--font-size-xs);
  color: var(--color-muted-foreground);
}

.rooms-place,
.rooms-place__select {
  margin: 0;
}

.rooms-place .rooms-place__select {
  max-width: 12rem;
  height: auto;
  min-height: 0;
  padding: 0.15rem 0.4rem;
  border: 1px dashed var(--color-border-base);
  border-radius: var(--radius-full);
  background-color: transparent;
  color: var(--color-muted-foreground);
  font-size: var(--font-size-xs);
}

.rooms-place .rooms-place__select:hover,
.rooms-place .rooms-place__select:focus {
  border-style: solid;
  color: var(--color-text-base);
}

.rooms-waiting {
  display: inline-flex;
  align-items: center;
  padding: 0.1em 0.55em;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-warning) 18%, transparent);
  color: var(--color-warning);
  font-size: var(--font-size-xs);
  line-height: 1.7;
  white-space: nowrap;
}

.room-beds {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.room-beds__pips {
  display: inline-flex;
  gap: 2px;
}

.room-beds__pip {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
}

.room-beds__pip--taken {
  border-color: transparent;
  background: var(--color-primary);
}

.room-beds__count {
  color: var(--color-muted-foreground);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.room-beds--warn .room-beds__pip--taken {
  background: var(--color-warning);
}

.room-beds--warn .room-beds__count {
  color: var(--color-warning);
  font-weight: var(--font-weight-medium);
}

/* Phones: the rooms table keeps number, occupants and status, so both
   controls have to fold rather than overflow their cell. */
@media (max-width: 47.9375rem) {
  .rooms-occupants {
    gap: 3px;
  }

  .rooms-occupant {
    max-width: 100%;
  }

  .rooms-occupant__name {
    overflow: visible;
    white-space: normal;
  }

  .rooms-waiting {
    white-space: normal;
  }

  .rooms-place .rooms-place__select {
    max-width: 100%;
  }

  .room-row__status .segmented {
    flex-wrap: wrap;
    border-radius: var(--radius-md);
  }

  .room-row__status .segmented__label {
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-md);
  }
}

.room-row__status {
  margin: 0;
}

.tabulator-row.room-row--off {
  color: var(--color-muted-foreground);
}

.tabulator-row.room-row--held {
  background: color-mix(in srgb, var(--color-warning) 10%, transparent);
}

/* Segmented control: radio buttons drawn as one pill, thumb-sized on phones */
.segmented {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
}

.segmented__option {
  display: block;
  cursor: pointer;
}

.segmented__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented__label {
  display: block;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  color: var(--color-muted-foreground);
  white-space: nowrap;
}

.segmented__input:checked + .segmented__label {
  background: var(--color-card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
  color: var(--color-foreground);
  font-weight: var(--font-weight-medium);
}

.segmented__option--held .segmented__input:checked + .segmented__label {
  color: var(--color-warning);
}

.segmented__option--off .segmented__input:checked + .segmented__label {
  color: var(--color-destructive);
}

.segmented__input:focus-visible + .segmented__label {
  outline: 2px solid var(--color-ring);
  outline-offset: 1px;
}

@media (max-width: 30rem) {
  .segmented {
    width: 100%;
  }

  .segmented__option {
    flex: 1;
  }

  .segmented__label {
    padding: 0.5rem 0.25rem;
    text-align: center;
  }
}


/* ------------------------------------------------------------------ */
/* Rooms panel — mobile cards (dual-render with .hidden-desktop)      */
/* `display` lives in the mobile media query so it never beats the    */
/* .hidden-desktop utility on larger screens.                         */
/* ------------------------------------------------------------------ */

.rooms-cards {
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

@media (max-width: 767px) {
  .rooms-cards {
    display: flex;
  }
}

.rooms-cards__search {
  margin-bottom: var(--space-1);
}

.rooms-cards__search input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rooms-cards__search input:focus {
  outline: none;
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.rooms-cards__search input::placeholder {
  color: var(--color-muted-foreground);
}

.room-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.room-card--held {
  border-color: color-mix(in srgb, var(--color-warning) 35%, var(--color-border));
  background: color-mix(in srgb, var(--color-warning) 8%, var(--color-card));
}

.room-card--off {
  color: var(--color-muted-foreground);
  background: color-mix(in srgb, var(--color-muted) 40%, var(--color-card));
}

.room-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.room-card__identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-card__number {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--color-foreground);
}

.room-card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-muted-foreground);
  line-height: 1.4;
}

.room-card__status .segmented {
  width: 100%;
}

.room-card__status .segmented__option {
  flex: 1;
}

.room-card__status .segmented__label {
  padding: 0.55rem 0.35rem;
  text-align: center;
  font-size: var(--font-size-sm);
}

.room-card__people {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.room-card__people-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.room-card__person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
}

.room-card__person-name {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.room-card__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-muted-foreground);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.room-card__remove:hover,
.room-card__remove:focus-visible {
  background: color-mix(in srgb, var(--color-destructive) 12%, transparent);
  color: var(--color-destructive);
}

.room-card__empty {
  font-size: var(--font-size-sm);
  color: var(--color-muted-foreground);
  padding: var(--space-1) 0;
}

/* Place/move select is the primary add action on a card — full-width, thumb-sized. */
.room-card .rooms-place {
  width: 100%;
}

.room-card .rooms-place__select {
  width: 100%;
  max-width: none;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px dashed var(--color-border-base);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-muted-foreground);
  font-size: var(--font-size-sm);
}

.room-card .rooms-place__select:hover,
.room-card .rooms-place__select:focus {
  border-style: solid;
  color: var(--color-foreground);
}
