:root {
  --bg-primary: #080d1a;
  --bg-secondary: rgba(15, 23, 42, 0.65);
  --bg-card: rgba(30, 41, 59, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --success: #10b981;
  --success-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --success-glow: rgba(16, 185, 129, 0.2);

  --warning: #f59e0b;
  --warning-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --warning-glow: rgba(245, 158, 11, 0.2);

  --danger: #f43f5e;
  --danger-gradient: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  --danger-glow: rgba(244, 63, 94, 0.2);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --font-sans: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 40px;
  position: relative;
}

/* Background Glowing Orbs */
.glow-orb {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.15;
}

.orb-1 {
  background: #6366f1;
  top: -10vw;
  right: -10vw;
  animation: floatOrb 20s infinite alternate;
}

.orb-2 {
  background: #a855f7;
  bottom: -15vw;
  left: -10vw;
  animation: floatOrb 25s infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, 5%) scale(1.1); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header & Logo */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 5%;
  background: rgba(8, 13, 26, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: var(--text-primary);
  background: var(--primary-gradient);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-icon {
  width: 18px;
  height: 18px;
}

/* Main Content Wrapper */
.app-content {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 24px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layout Grid */
.content-card, .scanner-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.content-card h2, .scanner-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.content-card p, .scanner-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

/* Scanner Layout */
.scanner-card {
  max-width: 600px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.camera-container-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 24px 0;
  background: #020617;
  border: 1px solid var(--border);
}

#scanner-viewport-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#reader {
  width: 100%;
  height: 100%;
}

/* Clean standard HTML5 QR Code styles overrides */
#reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Laser animation line */
.scanner-laser {
  position: absolute;
  width: 100%;
  height: 3px;
  background: var(--primary);
  box-shadow: 0 0 15px 3px var(--primary);
  top: 0;
  left: 0;
  animation: laserScan 2.5s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* Scanner corner guides */
.scanner-guide {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--primary);
  border-style: solid;
  border-width: 0;
}

.scanner-guide.tl { top: 20px; left: 20px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.scanner-guide.tr { top: 20px; right: 20px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.scanner-guide.bl { bottom: 20px; left: 20px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.scanner-guide.br { bottom: 20px; right: 20px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }

.scanner-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

/* Controls & Inputs */
.form-select, .form-input, .form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--danger-gradient);
  color: var(--text-primary);
  box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.btn-danger-hover:hover {
  background: var(--danger-gradient) !important;
  color: white !important;
  box-shadow: 0 4px 15px var(--danger-glow);
  border-color: transparent !important;
}

.btn-tab {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-tab.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Result Card */
.result-card {
  max-width: 600px;
  margin: 24px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.result-card.hidden {
  display: none !important;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-icon-wrapper {
  flex-shrink: 0;
}

.result-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
}

.result-icon svg {
  width: 28px;
  height: 28px;
}

.result-icon.success {
  background: var(--success-gradient);
  box-shadow: 0 0 15px var(--success-glow);
}

.result-icon.warning {
  background: var(--warning-gradient);
  box-shadow: 0 0 15px var(--warning-glow);
}

.result-icon.error {
  background: var(--danger-gradient);
  box-shadow: 0 0 15px var(--danger-glow);
}

.result-card.success-border { border-color: var(--success); }
.result-card.warning-border { border-color: var(--warning); }
.result-card.error-border { border-color: var(--danger); }

.result-details h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.result-details p {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.timestamp {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
}

.stat-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
}

.stat-indicator.total { background: var(--primary-gradient); }
.stat-indicator.success { background: var(--success-gradient); }
.stat-indicator.pending { background: var(--warning-gradient); }

.progress-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-ring-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-percentage-text {
  position: absolute;
  font-size: 1rem;
  font-weight: 700;
}

.progress-ring-bar {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 201.06; /* 2 * PI * 32 */
  stroke-dashoffset: 201.06;
  transition: stroke-dashoffset 0.5s ease-out;
}

/* List Table controls */
.card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.search-bar-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-bar-wrapper .form-input {
  padding-left: 44px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.filter-group {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 20px;
  font-size: 0.95rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 30px;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-scanned {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.action-icon-btn.btn-check-toggle:hover {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.action-icon-btn.btn-delete:hover {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* Import / Generator Layout */
.import-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-import-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.file-upload-wrapper {
  position: relative;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#qr-results-wrapper {
  margin-top: 40px;
  animation: fadeIn 0.4s ease-out forwards;
}

#qr-results-wrapper.hidden {
  display: none !important;
}

.results-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* QR Code Grid */
.qr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.qr-card {
  background: #ffffff;
  color: #0b0f19;
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  position: relative;
}

.qr-card:hover {
  transform: translateY(-4px);
}

.qr-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 4px;
  color: #0f172a;
  word-break: break-word;
}

.qr-card-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 16px;
}

.qr-placeholder {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 8px;
}

.qr-card .btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Global Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: white;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: toastIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.25) forwards;
  transition: opacity 0.3s ease;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.9); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Helpers & Utilities */
.text-success { color: var(--success) !important; }
.text-pending { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.hidden { display: none !important; }

/* PRINT STYLES - Optimized for Ticket printing */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .glow-orb, .app-header, .scanner-card, #scanner-section, 
  #list-section, .import-container, .results-header-actions,
  .toast-container, .qr-card .btn, .logo, .nav-tabs {
    display: none !important;
  }

  .app-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #generator-section, #qr-results-wrapper {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .qr-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    padding: 10px !important;
    background: transparent !important;
  }

  .qr-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px dashed #cccccc !important;
    border-radius: 4px !important;
    padding: 15px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    transform: none !important;
  }

  .qr-card-title {
    font-size: 0.9rem !important;
    margin-top: 10px !important;
    margin-bottom: 2px !important;
    color: #000000 !important;
  }

  .qr-card-subtitle {
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
  }

  .qr-placeholder {
    width: 110px !important;
    height: 110px !important;
    background: transparent !important;
  }

  .qr-placeholder canvas, .qr-placeholder img {
    width: 110px !important;
    height: 110px !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 16px;
    padding: 12px 16px;
  }

  .nav-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .app-content {
    margin-top: 20px;
    padding: 0 16px;
  }

  .content-card {
    padding: 20px;
  }

  .card-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar-wrapper {
    max-width: 100%;
  }

  .filter-group {
    justify-content: space-around;
  }

  .card-footer {
    flex-direction: column;
  }

  .card-footer .btn {
    width: 100%;
  }

  .file-upload-wrapper, .file-upload-wrapper label {
    width: 100%;
  }
}

/* ==========================================
   Aula Magna Seat Map & Modal Styles
   ========================================== */
.map-header {
  margin-bottom: 24px;
}

.map-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.selected-seat-info {
  flex-grow: 1;
  max-width: 600px;
  animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.25) forwards;
}

.selected-seat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  width: 100%;
}

.selected-seat-card.empty {
  border-style: dashed;
}

.selected-seat-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 10px var(--primary-glow);
  flex-shrink: 0;
}

.selected-seat-badge.available {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  box-shadow: none;
  border: 1px solid var(--border);
}

.selected-seat-badge.info {
  background: var(--warning-gradient);
  box-shadow: 0 0 10px var(--warning-glow);
}

.selected-seat-details {
  flex-grow: 1;
}

.selected-seat-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.selected-seat-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-seat-actions {
  display: flex;
  gap: 8px;
}

.selected-seat-actions .btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Aula Magna Main Layout */
.aula-magna-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  margin-bottom: 24px;
  overflow-x: auto;
  position: relative;
}

