/* Seat Map Container */
.seat-map-container {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--page);
  width: 100%;
  height: 650px;
  border-radius: 8px;
  flex-wrap: nowrap;
}

/* Main SVG and Sidebar Layout */
#seat-map-main {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: 500px;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

#sidebar h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--title);
}

.sidebar-header {
  background: var(--primary-color, #3b82f6);
  color: #fff;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 15px;
  display: flex;
  align-items: center;
}

.sidebar-header::before {
  content: "← ";
  margin-right: 5px;
}

/* Main content (SVG + Seats) */
#main {
  flex: 1 1 auto;
  display: flex;
  background: var(--white);
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  min-height: 400px;
  overflow: auto;
}

image {
  pointer-events: none;
}

/* Seats Header */
#seats-header {
  color: #fff;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#btnBack {
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

/* Sector Card Styles */
.sector-card {
  border: 1px solid transparent;
  border-bottom-color: #ddd;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.sector-card:hover,
.sector-card.hovered-card {
  background: var(--page);
  border: 1px solid var(--primary-color);
}

.sector-name {
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--title);
}

.sector-price {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
}

.sector-description {
  font-size: 14px;
  font-weight: bold;
}

.sector-installment {
  color: var(--primary-color, #3b82f6);
  font-size: 13px;
  margin-top: 4px;
  font-weight: 500;
}

/* Polygon Sector Styles */
polygon.sta-sector {
  fill: #3b82f6;
  stroke: none;
  opacity: 0;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

polygon.sta-sector.hovered {
  fill: #f13737;
  stroke: #fff;
  opacity: 0.6;
  stroke-width: 2;
}

/* Seats View */
svg.svg-view {
  width: 100%;
  height: 100%;
  display: flex;
  align-self: center;
}

svg#sector-seats {
  display: none;
}

/* Individual Seat Styles */
.seat {
  r: 10;
  cursor: pointer;
  stroke: #333;
  stroke-width: 0;
}

.unavailable { fill: #a1a1a1; cursor: not-allowed; }
.available { fill: #10b981; }
.available:hover {
  fill: #ddd;
  transition: all 0.2s ease-in-out;
}
.sold { fill: #ef4444; }
.held { fill: #f59e0b; }
.selected {
  fill: #3b82f6;
  stroke: #1e40af;
  stroke-width: 2;
}

.seat-variation-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.note {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
}

.tooltip .header {
  padding: 8px 15px 3px 15px;
  text-transform: uppercase;
  font-weight: bold;
}

.tooltip .name {
  color: #0A0B11;
  font-size: 14px;
}

.tooltip .code {
  font-size: 18px;
  color: black;
}

/* Legend */
#seat-legend {
  display: flex;
  justify-content: flex-end;
  gap: 25px;
  padding: 15px;
  margin-top: auto;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.legend-svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.legend-svg .seat {
  r: 8;
}

.seat-map-container.sticky-legend #seat-legend {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-radius: 8px 8px 0 0;
}

/* Selected Seats */
#selected-seats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

#selected-seats-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 5px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

#selected-seats-list li .seat-info {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}

#selected-seats-list li select.seat-variation-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  padding: 6px 8px;
}

#selected-seats-list li .remove-seat-btn {
  cursor: pointer;
  height: 20px;
  flex-shrink: 0;
  fill: #00000a;
  transition: fill 0.2s ease-in-out;
}

#selected-seats-list li .remove-seat-btn:hover {
  fill: #d32f2f;
}


.remove-seat-btn {
  cursor: pointer;
  fill: #999;
  transition: fill 0.2s ease-in-out;
  flex-shrink: 0;
  margin-left: 15px;
}

.remove-seat-btn:hover {
  fill: #ef4444;
}

.container {
  width: 100%;
}

/* =====================
   RESPONSIVIDADE
===================== */

/* Tablets */
@media (max-width: 991px) {
  .seat-map-container {
    flex-direction: column;
    height: auto;
  }

  #seat-map-main {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    max-height: 250px;
    order: 2;
  }

  #main {
    order: 1;
    min-height: 400px;
  }
}

/* Celulares */
@media (max-width: 576px) {
  .seat-map-container {
    border-radius: 0;
  }

  #sidebar {
    padding: 15px;
    font-size: 14px;
  }

  #seats-header {
    font-size: 13px;
    padding: 10px;
  }

  #btnBack {
    font-size: 12px;
    padding: 4px 10px;
  }

  .sector-card {
    padding: 10px;
    font-size: 13px;
  }

  .sector-price, .sector-installment {
    font-size: 12px;
  }

  #seat-legend {
    flex-direction: column;
    gap: 10px;
  }
}

.mobile-tutorial {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  text-align: center;
  transition: opacity .4s ease;
}

.mobile-tutorial .tutorial-content {
  max-width: 280px;
  padding: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.mobile-tutorial .gesture-icon {
  width: 80px;
  height: auto;
  margin-bottom: 16px;
  opacity: 0.9;
}

.mobile-tutorial .text-green { color: #22c55e; font-weight: 600; }

.mobile-tutorial .tutorial-btn {
  margin-top: 16px;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .2s;
}

.mobile-tutorial .tutorial-btn:hover {
  background: #fff;
  color: #000;
}
