/* ============================================
   POSTO Solution Advisor — Layout V2 Styles
   Image-first room visualization
   ============================================ */

/* === Board === */
.layout-v2-board {
  position: relative;
  min-height: 520px;
  border-radius: 1.25rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.1),
    0 1px 4px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.layout-v2-board--meeting-real {
  min-height: 0;
  aspect-ratio: 3 / 2;
  background-position: center;
  border-color: #cfdceb;
}

.layout-v2-board--boardroom-real {
  min-height: 0;
  aspect-ratio: 3 / 2;
  background-position: center;
  border-color: #cfdceb;
}

.layout-v2-board--classroom-real {
  min-height: 0;
  aspect-ratio: 3 / 2;
  background-position: center;
  border-color: #cfdceb;
}

.layout-v2-board--training-real {
  min-height: 0;
  aspect-ratio: 3 / 2;
  background-position: center;
  border-color: #cfdceb;
}

.layout-v2-board--seminar-real {
  min-height: 0;
  aspect-ratio: 3 / 2;
  background-position: center;
  border-color: #cfdceb;
}

.layout-v2-front-indicator {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  z-index: 11;
  pointer-events: none;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.layout-v2-front-text {
  color: #1e293b;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
}

.layout-v2-front-sub {
  color: #475569;
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.layout-v2-front-indicator--clean {
  left: 0.7rem;
  right: auto;
  align-items: flex-start;
}

.layout-v2-front-indicator--clean .layout-v2-front-sub {
  display: none;
}

/* === Attendee dots === */
.layout-v2-attendee {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  z-index: 6;
}

.layout-v2-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.66);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(241, 245, 249, 0.86) 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
  z-index: 5;
}

.layout-v2-seat::after {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 0.3rem;
  border: 1px solid rgba(191, 219, 254, 0.88);
  background: rgba(239, 246, 255, 0.82);
}

.layout-v2-seat--h {
  width: 1.35rem;
  height: 0.68rem;
}

.layout-v2-seat--v {
  width: 0.68rem;
  height: 1.35rem;
}

/* === Count / Overflow badges === */
.layout-v2-count-badge,
.layout-v2-overflow-badge {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  z-index: 5;
}

.layout-v2-count-badge {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #1e293b;
  font-weight: 800;
}

.layout-v2-overflow-badge {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #fff;
}

.layout-v2-overflow-badge--stacked {
  bottom: 3rem;
}

/* === Device Icons === */
.layout-v2-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10;
  padding: 0;
}

.layout-v2-icon__svg {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  pointer-events: none;
}

.layout-v2-icon__number {
  position: absolute;
  bottom: -0.3rem;
  right: -0.3rem;
  min-width: 0.95rem;
  height: 0.95rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.26);
  border: 1.5px solid #fff;
  padding: 0 0.16rem;
}

.layout-v2-icon__label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.22rem 0.4rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
  pointer-events: none;
}

.layout-v2-icon__label--top {
  bottom: calc(100% + 0.3rem);
}

.layout-v2-icon__label--bottom {
  top: calc(100% + 0.3rem);
}

.layout-v2-icon:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 7px 14px rgba(15, 23, 42, 0.2);
}

.layout-v2-icon:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 0 6px rgba(37, 99, 235, 0.28),
    0 10px 24px rgba(15, 23, 42, 0.15);
}

.layout-v2-icon.is-active {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.22),
    0 0 0 4px rgba(59, 130, 246, 0.16);
  background: rgba(255, 255, 255, 0.98);
}

.layout-v2-icon--tag {
  width: auto;
  height: auto;
  min-height: 1.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 0.38rem 0.8rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.layout-v2-icon--tag .layout-v2-icon__tag-text {
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  max-width: 13.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s ease;
}

.layout-v2-icon--tag .layout-v2-icon__svg,
.layout-v2-icon--tag .layout-v2-icon__number,
.layout-v2-icon--tag .layout-v2-icon__label {
  display: none;
}

.layout-v2-icon--tag:hover,
.layout-v2-icon--tag:focus-visible {
  transform: translate(-50%, -50%) scale(1.04);
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.06);
}

