/* ==========================================================================
   BILETBAS - Kapı Personeli & QR Tarayıcı Stilleri (scanner.css)
   ========================================================================== */

.controller-login-card {
  max-width: 440px;
  margin: 40px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.controller-login-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px auto;
}

.ctrl-session-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ctrl-user-tag, .ctrl-event-tag {
  font-size: 13px;
  color: #cbd5e1;
}

.gate-network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

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

.gate-network-badge.offline {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

.controller-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.ctrl-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-mini-corp {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* Scanner Layout */
.scanner-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.scanner-camera-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.scanner-viewfinder {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrReaderArea {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

#qrReaderArea video {
  object-fit: cover !important;
  border-radius: var(--radius-md);
}

.scanner-laser {
  display: none;
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 3px;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e, 0 0 20px #22c55e;
  z-index: 10;
  animation: laserScan 2s infinite ease-in-out;
}

.scanner-viewfinder.active .scanner-laser {
  display: block;
}

@keyframes laserScan {
  0% { top: 10%; opacity: 0.8; }
  50% { top: 85%; opacity: 1; }
  100% { top: 10%; opacity: 0.8; }
}

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

.scanner-status {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.manual-search-box {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.scanner-results-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gate-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-mini-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-mini-card .stat-val {
  font-size: 18px;
  font-weight: 800;
  display: block;
}

.stat-mini-card .stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.scan-result-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.scan-result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.scan-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.scan-icon.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 2px solid #10b981;
}

.scan-icon.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 2px solid #f59e0b;
}

.scan-icon.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 2px solid #ef4444;
}

.result-title {
  font-size: 20px;
  margin-bottom: 4px;
}

.result-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.scan-result-card.success-card {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.scan-result-card.warning-card {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(30, 41, 59, 0.9) 100%);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.scan-result-card.danger-card {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(30, 41, 59, 0.9) 100%);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.35);
}

.participant-highlight-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.part-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.part-row:last-child {
  border-bottom: none;
}

.part-label {
  color: var(--text-muted);
  font-weight: 600;
}

.part-name {
  font-size: 16px;
  color: #fff;
}

.scan-timestamp {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

@media (max-width: 860px) {
  .scanner-container {
    grid-template-columns: 1fr;
  }
  .gate-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
