/* ==========================================================================
   TicketMart Modern Ticket & Confirmation Stylesheet
   Covers Movies & Comedy Shows (Confirmation & Ticket View pages)
   ========================================================================== */

:root {
  --tm-primary: #08538a;
  --tm-primary-hover: #063e68;
  --tm-accent: #f59e0b;
  --tm-success: #10b981;
  --tm-success-bg: #ecfdf5;
  --tm-success-border: #a7f3d0;
  --tm-bg-page: #f8fafc;
  --tm-card-bg: #ffffff;
  --tm-ticket-dark-1: #0b192c;
  --tm-ticket-dark-2: #1e3e62;
  --tm-ticket-dark-3: #112845;
  --tm-text-dark: #0f172a;
  --tm-text-muted: #64748b;
  --tm-border-light: #e2e8f0;
  --tm-shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --tm-shadow-ticket: 0 20px 45px -10px rgba(11, 25, 44, 0.35);
  --tm-radius-lg: 20px;
  --tm-radius-md: 12px;
  --tm-radius-sm: 8px;
}

/* Page Container */
.tm-ticket-section {
  background-color: var(--tm-bg-page);
  min-height: 80vh;
  padding: 35px 0 60px 0;
  font-family: inherit;
}

/* Success Confirmation Banner */
.tm-confirmation-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #dcfce7 100%);
  border: 1px solid var(--tm-success-border);
  border-radius: var(--tm-radius-lg);
  padding: 22px 28px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tm-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

.tm-banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.tm-banner-text {
  flex: 1;
}

.tm-badge-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #d1fae5;
  color: #065f46;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 30px;
  margin-bottom: 6px;
}

.tm-badge-confirmed .tm-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: tmPulse 1.8s infinite;
}

@keyframes tmPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tm-banner-title {
  font-size: 20px;
  font-weight: 700;
  color: #064e3b;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.tm-banner-subtitle {
  font-size: 13.5px;
  color: #047857;
  margin: 0;
}

.tm-banner-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.tm-ref-box {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: var(--tm-radius-md);
  padding: 10px 18px;
  text-align: right;
}

.tm-ref-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.tm-ref-val {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--tm-primary);
  font-family: monospace;
}

/* Page Header for Multi-Ticket View */
.tm-ticket-header-bar {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.tm-ticket-header-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--tm-text-dark);
  margin: 0;
}

.tm-ticket-header-sub {
  font-size: 14px;
  color: var(--tm-text-muted);
  margin: 4px 0 0 0;
}

/* Booking Item Container */
.tm-booking-item {
  margin-bottom: 40px;
}

.tm-booking-item:last-child {
  margin-bottom: 0;
}