.layout-v2-icon--tag.is-active {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow:
    0 6px 20px rgba(37, 99, 235, 0.2),
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

.layout-v2-icon--tag.is-active .layout-v2-icon__tag-text {
  color: #1d4ed8;
}

.layout-v2-callout {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.layout-v2-callout__line {
  position: absolute;
  height: 1.75px;
  border-radius: 9999px;
  transform-origin: 0 50%;
  background: rgba(96, 165, 250, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
  opacity: 0.96;
  pointer-events: none;
}

.layout-v2-callout__anchor {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.layout-v2-icon--callout {
  pointer-events: auto;
  z-index: 11;
}

.layout-v2-callout.is-active .layout-v2-callout__line {
  background: rgba(37, 99, 235, 0.98);
  height: 2.2px;
}

.layout-v2-callout.is-active .layout-v2-callout__anchor {
  background: #2563eb;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.2),
    0 4px 10px rgba(15, 23, 42, 0.28);
}

/* === Tooltip === */
.layout-v2-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
  min-width: 180px;
  max-width: 260px;
  border-radius: 0.7rem;
  border: 1px solid #bfdbfe;
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  text-align: left;
  white-space: normal;
}

.layout-v2-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Side Guide === */
.layout-v2-guide {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #ffffff;
  padding: 1.1rem;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.layout-v2-guide__eyebrow {
  margin: 0;
  color: #2563eb;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.layout-v2-guide__title {
  margin: 0.25rem 0 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
}

.layout-v2-guide__copy {
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}

.layout-v2-guide__grid {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* === Equipment Cards === */
.layout-v2-card {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #ffffff;
  padding: 0.6rem 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.layout-v2-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
  background: #fafcff;
}

.layout-v2-card:focus-visible {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.layout-v2-card.is-active {
  border-color: #93c5fd;
  border-left: 3px solid #3b82f6;
  padding-left: calc(0.75rem - 2px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.14);
  background: #f8fbff;
  transform: translateY(-1px);
}

.layout-v2-card__order {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9999px;
  border: 1.5px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.layout-v2-card.is-active .layout-v2-card__order {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
  color: #ffffff;
}

.layout-v2-card__body {
  min-width: 0;
}

.layout-v2-card__name {
  margin: 0;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.3;
}

.layout-v2-card__meta {
  margin: 0.15rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
}

.layout-v2-card__dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.layout-v2-card__copy {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.73rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Legend === */
.layout-v2-legend {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.layout-v2-legend__title {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #334155;
  font-weight: 700;
}

.layout-v2-legend__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.layout-v2-legend-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f0f9ff 0%, #eff6ff 100%);
  color: #1d4ed8;
  border-radius: 9999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.layout-v2-legend-chip:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

/* === Layout Structure === */
.room-layout-main {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start;
}

.room-layout-main .layout-v2-guide {
  margin-top: 0.95rem;
}

@media (min-width: 1024px) {
  .layout-v2-board {
    min-height: 620px;
  }

  .layout-v2-board--meeting-real,
  .layout-v2-board--boardroom-real,
  .layout-v2-board--classroom-real,
  .layout-v2-board--training-real,
  .layout-v2-board--seminar-real {
    /* Keep board ratio aligned to the source floor-plan image to prevent desktop crop/zoom */
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  .layout-v2-guide__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
}

/* === Responsive === */
@media (max-width: 767px) {
  .layout-v2-board {
    min-height: 400px;
  }

  .layout-v2-board--meeting-real,
  .layout-v2-board--boardroom-real,
  .layout-v2-board--classroom-real,
  .layout-v2-board--training-real,
  .layout-v2-board--seminar-real {
    min-height: 0;
  }

  .layout-v2-icon {
    width: 2.1rem;
    height: 2.1rem;
  }

  .layout-v2-icon__svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  .layout-v2-icon__number {
    min-width: 0.95rem;
    height: 0.95rem;
    font-size: 0.55rem;
    bottom: -0.25rem;
    right: -0.25rem;
  }

  .layout-v2-front-text {
    font-size: 0.6rem;
  }

  .layout-v2-front-sub {
    font-size: 0.52rem;
  }

  .layout-v2-front-indicator {
    padding: 0.22rem 0.44rem;
  }

  .layout-v2-attendee {
    width: 0.45rem;
    height: 0.45rem;
  }

  .layout-v2-seat--h {
    width: 1.15rem;
    height: 0.58rem;
  }

  .layout-v2-seat--v {
    width: 0.58rem;
    height: 1.15rem;
  }

  .layout-v2-icon__label {
    display: none;
  }

  .layout-v2-callout__line {
    height: 1.5px;
    opacity: 0.84;
  }

  .layout-v2-callout__anchor {
    width: 0.5rem;
    height: 0.5rem;
  }

  .layout-v2-tooltip {
    min-width: 150px;
    max-width: 200px;
    font-size: 0.68rem;
    padding: 0.45rem 0.55rem;
  }

  .layout-v2-guide__title {
    font-size: 0.92rem;
  }

  .layout-v2-card {
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
  }

}
