/* GessPass Custom Styles */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Global Styles */
body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #f5f7fa;
}

/* Navigation */
.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%) !important;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 100px 100px;
  animation: float 20s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* Analytics Dashboard Styles */
.analytics-dashboard {
  background-color: #f8f9fa;
}

.summary-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.summary-card .card-body {
  padding: 2rem;
}

.summary-metric {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.summary-label {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-change {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.summary-change.positive {
  color: var(--success-color);
}

.summary-change.negative {
  color: var(--danger-color);
}

.summary-change.neutral {
  color: var(--secondary-color);
}

.pass-performance-card {
  background: white;
  border: none;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.pass-performance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.pass-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.pass-date {
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-item {
  text-align: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 10px;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.performance-bar {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.performance-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--success-color) 0%, var(--primary-color) 100%);
}

.performance-fill.low {
  background: linear-gradient(90deg, var(--danger-color) 0%, #e74c3c 100%);
}

.performance-fill.medium {
  background: linear-gradient(90deg, var(--warning-color) 0%, #f39c12 100%);
}

.performance-fill.high {
  background: linear-gradient(90deg, var(--success-color) 0%, #27ae60 100%);
}

.performance-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-excellent {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--success-color);
}

.status-good {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
}

.status-average {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
}

.status-poor {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* Pass Performance Accordion Styles */
.pass-accordion-item {
  border: 1px solid #e9ecef;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}

.pass-accordion-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pass-accordion-btn {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  padding: 1rem 1.25rem;
  border: none;
}

.pass-accordion-btn:not(.collapsed) {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  box-shadow: none;
}

.pass-accordion-btn:focus {
  box-shadow: none;
  border-color: transparent;
}

.pass-accordion-btn::after {
  transition: transform 0.3s ease;
}

.pass-header-metrics {
  align-items: center;
}

.header-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.header-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.header-metric-label {
  font-size: 0.7rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.accordion-body {
  background-color: #fff;
  border-top: 1px solid #e9ecef;
}

@media (max-width: 576px) {
  .pass-accordion-btn {
    padding: 0.75rem 1rem;
  }
  
  .pass-header-metrics {
    gap: 0.5rem !important;
    margin-top: 0.5rem;
  }
  
  .header-metric {
    min-width: 40px;
  }
  
  .header-metric-value {
    font-size: 0.95rem;
  }
  
  .header-metric-label {
    font-size: 0.65rem;
  }
  
  .pass-title {
    max-width: 150px !important;
  }
}

.insights-panel {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
  border-radius: 15px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.insights-title {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.insights-title i {
  margin-right: 0.5rem;
}

.insight-item {
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--secondary-color);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dee2e6;
}

.empty-state h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .summary-card .card-body {
    padding: 1.5rem;
  }
  
  .summary-metric {
    font-size: 2rem;
  }
  
  .performance-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .metric-item {
    padding: 0.5rem;
  }
  
  .metric-value {
    font-size: 1.2rem;
  }
  
  .insights-panel {
    padding: 1rem;
  }
}

/* Phase 4: Offline Verification Status Indicators */
.connection-banner {
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid;
  transition: all 0.3s ease;
}

.connection-banner.online {
  background-color: #d1f2eb;
  border-color: #a7d7c7;
  color: #0f5132;
}

.connection-banner.offline {
  background-color: #fff3cd;
  border-color: #ffe69c;
  color: #664d03;
}

.connection-banner.reconnecting {
  background-color: #cce5ff;
  border-color: #99ccff;
  color: #004085;
}

.status-indicator {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-indicator.online {
  background-color: #198754;
  color: white;
}

.status-indicator.offline {
  background-color: #ffc107;
  color: #000;
}

.status-indicator.reconnecting {
  background-color: #0dcaf0;
  color: #000;
}

/* QR Verification Result Overlays */
.qr-verification-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: verificationPulse 0.5s ease-out;
}

.qr-verification-result.success {
  background-color: #198754;
  color: white;
}

.qr-verification-result.warning {
  background-color: #ffc107;
  color: #000;
}

.qr-verification-result.error {
  background-color: #dc3545;
  color: white;
}

.qr-verification-result.info {
  background-color: #0dcaf0;
  color: #000;
}

@keyframes verificationPulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* QR Status Indicator Updates */
.qr-status-indicator {
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
  display: inline-block;
  transition: all 0.3s ease;
}

.qr-status-indicator.success {
  background-color: #d1f2eb;
  color: #0f5132;
  border: 1px solid #a7d7c7;
}

.qr-status-indicator.warning {
  background-color: #fff3cd;
  color: #664d03;
  border: 1px solid #ffe69c;
}

.qr-status-indicator.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f0a3ab;
}

.qr-status-indicator.info {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #99ccff;
}

/* Cards */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-header {
  border-bottom: none;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.5rem;
  border-radius: 15px 15px 0 0 !important;
}

.card-body {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
  box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Forms */
.form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.input-group-text {
  border-radius: 10px 0 0 10px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #e9ecef;
  border-right: none;
}

/* Progress Bars */
.progress {
  border-radius: 10px;
  overflow: hidden;
  background-color: #e9ecef;
}

.progress-bar {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  transition: width 0.6s ease;
}

/* Badges */
.badge {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
}

/* Tables */
.table {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.table thead th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 1rem;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
  transform: scale(1.02);
}

.table tbody td {
  padding: 1rem;
  border: none;
  border-bottom: 1px solid #e9ecef;
}

/* Alerts */
.alert {
  border-radius: 15px;
  border: none;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.alert-success {
  background: linear-gradient(135deg, #d1e7dd 0%, #a3d9a4 100%);
  color: #0f5132;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f1a1a8 100%);
  color: #721c24;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #664d03;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #9fdbef 100%);
  color: #055160;
}

/* Modals */
.modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  border-radius: 20px 20px 0 0;
  border-bottom: none;
  padding: 2rem 2rem 1rem;
}

.modal-body {
  padding: 1rem 2rem;
}

.modal-footer {
  border-top: none;
  padding: 1rem 2rem 2rem;
}

/* QR Scanner Styles - Enhanced with Real-time Feedback */
#qr-video-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

#qr-video {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Enhanced QR Scanning Overlay */
.qr-scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.qr-target-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
}

/* Animated Corner Brackets */
.qr-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--primary-color);
}

.qr-corner-tl {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 5px;
}

.qr-corner-tr {
  top: -2px;
  right: -2px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 5px;
}

.qr-corner-bl {
  bottom: -2px;
  left: -2px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 5px;
}

.qr-corner-br {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 5px;
}

/* Animated Scan Line */
.qr-scan-line {
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  animation: scan-line 2s linear infinite;
  opacity: 0.8;
}

@keyframes scan-line {
  0% { top: 10%; opacity: 1; }
  50% { opacity: 0.3; }
  100% { top: 85%; opacity: 1; }
}

/* Pulse Animation During Scanning */
.qr-scan-overlay.scanning-pulse .qr-target-box {
  animation: scan-pulse 0.3s ease-out;
}

@keyframes scan-pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Success Animation */
.qr-scan-overlay.scan-success .qr-target-box {
  border-color: #28a745;
  box-shadow: 0 0 30px rgba(40, 167, 69, 0.8);
  animation: success-flash 0.5s ease-in-out;
}

.qr-scan-overlay.scan-success .qr-corner {
  border-color: #28a745;
  animation: success-glow 0.5s ease-in-out;
}

@keyframes success-flash {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes success-glow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 15px rgba(40, 167, 69, 0.6); }
}

/* Status Indicator */
.qr-status-indicator {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 15;
  transition: all 0.3s ease;
}

.qr-status-indicator.status-scanning {
  background: rgba(13, 110, 253, 0.9);
  animation: status-pulse 2s infinite;
}

.qr-status-indicator.status-success {
  background: rgba(40, 167, 69, 0.9);
}

.qr-status-indicator.status-error {
  background: rgba(220, 53, 69, 0.9);
}

.qr-status-indicator.status-warning {
  background: rgba(255, 193, 7, 0.9);
  color: #000;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Performance Display */
.qr-performance-display {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 12px;
  z-index: 15;
  min-width: 250px;
}

.scan-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scan-metrics .metric {
  display: flex;
  align-items: center;
  font-size: 11px;
}

.scan-metrics .metric i {
  margin-right: 4px;
  font-size: 10px;
}

/* Legacy QR Overlay for backward compatibility */
#qr-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--primary-color);
  width: 200px;
  height: 200px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 20px rgba(13, 110, 253, 0.5); }
  50% { box-shadow: 0 0 30px rgba(13, 110, 253, 0.8); }
  100% { box-shadow: 0 0 20px rgba(13, 110, 253, 0.5); }
}

/* Enhanced Help System & Error Messages - Phase 2 */

/* Help Tooltips */
.help-tooltip {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 20;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: tooltip-fadeIn 0.3s ease;
}

.help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.help-tooltip-error {
  background: rgba(220, 53, 69, 0.95);
}

.help-tooltip-error::after {
  border-top-color: rgba(220, 53, 69, 0.95);
}

@keyframes tooltip-fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Interactive Help Overlay */
.qr-help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlay-fadeIn 0.3s ease;
}

.help-content {
  background: white;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.help-header {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.help-header h5 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
}

.help-body {
  padding: 0 20px;
}

.help-section {
  margin-bottom: 20px;
}

.help-section h6 {
  color: #495057;
  margin-bottom: 10px;
  font-weight: 600;
}

.help-section ul {
  margin: 0;
  padding-left: 20px;
}

.help-section li {
  margin-bottom: 8px;
  color: #6c757d;
}

.help-footer {
  padding: 0 20px 20px;
  text-align: right;
  border-top: 1px solid #e9ecef;
  margin-top: 20px;
  padding-top: 15px;
}

/* Contextual Help Banners */
.contextual-help {
  position: absolute;
  top: -80px;
  left: 0;
  right: 0;
  background: rgba(13, 110, 253, 0.95);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 15;
  animation: help-slideDown 0.4s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.contextual-help-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}

.contextual-help-info {
  background: rgba(13, 110, 253, 0.95);
}

.contextual-help-warning {
  background: rgba(255, 193, 7, 0.95);
  color: #000;
}

.contextual-help-error {
  background: rgba(220, 53, 69, 0.95);
}

.contextual-help-success {
  background: rgba(40, 167, 69, 0.95);
}

.contextual-help-tip {
  background: rgba(102, 16, 242, 0.95);
}

.contextual-help-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.contextual-help-close:hover {
  opacity: 1;
}

@keyframes help-slideDown {
  from { 
    opacity: 0; 
    transform: translateY(-20px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

@keyframes overlay-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Enhanced Error Display */
.error-display {
  background: white;
  border: 2px solid #dc3545;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

.error-display .error-title {
  color: #dc3545;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.error-display .error-message {
  color: #495057;
  margin-bottom: 15px;
  font-size: 14px;
}

.error-display .troubleshooting-steps {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.error-display .troubleshooting-steps h6 {
  color: #495057;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.error-display .troubleshooting-steps ol {
  margin: 0;
  padding-left: 20px;
  color: #6c757d;
}

.error-display .troubleshooting-steps li {
  margin-bottom: 8px;
  font-size: 13px;
}

.error-display .recovery-action {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.error-display .recovery-action:hover {
  background: #0056b3;
}

/* Help Button */
.qr-help-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 15;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-help-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Mobile Camera Enhancements - Phase 3 */

/* Focus Indicator Animation */
@keyframes focus-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
    border-color: var(--primary-color);
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Mobile Camera Controls */
.mobile-camera-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.mobile-controls-panel {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 30px;
  padding: 10px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  pointer-events: all;
  margin-bottom: 8px;
}

.mobile-control-btn {
  background: none;
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 18px;
  position: relative;
}

.mobile-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.mobile-control-btn:active {
  transform: scale(0.95);
}

.mobile-control-btn.active {
  background: rgba(255, 193, 7, 0.2);
  border: 2px solid #ffc107;
}

.mobile-control-indicator {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 6px;
  min-width: 40px;
  text-align: center;
}

.mobile-gesture-hints {
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 15px;
  padding: 6px 12px;
  backdrop-filter: blur(5px);
  pointer-events: all;
}

.mobile-gesture-hints small {
  font-size: 11px;
  line-height: 1.2;
}

/* Mobile Full-Screen Mode */
.mobile-qr-scanning {
  overflow: hidden;
}

.mobile-qr-scanning .navbar,
.mobile-qr-scanning .breadcrumb {
  display: none;
}

.mobile-qr-scanning #qr-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #000;
}

.mobile-qr-scanning #qr-video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  border-radius: 0;
}

/* Touch Gesture Areas */
#qr-video-container {
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

/* Enhanced Mobile QR Target */
@media (max-width: 768px) {
  .qr-target-box {
    width: min(250px, 60vw);
    height: min(250px, 60vw);
  }
  
  .qr-scan-line {
    animation-duration: 1.5s;
  }
  
  .qr-corner {
    width: 25px;
    height: 25px;
    border-width: 4px;
  }
}

/* Mobile Status Indicators */
@media (max-width: 768px) {
  .qr-status-indicator {
    font-size: 14px;
    padding: 8px 16px;
    top: -50px;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  
  .qr-performance-display {
    min-width: 90vw;
    font-size: 12px;
    bottom: -60px;
    left: 5vw;
    transform: none;
  }
}

/* Mobile Vibration Feedback Class */
.vibration-feedback {
  animation: vibration-pulse 0.2s ease-in-out;
}

@keyframes vibration-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Enhanced Mobile Camera Container */
@media (max-width: 768px) {
  #camera-container {
    position: relative;
    width: 100%;
    max-width: none;
  }
  
  #qr-video-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  
  #qr-video {
    border-radius: 20px;
  }
}

/* Mobile-Optimized Buttons */
@media (max-width: 768px) {
  #start-scan-btn, #stop-scan-btn {
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
    padding: 12px 24px;
  }
  
  .qr-help-button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

/* Mobile Dashboard Enhancements */
@media (max-width: 768px) {
  #scan-dashboard .card {
    margin: 15px 0;
    border-radius: 15px;
  }
  
  #scan-dashboard .card-body {
    padding: 16px;
  }
  
  .metric-display {
    padding: 12px;
  }
  
  .metric-value {
    font-size: 22px;
    margin-bottom: 6px;
  }
  
  .metric-label {
    font-size: 11px;
  }
}

/* Mobile Help System Adjustments */
@media (max-width: 768px) {
  .help-content {
    width: 95%;
    margin: 20px;
    border-radius: 20px;
  }
  
  .help-header, .help-body, .help-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .contextual-help {
    font-size: 13px;
    border-radius: 12px;
  }
  
  .error-display {
    margin: 15px 0;
    padding: 16px;
    border-radius: 15px;
  }
}

/* Mobile Portrait/Landscape Adjustments */
@media (max-width: 768px) and (orientation: portrait) {
  .mobile-controls-panel {
    flex-direction: row;
    padding: 12px 20px;
  }
  
  .mobile-gesture-hints {
    display: block;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .mobile-camera-controls {
    right: 20px;
    left: auto;
    bottom: 50%;
    transform: translateY(50%);
  }
  
  .mobile-controls-panel {
    flex-direction: column;
    padding: 16px 12px;
  }
  
  .mobile-control-btn {
    margin: 4px 0;
  }
  
  .mobile-gesture-hints {
    display: none; /* Hide hints in landscape to save space */
  }
}

/* High DPI Mobile Displays */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
  .qr-target-box {
    border-width: 3px;
  }
  
  .qr-corner {
    border-width: 5px;
  }
  
  .mobile-control-btn {
    font-size: 20px;
  }
}

/* Mobile Dark Mode Support */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .mobile-controls-panel {
    background: rgba(20, 20, 20, 0.95);
  }
  
  .mobile-control-indicator {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
  }
  
  .mobile-gesture-hints {
    background: rgba(20, 20, 20, 0.8);
  }
}

/* Accessibility Enhancements for Mobile */
@media (max-width: 768px) {
  .mobile-control-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  .mobile-control-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

/* Battery Optimization Mode */
.battery-saver-mode .qr-scan-line {
  animation-duration: 3s; /* Slower animation */
}

.battery-saver-mode .qr-corner {
  animation: none; /* Disable corner animations */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .mobile-control-btn {
    transition: none;
  }
  
  .qr-scan-line {
    animation: none;
  }
  
  .focus-pulse {
    animation: none;
  }
  
  .mobile-camera-controls {
    animation: none;
  }
}

/* Original Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .qr-target-box {
    width: min(250px, 60vw);
    height: min(250px, 60vw);
  }
  
  .qr-status-indicator {
    font-size: 14px;
    padding: 8px 16px;
  }
  
  .qr-performance-display {
    min-width: 90vw;
    font-size: 12px;
  }
  
  .scan-metrics .metric {
    font-size: 11px;
  }
  
  .help-content {
    width: 95%;
    margin: 20px;
  }
  
  .help-header, .help-body, .help-footer {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .contextual-help {
    font-size: 13px;
  }
  
  .error-display {
    margin: 10px 0;
    padding: 15px;
  }
}

/* Portal-specific Styles */
.portal-business .card-header { background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%); color: white; }
.portal-promoter .card-header { background: linear-gradient(135deg, #198754 0%, #146c43 100%); color: white; }
.portal-staff .card-header { background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%); color: #664d03; }
.portal-guest .card-header { background: linear-gradient(135deg, #0dcaf0 0%, #31d2f2 100%); color: #055160; }

/* Dashboard Widgets */
.dashboard-widget {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.dashboard-widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.dashboard-widget h3 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dashboard-widget .icon {
  font-size: 3rem;
  opacity: 0.8;
}

/* Analytics Charts */
.chart-container {
  position: relative;
  height: 300px;
  margin: 2rem 0;
}

/* Guest Claim Styles */
.promotion-value {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  border: 3px dashed var(--success-color);
  text-align: center;
  transition: all 0.3s ease;
}

.promotion-value:hover {
  transform: scale(1.05);
}

.promotion-value .display-4 {
  background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* Step indicators */
.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.step-number:hover {
  transform: scale(1.1);
}

/* Loading States */
.spinner-border {
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

/* Footer */
footer {
  margin-top: auto;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .dashboard-widget {
    padding: 1.5rem;
  }
  
  .dashboard-widget h3 {
    font-size: 2rem;
  }
  
  #qr-overlay {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding: 0.5rem;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section .lead {
    font-size: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .promotion-value {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  .promotion-value .display-4 {
    font-size: 2rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --dark-color: #f8f9fa;
    --light-color: #212529;
  }
  
  body {
    background-color: #1a1d20;
    color: var(--dark-color);
  }
  
  .card {
    background-color: #2d3338;
    color: var(--dark-color);
  }
  
  .table {
    background-color: #2d3338;
    color: var(--dark-color);
  }
  
  .form-control {
    background-color: #2d3338;
    border-color: #495057;
    color: var(--dark-color);
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .modal,
  footer {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 3px solid rgba(13, 110, 253, 0.5);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid;
  }
  
  .btn {
    border: 2px solid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Message timestamp styles for WCAG AA compliance */
.message-timestamp {
  font-size: 0.75rem;
  display: inline-flex;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.message-timestamp--green {
  color: #000000;
}

.message-timestamp--blue {
  color: #000000;
}

.message-timestamp--light {
  color: #495057;
}
