/* Custom styles for Food Diary App */

body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Keep your existing logo styles */
.logo {
  width: 130px;
  margin: auto;
}

.banner {
  width: 80%;
  margin: auto;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: bold;
}

.navbar-brand i {
  color: #ffc107;
}

.jumbotron {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 4rem 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  margin-bottom: 1rem;
}

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

.btn-primary {
  background-color: #28a745;
  border-color: #28a745;
}

.btn-primary:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.alert {
  border-radius: 0.5rem;
  border: none;
}

.form-control {
  border-radius: 0.5rem;
}

.btn {
  border-radius: 0.5rem;
}

/* Food diary specific styles */
.meal-card {
  margin-bottom: 1rem;
}

.nutrition-info {
  background-color: #e9ecef;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.meal-type-badge {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* Error pages */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: bold;
  color: #dc3545;
}

/* Update dropdown styles for Bootstrap 5 */
.dropdown-menu {
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown-item {
  border-radius: 0.375rem;
  margin: 0.125rem;
}

.dropdown-item:hover {
  background-color: #28a745;
  color: white;
}

/* Barcode Scanner Styles */
.barcode-scanner-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-height: 300px;
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 0 auto;
}

.barcode-scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
}

.scanner-reticle {
  width: 250px;
  height: 100px;
  border: 2px solid #28a745;
  border-radius: 8px;
  position: relative;
  margin-bottom: 2rem;
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.scanner-reticle::before,
.scanner-reticle::after {
  content: '';
  position: absolute;
  background: #28a745;
}

/* Corner indicators */
.scanner-reticle::before {
  top: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.scanner-reticle::after {
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.scanner-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #28a745, transparent);
  animation: scannerLine 2s linear infinite;
}

@keyframes scannerLine {
  0% { transform: translateY(-50px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(50px); opacity: 0; }
}

.scanner-instructions {
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.scanner-instructions p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.manual-barcode-entry {
  padding: 2rem;
  text-align: center;
  background: white;
  border-radius: 0.5rem;
}

.manual-barcode-entry h5 {
  color: #495057;
  margin-bottom: 1.5rem;
}

/* QuaggaJS Canvas Styling */
#barcode-scanner canvas {
  width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem;
}

#barcode-scanner video {
  width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem;
}

/* Scanner Modal Styles */
.scanner-modal .modal-dialog {
  max-width: 600px;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .barcode-scanner-container {
    min-height: 250px;
  }
  
  .scanner-reticle {
    width: 200px;
    height: 80px;
  }
  
  .scanner-instructions p {
    font-size: 1rem;
  }
  
  .manual-barcode-entry {
    padding: 1rem;
  }
}

/* Scanner Status Indicators */
.scanner-status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
}

.scanner-status.scanning {
  color: #28a745;
}

.scanner-status.error {
  color: #dc3545;
}

.scanner-status.success {
  color: #28a745;
}

/* Loading Animation */
.scanner-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: #f8f9fa;
  border-radius: 0.5rem;
}

.scanner-loading i {
  color: #28a745;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .barcode-scanner-container {
    min-height: 250px;
  }
  
  .scanner-reticle {
    width: 200px;
    height: 80px;
  }
}