/* ============================================
   Brand Color System — Red / Rose / Pink
   ============================================ */
:root {
  --brand-primary: #e11d48;
  --brand-primary-hover: #be123c;
  --brand-primary-dark: #9f1239;
  --brand-primary-light: #fda4af;
  --brand-primary-bg: #fff1f2;
  --brand-primary-rgb: 225, 29, 72;
  --brand-navbar: linear-gradient(135deg, #9f1239 0%, #881337 100%);
}

/* Bootstrap primary overrides */
.btn-primary {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus-visible {
  background-color: var(--brand-primary-hover) !important;
  border-color: var(--brand-primary-hover) !important;
}
.btn-primary:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--brand-primary-rgb), 0.35) !important;
}
.btn-outline-primary {
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-outline-primary:hover, .btn-outline-primary:active {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
}
.bg-primary {
  background-color: var(--brand-primary) !important;
}
.bg-info {
  background-color: #f43f5e !important;
  color: #fff !important;
}
.text-primary {
  color: var(--brand-primary) !important;
}
.border-primary {
  border-color: var(--brand-primary) !important;
}
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.list-group-item) {
  color: var(--brand-primary);
}
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.list-group-item):hover {
  color: var(--brand-primary-hover);
}

/* Prevent flash of unstyled content */
html {
  font-size: 14px;
  visibility: visible;
  opacity: 1;
}

/* Ensure smooth transitions */
body, .container, .card {
  opacity: 1;
  transition: none;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brand-primary);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: var(--brand-primary-bg);
}

/* ============================================
   Navbar — Dark Burgundy Gradient
   ============================================ */
.navbar.navbar-brand-theme {
  background: var(--brand-navbar);
  border-bottom: none;
}
.navbar.navbar-brand-theme .navbar-brand,
.navbar.navbar-brand-theme .nav-link {
  color: rgba(255,255,255,.9) !important;
}
.navbar.navbar-brand-theme .navbar-brand:hover,
.navbar.navbar-brand-theme .nav-link:hover {
  color: #fff !important;
}
.navbar.navbar-brand-theme .navbar-toggler {
  border-color: rgba(255,255,255,.3);
}
.navbar.navbar-brand-theme .navbar-toggler-icon {
  filter: invert(1);
}
.navbar.navbar-brand-theme .dropdown-menu {
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
}
.navbar.navbar-brand-theme .dropdown-item {
  color: #333;
}
.navbar.navbar-brand-theme .dropdown-item:hover {
  background-color: var(--brand-primary-bg);
  color: var(--brand-primary);
}
.navbar.navbar-brand-theme .dropdown-item.active {
  background-color: var(--brand-primary);
  color: #fff;
}

/* Main menu button styling */
.btn-lg {
  padding: 15px;
  font-size: 1.1rem;
}

/* Food Ingredients styles */
.card {
  border-radius: 10px;
}

img.border {
  border: 2px solid #dee2e6 !important;
}

img:hover {
  opacity: 0.9;
}

/* Item row filtering */
.item-row.filtered-out {
  display: none;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Loading Spinner Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--brand-primary);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner-container {
  text-align: center;
  color: white;
}

.loading-spinner-container p {
  margin-top: 15px;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Inline loading spinner for buttons */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Table row hover highlighting */
.table tbody tr {
  transition: background-color 0.15s ease-in-out;
}

.table tbody tr:hover {
  background-color: rgba(var(--brand-primary-rgb), 0.06);
  cursor: pointer;
}

/* Enhanced table styling */
.table thead th {
  background-color: var(--brand-primary-hover);
  color: white;
  border: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Tooltip styling */
[data-bs-toggle="tooltip"] {
  cursor: help;
  border-bottom: 1px dotted #6c757d;
}

/* Footer */
.footer {
  background-color: #fff;
}

/* Breadcrumb accent */
.breadcrumb-item a {
  color: var(--brand-primary) !important;
}
.breadcrumb-item a:hover {
  color: var(--brand-primary-hover) !important;
}