/* Stage */
.stage-section {
  width: 100%;
  max-width: 500px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.stage-podium {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
  position: relative;
}

.stage-podium::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--primary-gradient);
  box-shadow: 0 0 10px var(--primary);
}

/* Professors Section */
.professors-section {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  margin-bottom: 30px;
  gap: 40px;
  flex-shrink: 0;
}

.professors-block {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.prof-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.prof-capacity {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Seating Area */
.seating-area {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  margin-bottom: 30px;
  flex-shrink: 0;
}

.seats-matrix-wrapper {
  padding: 0 20px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: 40px repeat(14, 20px) 16px repeat(14, 20px) 40px;
  grid-row-gap: 12px;
  grid-column-gap: 4px;
  align-items: center;
  justify-items: center;
}

.matrix-row-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1rem;
  user-select: none;
}

.matrix-aisle {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Matrix Seat */
.matrix-seat {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.seat-number-label {
  display: none;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
}

.matrix-seat:hover {
  transform: scale(1.3);
  z-index: 10;
}

.matrix-seat.available {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
}

.matrix-seat.available:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--text-secondary);
}

.matrix-seat.occupied {
  background: var(--primary-gradient);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 5px var(--primary-glow);
}

.matrix-seat.occupied:hover {
  box-shadow: 0 0 10px var(--primary);
}

.matrix-seat.checked-in {
  background: var(--success-gradient);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 5px var(--success-glow);
}

.matrix-seat.checked-in:hover {
  box-shadow: 0 0 10px var(--success);
}

.matrix-seat.selected {
  outline: 2px solid white;
  outline-offset: 2px;
  transform: scale(1.2);
}

.matrix-seat.searched-highlight {
  animation: pulseHighlight 1.5s infinite;
  outline: 2px solid var(--warning);
  outline-offset: 2px;
  z-index: 10;
}

@keyframes pulseHighlight {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8); }
  70% { transform: scale(1.25); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Responsive seats with number labels */
@media (min-width: 1200px) {
  .matrix-grid {
    grid-template-columns: 40px repeat(14, 26px) 24px repeat(14, 26px) 40px;
    grid-column-gap: 6px;
  }
  .matrix-seat {
    width: 26px;
    height: 26px;
  }
  .seat-number-label {
    display: block;
  }
}

/* Balcony */
.balcony-section {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.balcony-block {
  width: 100%;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
}

.balcony-label {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Legend */
.map-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-color.seat-available { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border); }
.legend-color.seat-occupied { background: var(--primary-gradient); }
.legend-color.seat-checked { background: var(--success-gradient); }
.legend-color.seat-highlighted { outline: 2px solid var(--warning); background: var(--primary-gradient); }

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  position: relative;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-qr-card {
  background: white !important;
  color: #0f172a !important;
  width: 100% !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.modal-qr-card .qr-card-title {
  color: #0f172a !important;
  font-size: 1.25rem !important;
  margin-top: 12px;
}

.modal-qr-card .qr-card-subtitle {
  color: #475569 !important;
}

/* Print styles adjustment for map */
@media print {
  #map-section {
    display: none !important;
  }
}