/* 2-Column Responsive Layout Grid */
.tm-ticket-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 991px) {
  .tm-ticket-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ==========================================================================
   LEFT CARD: DIGITAL TICKET PASS (VIP CINEMA / COMEDY PASS)
   ========================================================================== */
.tm-ticket-card {
  background: linear-gradient(155deg, var(--tm-ticket-dark-1) 0%, var(--tm-ticket-dark-2) 100%);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow-ticket);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ticket Top Header */
.tm-ticket-top {
  padding: 28px 30px 20px 30px;
  position: relative;
}

.tm-ticket-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tm-type-badge {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tm-ticket-status {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tm-ticket-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.25;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tm-ticket-venue {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tm-ticket-venue i {
  color: var(--tm-accent);
  font-size: 14px;
}

/* Specs Matrix */
.tm-ticket-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 575px) {
  .tm-ticket-specs {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.tm-spec-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--tm-radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.tm-spec-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tm-spec-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  word-break: break-word;
}

/* Seat Tags Box */
.tm-seats-box {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--tm-radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-seats-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tm-seat-pill {
  background: #ffffff;
  color: var(--tm-text-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tm-seat-pill.gold {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.tm-seat-pill.silver {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.tm-seat-pill.diamond {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.tm-seat-pill.platinum {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.tm-seat-pill.bronze {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.tm-seat-pill.recliner {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Comedy Perks Inclusions Container */
.tm-ticket-perks {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--tm-radius-md);
  padding: 12px 14px;
}

.tm-perks-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tm-perks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-perk-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tm-perk-chip .tm-perk-qty {
  background: var(--tm-accent);
  color: #78350f;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Perforated Divider (Tear-off ticket stub effect) */
.tm-perforation {
  position: relative;
  height: 28px;
  background: var(--tm-ticket-dark-3);
  display: flex;
  align-items: center;
  margin: 0;
  overflow: visible;
}

.tm-perforation::before,
.tm-perforation::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: var(--tm-bg-page);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.tm-perforation::before {
  left: -12px;
}

.tm-perforation::after {
  right: -12px;
}

.tm-perforation-line {
  width: calc(100% - 48px);
  margin: 0 auto;
  border-top: 2px dashed rgba(255, 255, 255, 0.22);
}

/* Bottom Ticket Stub (QR Section & Download Button) */
.tm-ticket-bottom {
  background-color: var(--tm-ticket-dark-3);
  padding: 24px 30px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  justify-content: space-between;
}

.tm-stub-content {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

@media (max-width: 575px) {
  .tm-stub-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

.tm-qr-frame {
  width: 140px;
  height: 140px;
  background: #ffffff;
  padding: 8px;
  border-radius: var(--tm-radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.tm-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tm-stub-info {
  flex: 1;
}

.tm-stub-scan-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 575px) {
  .tm-stub-scan-title {
    justify-content: center;
  }
}

.tm-stub-scan-desc {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.tm-booking-id-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: var(--tm-radius-sm);
  font-size: 13px;
  color: #e2e8f0;
}

.tm-booking-id-tag strong {
  color: var(--tm-accent);
  font-family: monospace;
  font-size: 14px;
}

/* Download Ticket Button */
.tm-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tm-btn-download {
  flex: 1;
  min-width: 200px;
  background: linear-gradient(135deg, #0284c7 0%, var(--tm-primary) 100%);
  color: #ffffff !important;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  padding: 13px 22px;
  border-radius: var(--tm-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transition: all 0.25s ease;
  border: none;
}

.tm-btn-download:hover {
  background: linear-gradient(135deg, #0369a1 0%, #063e68 100%);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.45);
}

.tm-btn-download:active {
  transform: translateY(0);
}

.tm-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1 !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 18px;
  border-radius: var(--tm-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tm-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff !important;
}

/* ==========================================================================
   RIGHT CARD: ORDER & PAYMENT BREAKDOWN SUMMARY
   ========================================================================== */
.tm-summary-card {
  background-color: var(--tm-card-bg);
  border: 1px solid var(--tm-border-light);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.tm-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tm-border-light);
}

.tm-summary-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--tm-text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-summary-title i {
  color: var(--tm-primary);
}

.tm-summary-badge {
  background-color: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* Price Breakdown Table */
.tm-breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.tm-breakdown-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.tm-breakdown-table tr:last-child {
  border-bottom: none;
}

.tm-breakdown-table td {
  padding: 10px 0;
  font-size: 13.5px;
  vertical-align: middle;
}

.tm-breakdown-label {
  color: #475569;
  font-weight: 500;
}

.tm-breakdown-label .tm-sub-count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: normal;
}

.tm-breakdown-val {
  text-align: right;
  color: var(--tm-text-dark);
  font-weight: 700;
  white-space: nowrap;
}

.tm-breakdown-tax {
  color: #64748b;
  font-size: 12.5px;
}

/* Highlighted Total Box */
.tm-total-box {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--tm-radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.tm-total-label-wrap {
  display: flex;
  flex-direction: column;
}

.tm-total-label {
  font-size: 14px;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tm-total-subtext {
  font-size: 11px;
  color: #0284c7;
  margin-top: 2px;
}

.tm-total-amount {
  font-size: 22px;
  font-weight: 800;
  color: #0c4a6e;
  font-family: inherit;
}

/* State & Policies Section */
.tm-summary-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--tm-border-light);
  padding-top: 16px;
}

.tm-state-info {
  font-size: 12.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tm-state-info strong {
  color: var(--tm-primary);
  font-weight: 700;
}

.tm-guarantee-note {
  font-size: 12px;
  color: #059669;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--tm-radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-guarantee-note i {
  font-size: 14px;
  flex-shrink: 0;
}

/* Empty State */
.tm-empty-state {
  background: #ffffff;
  border-radius: var(--tm-radius-lg);
  border: 1px solid var(--tm-border-light);
  box-shadow: var(--tm-shadow-card);
  padding: 60px 20px;
  text-align: center;
  max-width: 540px;
  margin: 30px auto;
}

.tm-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px auto;
}

.tm-empty-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--tm-text-dark);
  margin-bottom: 8px;
}

.tm-empty-text {
  font-size: 14px;
  color: var(--tm-text-muted);
  margin-bottom: 24px;
}

/* ==========================================================================
   Responsive Polish
   ========================================================================== */
@media (max-width: 767px) {
  .tm-ticket-section {
    padding: 20px 0 40px 0;
  }

  .tm-confirmation-banner {
    padding: 16px 18px;
    gap: 14px;
  }

  .tm-banner-left {
    min-width: 100%;
  }

  .tm-banner-right {
    width: 100%;
    justify-content: flex-start;
  }

  .tm-ref-box {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .tm-ticket-top {
    padding: 20px 20px 16px 20px;
  }

  .tm-ticket-title {
    font-size: 20px;
  }

  .tm-ticket-bottom {
    padding: 20px 20px 24px 20px;
  }

  .tm-summary-card {
    padding: 20px;
  }
}
