/* Page basics */
* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f0f2f5;
  color: #222;
}

.page {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-title {
  text-align: center;
  margin-bottom: 16px;
}

/* Panels */
.panel {
  background: #ffffff;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Centered panel (login) */
.panel-center {
  max-width: 360px;
  margin: 0 auto 16px auto;
}

/* Form fields */
.field {
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.input-full {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #bbb;
}

/* Buttons */
button {
  font-family: inherit;
}

.btn-primary {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #1976d2;
  background: #2196f3;
  color: #fff;
  cursor: pointer;
}

.btn-primary:hover {
  background: #1976d2;
}

.btn-full {
  width: 100%;
}

.login-status {
  margin-top: 6px;
  font-size: 13px;
}

/* Utility */
.hidden {
  display: none;
}

.info-text {
  font-size: 13px;
  color: #444;
}

/* Top bar for logged-in info */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid #ddd;
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.top-user {
  font-size: 14px;
  font-weight: 500;
}

.top-btn {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #1976d2;
  background: #2196f3;
  color: #fff;
  cursor: pointer;
}

.top-btn:hover {
  background: #1976d2;
}

/* App layout: left controls, right schema */
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); /* wider left, narrower right */
  gap: 32px;
  align-items: flex-start;
}

/* Left column */
.app-left {
  min-width: 0;
}

/* Right column: schema aligned to the right */
.app-right {
  min-width: 0;
  display: flex;
  justify-content: flex-end; /* push schema to right edge of its column */
}

.field-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Seat room layout */
.room {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 2px solid #ccc;
  border-right-width: 6px;        /* window side accent */
  border-right-color: #0077cc;
  width: 100%;
  max-width: 420px;
  margin: 0;                      /* app-right handles positioning */
  background: #fafafa;
}

.room-header {
  display: flex;
  justify-content: flex-end;
}

.window-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}

.room-body {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr); /* corridor, seats */
  column-gap: 16px;
  align-items: center;
}

/* Corridor column */
.corridor {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.corridor-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777;
}

/* Seats grid */
.seats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end; /* push all rows toward the window (right) */
  margin-right: 10px;
}

/* 3 seats per row */
.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 80px));
  gap: 10px;
}

.divider {
  height: 8px;
  border-bottom: 2px solid #ddd;
}

/* Seats */
.seat {
  height: 38px;
  border-radius: 4px;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  background-color: #c8e6c9;      /* available */
  color: #1b5e20;
  font-size: 13px;
  text-align: center;
  padding: 0 4px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.seat.available {
  background-color: #c8e6c9;
  border-color: #2e7d32;
  color: #1b5e20;
}

.seat.booked {
  background-color: #ffcdd2;
  border-color: #c62828;
  color: #b71c1c;
}

.seat.available:hover {
  background-color: #a5d6a7;
}

/* Selected seat highlight */
.seat.selected-seat {
  box-shadow: 0 0 0 2px #ff9800;
}

/* Distance row between M and B areas */
.distance-row {
  text-align: center;
  font-size: 12px;
  color: #555;
  font-style: italic;
}

/* Footer: door label */
.room-footer {
  display: flex;
  justify-content: flex-start;
}

.door-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}

/* Media areas for admin-configured content */
.media-top,
.media-bottom {
  width: 100%;
  text-align: center;
  padding: 8px 0;
}

.media-top img,
.media-bottom img,
.media-top video,
.media-bottom video,
.media-top iframe,
.media-bottom iframe {
  max-width: 100%;
  height: auto;
}

/* Admin panel helpers */
.section-title {
  margin-top: 0;
  margin-bottom: 8px;
}

.textarea-full {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #bbb;
  font-family: inherit;
}

/* My bookings list */
.bookings-list {
  list-style: disc;
  padding-left: 20px;
  margin: 4px 0 0 0;
  font-size: 13px;
}

.btn-cancel-booking {
  margin-left: 40px;
  padding: 8px 8px;
  font-size: 11px;
  border-radius: 3px;
  border: 1px solid #b71c1c;
  background: #e57373;
  color: #fff;
  cursor: pointer;
}

.btn-cancel-booking:hover {
  background: #d32f2f;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  .app-right {
    justify-content: center;   /* center schema on small screens */
  }
  .room {
    margin-top: 16px;
  }
}

@media (max-width: 500px) {
  .top-bar-inner {
    justify-content: space-between;
    gap: 4px;
  }
  .top-btn {
    padding: 3px 6px;
    font-size: 12px;
  }
}