/* Bottom Navigation Styles */
.bottom-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  z-index: 1000;
  padding: 8px 0 12px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.bottom-nav-menu {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 400px;
  margin: 0 auto;
}

.bottom-nav-item {
  flex: 1;
  text-align: center;
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #6c757d;
  transition: all 0.3s ease;
  padding: 8px 4px;
  border-radius: 8px;
  min-height: 60px;
  justify-content: center;
}

.bottom-nav-link:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

.bottom-nav-link.active {
  color: #007bff !important;
  background-color: rgba(0, 123, 255, 0.1) !important;
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  fill: currentColor;
  transition: all 0.3s ease;
}

.bottom-nav-text {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

/* Active state styling */
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
  color: #007bff !important;
}

.bottom-nav-item.active .bottom-nav-text {
  font-weight: 600;
  color: #007bff !important;
}

.bottom-nav-item.active .bottom-nav-link {
  color: #007bff !important;
  background-color: rgba(0, 123, 255, 0.1) !important;
}

/* High specificity override for any conflicting styles */
body .bottom-navigation .bottom-nav-item.active .bottom-nav-link,
body .bottom-navigation .bottom-nav-link.active {
  color: #007bff !important;
  background-color: rgba(0, 123, 255, 0.1) !important;
}

body .bottom-navigation .bottom-nav-item.active .bottom-nav-icon,
body .bottom-navigation .bottom-nav-link.active .bottom-nav-icon {
  color: #007bff !important;
}

body .bottom-navigation .bottom-nav-item.active .bottom-nav-text,
body .bottom-navigation .bottom-nav-link.active .bottom-nav-text {
  color: #007bff !important;
  font-weight: 600 !important;
}

/* Ultra high specificity override */
html body .bottom-navigation .bottom-nav-item.active .bottom-nav-link,
html body .bottom-navigation .bottom-nav-link.active {
  color: #007bff !important;
  background-color: rgba(0, 123, 255, 0.15) !important;
  border: 1px solid rgba(0, 123, 255, 0.3) !important;
}

html body .bottom-navigation .bottom-nav-item.active .bottom-nav-icon,
html body .bottom-navigation .bottom-nav-link.active .bottom-nav-icon {
  color: #007bff !important;
  transform: scale(1.1) !important;
}

html body .bottom-navigation .bottom-nav-item.active .bottom-nav-text,
html body .bottom-navigation .bottom-nav-link.active .bottom-nav-text {
  color: #007bff !important;
  font-weight: 700 !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .bottom-nav-container {
    padding: 0 8px;
  }

  .bottom-nav-text {
    font-size: 11px;
  }

  .bottom-nav-icon {
    width: 22px;
    height: 22px;
  }
}

/* Ensure content doesn't get hidden behind bottom nav */
body.has-bottom-navigation {
  padding-bottom: 80px;
}

/* Hide on desktop if needed */
@media (min-width: 768px) {
  .bottom-navigation {
    display: none;
  }

  body.has-bottom-navigation {
    padding-bottom: 0;
  }
}

/* Show only on mobile */
@media (max-width: 767px) {
  .bottom-navigation {
    display: block;
  }
}

/* QR Scanner Modal */
.qr-scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-scanner-modal.active {
  display: flex;
}

.qr-scanner-container {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.qr-scanner-header {
  padding: 16px;
  background: #007bff;
  color: white;
  text-align: center;
  font-weight: 600;
}

.qr-scanner-video {
  width: 100%;
  height: 300px;
  background: #000;
  display: block;
}

.qr-scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.qr-scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid #007bff;
  border-radius: 8px;
  background: transparent;
}

.qr-scanner-frame::before,
.qr-scanner-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #007bff;
}

.qr-scanner-frame::before {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
}

.qr-scanner-frame::after {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
}

.qr-scanner-controls {
  padding: 20px;
  text-align: center;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-scanner-btn {
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-scanner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qr-scanner-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* QR Scan Button - Primary Action */
.qr-scan-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.qr-scan-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* QR Stop Button - Secondary Action */
.qr-stop-btn {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.qr-stop-btn:hover {
  background: linear-gradient(135deg, #e0a800 0%, #e55a00 100%);
  box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

/* QR Close Button - Danger Action */
.qr-close-btn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.qr-close-btn:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* QR Button Icons */
.qr-btn-icon {
  font-size: 18px;
  display: inline-block;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: bold;
}

/* Scan button icon animation */
.qr-scan-btn .qr-btn-icon {
  animation: pulse 2s infinite;
}

/* Stop button icon animation */
.qr-stop-btn .qr-btn-icon {
  animation: shake 1s infinite;
}

/* Close button icon - ensure visibility */
.qr-close-btn .qr-btn-icon {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 20px;
  font-weight: 900;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.qr-scanner-result {
  padding: 16px;
  background: #e9ecef;
  border-top: 1px solid #dee2e6;
  text-align: center;
  font-family: monospace;
  word-break: break-all;
}

.qr-scanner-error {
  padding: 16px;
  background: #f8d7da;
  color: #721c24;
  border-top: 1px solid #f5c6cb;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .qr-scanner-controls {
    padding: 16px;
    gap: 10px;
  }

  .qr-scanner-btn {
    padding: 16px 20px;
    font-size: 18px;
    min-height: 52px;
  }

  .qr-btn-icon {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .qr-scanner-controls {
    padding: 12px;
    gap: 8px;
  }

  .qr-scanner-btn {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
  }

  .qr-btn-icon {
    font-size: 18px;
  }
}
