/* ============================================
   SEATS WIDGET — Карта місць автобуса
   Паломницький центр Віфлеєм
   ============================================ */

/* === Base Container === */
.seats-widget {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 520px;
  margin: 0 auto;
  color: #2c3e50;
}

.seats-widget * {
  box-sizing: border-box;
}

/* === Section Title === */
.seats-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e8e8e8;
}

.seats-section__title {
  font-size: 22px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.seats-section__title svg {
  width: 28px;
  height: 28px;
  stroke: #c59a4a;
}

.seats-section__subtitle {
  font-size: 14px;
  color: #7a8b9a;
  margin: 0 0 20px 0;
}

/* === Price Badge === */
.seats-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fef9f0 0%, #fdf0d5 100%);
  border: 1px solid #e8d5a8;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.seats-price-badge__label {
  font-size: 13px;
  color: #8a7a5a;
}

.seats-price-badge__value {
  font-size: 18px;
  font-weight: 700;
  color: #8b6914;
}

/* === Info Notice === */
.seats-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
  border: 1px solid #c5d9f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #3a5a7a;
}

.seats-notice svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: #5a8abd;
  margin-top: 1px;
}

.seats-notice--warning {
  background: linear-gradient(135deg, #fff8f0 0%, #fef0e0 100%);
  border-color: #e8d0a8;
  color: #7a5a3a;
}

.seats-notice--warning svg {
  stroke: #c59a4a;
}

/* === Legend === */
.seats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 10px;
}

.seats-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5a6a7a;
}

.seats-legend__dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid transparent;
}

.seats-legend__dot--free {
  background: #e8f5e9;
  border-color: #4caf50;
}

.seats-legend__dot--selected {
  background: #c59a4a;
  border-color: #a07a2a;
}

.seats-legend__dot--reserved {
  background: #fff3e0;
  border-color: #ff9800;
}

.seats-legend__dot--occupied {
  background: #ffebee;
  border-color: #f44336;
}

.seats-legend__dot--paid {
  background: #e3f2fd;
  border-color: #2196f3;
}

.seats-legend__dot--blocked {
  background: #e0e0e0;
  border-color: #9e9e9e;
}

/* === Bus Container === */
.seats-bus {
  background: #f4f6f8;
  border-radius: 30px 30px 16px 16px;
  padding: 20px 16px 24px;
  position: relative;
  border: 2px solid #dce3ea;
  margin-bottom: 20px;
}

/* Driver area */
.seats-bus__driver {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px 16px;
  margin-bottom: 12px;
  border-bottom: 2px dashed #c5d0da;
}

.seats-bus__driver-icon {
  width: 36px;
  height: 36px;
  background: #dce3ea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seats-bus__driver-icon svg {
  width: 20px;
  height: 20px;
  stroke: #7a8b9a;
}

.seats-bus__driver-label {
  font-size: 11px;
  color: #9aa5b0;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Row layout */
.seats-bus__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 6px;
}

.seats-bus__row--back {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 2px dashed #c5d0da;
}

.seats-bus__left,
.seats-bus__right {
  display: flex;
  gap: 6px;
}

.seats-bus__aisle {
  width: 36px;
  flex-shrink: 0;
}

