/* QR Scanner Page Styles - Fixed Wide Screen */
.scanner-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.scanner-controls {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}

.control-group label {
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.control-group select {
  padding: 10px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
  min-height: 44px;
}

.control-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-buttons {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.btn-primary,
.btn-secondary {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(30, 41, 59, 0.3);
}

.btn-secondary {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Scanner View - Full Screen */
.scanner-view {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.scanner-frame {
  position: relative;
  width: 300px;
  height: 300px;
  border: 3px solid #1e293b;
  border-radius: 12px;
  margin: 0 auto;
  overflow: hidden; /* Ensure video stays within bounds */
  display: flex; /* Use flexbox to center content */
  align-items: center;
  justify-content: center;
}

.corner-guide {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid #1e293b;
}

.corner-guide.top-left {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-radius: 12px 0 0 0;
}

.corner-guide.top-right {
  top: -3px;
  right: -3px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 12px 0 0;
}

.corner-guide.bottom-left {
  bottom: -3px;
  left: -3px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 12px;
}

.corner-guide.bottom-right {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 12px 0;
}

.scan-instructions {
  position: absolute;
  bottom: 10px; /* Adjust position to be inside the frame */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 2; /* Ensure instructions are above the video */
}

.scan-instructions p {
  margin: 0;
}

.scanner-frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px; /* Adjust size as needed */
  height: 150px; /* Adjust size as needed */
  border: 2px dashed rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  z-index: 1; /* Above video, below corner guides */
  border-radius: 8px;
}

#reader {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
  overflow: hidden;
}

#reader__scan_region {
  width: 100% !important;
  height: 100% !important;
  position: relative;
}

#reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 12px;
}

#reader__dashboard_section {
  display: none; /* Hide the dashboard section if not needed */
}

/* Manual Entry - Full Screen */
.manual-entry {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.manual-entry h3 {
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.manual-entry p {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-group label {
  color: #333;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  min-height: 44px;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Scan History - Full Screen */
.scan-history {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.scan-history h3 {
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #1e293b;
  width: 100%;
}

.history-info {
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

.history-actions {
  display: flex;
  gap: 8px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  opacity: 0.7;
}

/* Scan Result Content - Full Screen */
.scan-result-content {
  padding: 20px;
  width: 100%;
}

.result-success {
  text-align: center;
  margin-bottom: 24px;
}

.result-success i {
  font-size: 48px;
  color: #28a745;
  margin-bottom: 16px;
}

.result-success h3 {
  color: #2c3e50;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.patient-details {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  text-align: left;
  margin-bottom: 20px;
}

.patient-details h3 {
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e5e9;
}

.patient-details p {
  margin: 8px 0;
  color: #333;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.patient-details p strong {
  color: #2c3e50;
  flex-basis: 40%; /* Adjust as needed */
}

.patient-details p span {
  flex-basis: 55%; /* Adjust as needed */
  text-align: right;
}

.vaccination-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.vaccination-item {
  background: #e9ecef;
  padding: 12px 15px;
  border-radius: 6px;
  border-left: 3px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vaccination-item p {
  margin: 0;
  font-size: 13px;
  color: #495057;
}

.vaccination-item p strong {
  color: #2c3e50;
}

.no-vaccinations {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 10px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

/* Error Modal Content - Full Screen */
.error-content {
  padding: 20px;
  text-align: center;
  width: 100%;
}

.error-icon {
  margin-bottom: 20px;
}

.error-icon i {
  font-size: 48px;
  color: #e74c3c;
}

.error-content h3 {
  color: #2c3e50;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.error-content p {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Responsive Design - Full Screen with Monitor Size Adaptation */
@media (min-width: 1920px) {
  /* Large monitors */
  .scanner-controls,
  .scanner-view,
  .manual-entry,
  .scan-history {
    padding: 40px;
    gap: 30px;
  }

  .scanner-frame {
    width: 400px;
    height: 400px;
  }

  .form-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
}

@media (min-width: 1440px) and (max-width: 1919px) {
  /* Standard desktop monitors */
  .form-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }

  .scanner-frame {
    width: 350px;
    height: 350px;
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  /* Medium desktop monitors */
  .form-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .scanner-frame {
    width: 320px;
    height: 320px;
  }
}

@media (max-width: 1023px) {
  /* Small desktop and tablets */
  .form-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  /* Tablets and mobile */
  .scanner-container {
    gap: 15px;
  }

  .scanner-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 20px;
  }

  .control-buttons {
    margin-left: 0;
    justify-content: center;
  }

  .scanner-view {
    min-height: 350px;
    padding: 20px;
  }

  .scanner-frame {
    width: 250px;
    height: 250px;
  }

  .manual-entry,
  .scan-history {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  /* Mobile devices */
  .scanner-controls,
  .scanner-view,
  .manual-entry,
  .scan-history {
    padding: 15px;
  }

  .scanner-view {
    min-height: 300px;
  }

  .scanner-frame {
    width: 200px;
    height: 200px;
  }

  .corner-guide {
    width: 20px;
    height: 20px;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
  }

  .scan-instructions {
    bottom: 15px;
    padding: 6px 12px;
  }

  .scan-instructions p {
    font-size: 11px;
  }
}
