/* =========================================================
   TOP 부천 - booking.css
   실시간 예약 페이지 (룸 맵 + 예약 폼 + 노쇼 경고)
   ========================================================= */

/* ---------- Booking Container (Gold Frame) ---------- */
.booking-frame {
  padding: var(--space-lg) 0 var(--space-2xl);
}

.booking-card {
  background: var(--bg-card);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-md);
  position: relative;
  box-shadow: var(--shadow-dark);
  margin-bottom: var(--space-lg);
}

.booking-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: calc(var(--radius-xl) - 5px);
  pointer-events: none;
}

.booking-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-gold);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ---------- Room Map ---------- */
.room-map-section { margin-bottom: var(--space-lg); position: relative; z-index: 1; }

.room-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.room-map-header h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.room-map-header .status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-body);
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.room-slot {
  aspect-ratio: 1.1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
}

/* 이용 가능 */
.room-slot {
  background: linear-gradient(180deg, #00c853 0%, #009e3f 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 200, 83, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.room-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 200, 83, 0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}

.room-slot.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 2px 8px rgba(0, 200, 83, 0.3);
}

/* 이용중 */
.room-slot.is-busy,
.room-slot.status-busy {
  background: linear-gradient(180deg, #e53935 0%, #b71c1c 100%);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.room-slot.is-busy:hover,
.room-slot.status-busy:hover { transform: translateY(-3px); }

/* VIP */
.room-slot.is-vip,
.room-slot.status-vip {
  background: var(--gold-gradient);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* 폐쇄 */
.room-slot.is-off,
.room-slot.status-off {
  background: var(--bg-elevated);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  cursor: not-allowed;
}

.room-slot.is-off:hover,
.room-slot.status-off:hover { transform: none; }

/* 범례 */
.room-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(10, 8, 6, 0.5);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  justify-content: center;
}

.room-legend .item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.room-legend .dot.free { background: #00c853; }
.room-legend .dot.busy { background: #e53935; }
.room-legend .dot.vip { background: var(--gold); }
.room-legend .dot.off { background: var(--bg-elevated); border: 1px solid var(--border-subtle); }

/* ---------- Booking Form ---------- */
.booking-form {
  display: grid;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.form-field { position: relative; }

.form-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.85rem var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23d4af37' stroke-width='2'%3E%3Cpolyline points='1 1 6 7 11 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ---------- Terms / No-show Warning ---------- */
.terms-section {
  margin-top: var(--space-xl);
  position: relative;
  z-index: 1;
}

.terms-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: 0.1em;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.noshow-warning {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.08), rgba(229, 57, 53, 0.02));
  border: 1px solid rgba(229, 57, 53, 0.4);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.noshow-warning .warn-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--status-busy);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 0 12px rgba(229, 57, 53, 0.4);
}

.noshow-warning h4 {
  font-size: 0.9rem;
  color: var(--status-busy);
  margin-bottom: 4px;
  font-weight: 700;
}

.noshow-warning p {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.75;
}

.noshow-warning .highlight {
  color: var(--status-busy);
  font-weight: 600;
}

/* 동의 체크박스 */
.consent-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.consent-row input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: #fff !important;
  border: 2px solid var(--gold) !important;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  display: inline-block !important;
  vertical-align: middle;
  margin: 0;
}

.consent-row input[type="checkbox"]:checked {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
}

.consent-row input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0806;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.consent-row label {
  font-size: 0.85rem;
  color: var(--text-body);
  cursor: pointer;
  line-height: 1.5;
}

.consent-row label .required {
  color: var(--status-busy);
  font-weight: 700;
  margin-right: 4px;
}

/* ---------- Submit ---------- */
.booking-submit {
  margin-top: var(--space-lg);
  position: relative;
  z-index: 1;
}

.booking-submit .btn-gold {
  padding: 1.1rem;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  .booking-card { padding: var(--space-2xl); }
  .room-grid { grid-template-columns: repeat(6, 1fr); }
  .booking-title { font-size: 1.25rem; }
}

@media (min-width: 1024px) {
  .booking-frame {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
  }
  .booking-card { margin-bottom: 0; }
}

/* =========================================================
   [v10] 관리자 룸 토글 모드
   ========================================================= */

/* 관리자에게만 보이는 ↻ 아이콘 */
.room-slot.admin-toggleable {
  position: relative;
}

.room-slot.admin-toggleable .admin-toggle-hint {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  opacity: 0.6;
  color: var(--gold);
  font-weight: 800;
  transition: all 0.2s ease;
}

.room-slot.admin-toggleable:hover {
  cursor: pointer;
  border-color: var(--gold-light) !important;
  box-shadow:
    0 0 0 2px rgba(212, 175, 55, 0.3),
    0 8px 20px rgba(212, 175, 55, 0.15);
  transform: translateY(-2px);
}

.room-slot.admin-toggleable:hover .admin-toggle-hint {
  opacity: 1;
  transform: rotate(180deg);
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

/* 관리자에서는 is-busy도 클릭 가능 */
.room-slot.admin-toggleable.is-busy {
  cursor: pointer !important;
}

.room-slot.admin-toggleable.is-busy:hover {
  filter: brightness(1.3);
}

/* admin-room-control 박스 (안내문) — 모바일 최적화 */
@media (max-width: 480px) {
  .admin-room-control {
    font-size: 0.78rem !important;
  }
}

/* =========================================================
   [v11.1] 룸 상태 색상 명확하게 + 인라인 편집 영향 차단
   ========================================================= */

/* 룸 슬롯에 inline-editor 영향 절대 안 받게 */
.room-slot,
.room-slot:hover,
.room-slot:focus,
.room-slot.is-selected {
  outline: none !important;
}

/* [v14] 룸 상태별 색상 — status- 클래스 기준 */
.room-slot.status-available {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
  color: #fff !important;
  border-color: rgba(187, 247, 208, 0.4) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.room-slot.status-busy {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%) !important;
  color: #fff !important;
  border-color: rgba(254, 202, 202, 0.4) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.room-slot.status-vip {
  background: var(--gold-gradient) !important;
  color: #0a0806 !important;
  border-color: rgba(244, 212, 124, 0.6) !important;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.room-slot.status-off {
  background: linear-gradient(180deg, #4a4035 0%, #2a2520 100%) !important;
  color: #999 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  cursor: not-allowed;
}

/* 일반 사용자 - 예약용 선택됨 (골드 outline) */
.room-slot.is-selected {
  outline: 3px solid var(--gold) !important;
  outline-offset: 2px;
  transform: translateY(-3px);
}

/* 룸 로딩 중 (회전 효과) */
.room-slot[data-processing="1"] {
  animation: room-pulse 0.8s ease-in-out infinite;
}

@keyframes room-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* 관리자 모드 — 모든 룸이 클릭 가능하도록 */
.room-slot.admin-toggleable {
  cursor: pointer !important;
  pointer-events: auto !important;
}

.room-slot.admin-toggleable[disabled] {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* 룸 legend 색상도 동일하게 */
.room-legend .dot.free  { background: #16a34a; }
.room-legend .dot.busy  { background: #ef4444; }
.room-legend .dot.vip   { background: var(--gold); }
.room-legend .dot.off   { background: #555; }

/* =========================================================
   [v12] 룸 상태 메뉴 시스템 (드롭다운)
   ========================================================= */

.admin-room-control {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-room-control .admin-badge {
  background: var(--gold);
  color: #0a0806;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
}

/* 룸 그리드 — 메뉴 컨테이너 */
.room-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

.room-slot-wrap {
  position: relative;
}

/* 룸 버튼 기본 */
.room-slot {
  width: 100%;
  aspect-ratio: 1.2;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  outline: none !important;
  color: #fff;
}

/* 4가지 상태 색상 */
.room-slot.status-available {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.room-slot.status-busy {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.room-slot.status-vip {
  background: var(--gold-gradient);
  color: #0a0806 !important;
  text-shadow: none;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.room-slot.status-off {
  background: linear-gradient(180deg, #4a4035 0%, #2a2520 100%);
  color: #999;
  cursor: not-allowed;
}

/* 호버 */
.room-slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.room-slot.status-vip:hover {
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

/* 관리자 — 클릭 가능 표시 */
.room-slot.admin-clickable {
  cursor: pointer;
}

.room-slot.admin-clickable .admin-edit-icon {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 10px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.room-slot.admin-clickable:hover .admin-edit-icon {
  opacity: 1;
  color: #fff;
}

/* 메뉴 열렸을 때 활성 표시 */
.room-slot-wrap.is-menu-open .room-slot {
  outline: 3px solid var(--gold) !important;
  outline-offset: 2px;
}

/* 드롭다운 메뉴 */
.room-status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  min-width: 180px;
  background: linear-gradient(180deg, #1a130d 0%, #14100c 100%);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.room-slot-wrap.is-menu-open .room-status-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

.room-status-menu .menu-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  padding: 8px 10px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 4px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.status-option:hover {
  background: rgba(212, 175, 55, 0.15);
}

.status-option .opt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-option .dot-green { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.6); }
.status-option .dot-red   { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.status-option .dot-gold  { background: var(--gold); box-shadow: 0 0 6px rgba(212, 175, 55, 0.6); }
.status-option .dot-gray  { background: #666; }

/* 메뉴 화살표 */
.room-status-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--gold);
}

.room-status-menu::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #1a130d;
}

/* 처리 중 인디케이터 */
.room-slot.is-processing {
  opacity: 0.5;
  pointer-events: none;
}

/* 일반 사용자 - 선택됨 (예약용) */
.room-slot.is-selected {
  outline: 3px solid var(--gold) !important;
  outline-offset: 2px;
  transform: translateY(-3px);
}

/* legend dot 색상 통일 */
.room-legend .dot.free  { background: #16a34a; }
.room-legend .dot.busy  { background: #ef4444; }
.room-legend .dot.vip   { background: var(--gold); }
.room-legend .dot.off   { background: #555; }

/* =========================================================
   [v12.2] 룸 메뉴 — body 직속 fixed 위치 (overflow 회피)
   ========================================================= */

/* JS가 메뉴를 body로 옮기므로, 부모 wrap의 위치 영향 안 받음 */
.room-status-menu {
  position: fixed !important;
  top: auto;
  left: auto;
  transform: scale(1) !important;
  z-index: 99998 !important;
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  min-width: 200px;
  background: linear-gradient(180deg, #1a130d 0%, #14100c 100%);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 175, 55, 0.3);
}

/* fixed로 변경되면 ::before 화살표는 안 맞으니 숨김 */
.room-status-menu::before,
.room-status-menu::after {
  display: none;
}

/* 메뉴 활성 룸 */
.room-slot.is-menu-active {
  outline: 3px solid var(--gold) !important;
  outline-offset: 2px;
  z-index: 5;
  position: relative;
}

/* 옵션 버튼 */
.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.status-option:hover {
  background: rgba(212, 175, 55, 0.18);
}

.status-option:active {
  background: rgba(212, 175, 55, 0.3);
}

.menu-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  padding: 8px 10px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 4px;
}

/* 모바일 — 메뉴 가운데 화면에 띄우기 (선택) */
@media (max-width: 480px) {
  .room-status-menu {
    min-width: 220px;
  }
  .status-option {
    padding: 12px 14px;
    font-size: 14px;
  }
}