.seats-bus__row-num {
  font-size: 10px;
  color: #aab5c0;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* === Individual Seat === */
.seat {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid #c5d0da;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.seat:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.seat__number {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #4a5568;
}

.seat__label {
  font-size: 7px;
  color: #9aa5b0;
  margin-top: 1px;
}

/* Seat states */
.seat--free {
  background: #e8f5e9;
  border-color: #81c784;
  color: #2e7d32;
}

.seat--free:hover {
  background: #c8e6c9;
  border-color: #4caf50;
}

.seat--free .seat__number {
  color: #2e7d32;
}

.seat--selected {
  background: linear-gradient(135deg, #c59a4a, #dab06a);
  border-color: #a07a2a;
  color: #fff;
  box-shadow: 0 2px 10px rgba(197, 154, 74, 0.4);
  transform: scale(1.08);
}

.seat--selected .seat__number,
.seat--selected .seat__label {
  color: #fff;
}

.seat--reserved {
  background: #fff3e0;
  border-color: #ffb74d;
  cursor: default;
}

.seat--reserved:hover {
  transform: none;
  box-shadow: none;
}

.seat--reserved .seat__number {
  color: #e65100;
}

.seat--occupied {
  background: #ffebee;
  border-color: #ef9a9a;
  cursor: default;
}

.seat--occupied:hover {
  transform: none;
  box-shadow: none;
}

.seat--occupied .seat__number {
  color: #c62828;
}

.seat--occupied::after {
  content: '×';
  position: absolute;
  font-size: 22px;
  font-weight: 300;
  color: rgba(198, 40, 40, 0.4);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.seat--paid {
  background: #e3f2fd;
  border-color: #64b5f6;
  cursor: default;
}

.seat--paid:hover {
  transform: none;
  box-shadow: none;
}

.seat--paid .seat__number {
  color: #1565c0;
}

.seat--paid::after {
  content: '✓';
  position: absolute;
  font-size: 16px;
  color: rgba(21, 101, 192, 0.5);
  top: 1px;
  right: 3px;
}

.seat--blocked {
  background: #eeeeee;
  border-color: #bdbdbd;
  cursor: not-allowed;
  opacity: 0.6;
}

.seat--blocked:hover {
  transform: none;
  box-shadow: none;
}

.seat--blocked .seat__number {
  color: #9e9e9e;
  text-decoration: line-through;
}

/* === Booking Form === */
.seats-booking {
  background: #fff;
  border: 2px solid #c59a4a;
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 4px 20px rgba(197, 154, 74, 0.15);
}

.seats-booking__title {
  font-size: 18px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0 0 4px;
}

.seats-booking__seat-info {
  font-size: 14px;
  color: #c59a4a;
  font-weight: 600;
  margin-bottom: 16px;
}

.seats-booking__field {
  margin-bottom: 14px;
}

.seats-booking__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 4px;
}

.seats-booking__input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #dce3ea;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #2c3e50;
  transition: border-color 0.2s;
  outline: none;
}

.seats-booking__input:focus {
  border-color: #c59a4a;
  box-shadow: 0 0 0 3px rgba(197, 154, 74, 0.15);
}

.seats-booking__input::placeholder {
  color: #aab5c0;
}

.seats-booking__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.seats-booking__btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.seats-booking__btn--submit {
  background: linear-gradient(135deg, #c59a4a, #dab06a);
  color: #fff;
  box-shadow: 0 2px 10px rgba(197, 154, 74, 0.3);
}

.seats-booking__btn--submit:hover {
  background: linear-gradient(135deg, #a07a2a, #c59a4a);
  box-shadow: 0 4px 16px rgba(197, 154, 74, 0.4);
}

.seats-booking__btn--submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.seats-booking__btn--cancel {
  background: #f4f6f8;
  color: #5a6a7a;
  flex: 0 0 auto;
  padding: 14px 16px;
}

.seats-booking__btn--cancel:hover {
  background: #e8edf2;
}

/* === Success Message === */
.seats-success {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: 16px;
  border: 2px solid #81c784;
  margin-top: 20px;
}

.seats-success__icon {
  width: 56px;
  height: 56px;
  background: #4caf50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.seats-success__icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
}

.seats-success__title {
  font-size: 20px;
  font-weight: 700;
  color: #2e7d32;
  margin: 0 0 8px;
}

.seats-success__text {
  font-size: 14px;
  color: #4a7a4a;
  margin: 0;
  line-height: 1.5;
}

/* === Stats Bar === */
.seats-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.seats-stats__item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  background: #f8f9fa;
}

.seats-stats__number {
  font-size: 24px;
  font-weight: 800;
  display: block;
}

.seats-stats__number--free {
  color: #4caf50;
}

.seats-stats__number--occupied {
  color: #f44336;
}

.seats-stats__number--total {
  color: #1a3a5c;
}

.seats-stats__label {
  font-size: 11px;
  color: #7a8b9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === CTA Button === */
.seats-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #c59a4a, #dab06a);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(197, 154, 74, 0.3);
  text-decoration: none;
}

.seats-cta-btn:hover {
  background: linear-gradient(135deg, #a07a2a, #c59a4a);
  box-shadow: 0 6px 24px rgba(197, 154, 74, 0.45);
  transform: translateY(-2px);
}

.seats-cta-btn svg {
  width: 20px;
  height: 20px;
}

/* === Loading === */
.seats-loading {
  text-align: center;
  padding: 40px 20px;
  color: #7a8b9a;
}

.seats-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8edf2;
  border-top-color: #c59a4a;
  border-radius: 50%;
  animation: seats-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* === Error === */
.seats-error {
  text-align: center;
  padding: 20px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  color: #c53030;
  font-size: 14px;
}

/* === Tooltip (admin) === */
.seat-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2a3a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.seat-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a2a3a;
}

/* === Responsive === */
@media (max-width: 480px) {
  .seats-widget {
    max-width: 100%;
  }

  .seat {
    width: 38px;
    height: 38px;
  }

  .seat__number {
    font-size: 10px;
  }

  .seats-bus__aisle {
    width: 24px;
  }

  .seats-bus {
    padding: 16px 10px 20px;
  }

  .seats-legend {
    gap: 10px;
  }

  .seats-legend__item {
    font-size: 11px;
  }

  .seats-booking {
    padding: 18px;
  }

  .seats-booking__actions {
    flex-direction: column;
  }

  .seats-stats {
    gap: 8px;
  }

  .seats-stats__number {
    font-size: 20px;
  }

  .seats-section__title {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .seat {
    width: 34px;
    height: 34px;
  }

  .seat__number {
    font-size: 9px;
  }

  .seats-bus__aisle {
    width: 18px;
  }

  .seats-bus__row-num {
    width: 16px;
    font-size: 9px;
  }
}
