/* Header & Navigation */
.header {
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  min-height: 3.5rem;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  text-decoration: none;
  margin-right: 1rem;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

.navbar-nav .nav-item {
  margin: 0;
}

/* Mobile Navigation */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.5rem;
  height: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--gray-700);
  border-radius: 1px;
  transition: all 0.2s ease;
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--white);
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 100;
  padding: 1rem;
}

.nav-mobile.active {
  transform: translateX(0);
}

.nav-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.nav-mobile-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
  padding: 0.25rem;
  border-radius: var(--border-radius);
  transition: all 0.15s ease;
}

.nav-mobile-close:hover {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.nav-mobile .navbar-nav {
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.nav-mobile .nav-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 0.25rem;
  text-align: left;
  font-weight: 500;
}

/* Main Content */
.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

@media (min-width: 768px) {
  .main-content.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
  }
  .main-content.center-content > .container {
    width: 100%;
  }
}

/* Cards */
.card {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: 1fr;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Bootstrap-style responsive grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.col-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

@media (max-width: 575.98px) {
  .col-4,
  .col-6,
  .col-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Recipe Cards */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.recipe-card {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.recipe-card:hover {
  box-shadow: var(--box-shadow-hover);
  border-color: var(--gray-300);
}

.recipe-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.recipe-card-content {
  padding: 1rem;
}

.recipe-card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.25;
}

.recipe-card-title a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.recipe-card-title a:hover {
  color: var(--primary-color);
}

.recipe-card-meta {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.recipe-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  border: 1px solid transparent;
}

.badge.bg-success {
  background-color: var(--success-color);
  color: var(--white);
}

.badge.bg-secondary {
  background-color: var(--gray-600);
  color: var(--white);
}

.badge.bg-danger {
  background-color: var(--danger-color);
  color: var(--white);
}

/* Footer */
.footer {
  background-color: var(--gray-800);
  color: var(--gray-300);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer .container {
  text-align: center;
}

/* Essential Recipe Classes */
.recipe-metadata-number {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  border: 1px solid transparent;
}

.status-badge.public {
  background-color: var(--success-color);
  color: var(--white);
}

.status-badge.private {
  background-color: var(--gray-600);
  color: var(--white);
}

.status-badge.owned {
  background-color: #0ea5e9;
  color: var(--white);
}

.status-badge.shared {
  background-color: #f59e0b;
  color: var(--white);
}

.recipe-header-layout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.recipe-image-container {
  flex-shrink: 0;
}

.recipe-info-container {
  flex-grow: 1;
}

.recipe-title-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Forms */
.centered-form-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.form-card {
  width: 100%;
  max-width: 42rem;
}

.welcome-message {
  background-color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  text-align: center;
}

.auth-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Typography */
.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--gray-600);
}

.text-primary {
  color: var(--primary-color);
}

/* Visual effects */
.rounded {
  border-radius: var(--border-radius);
}

.shadow {
  box-shadow: var(--box-shadow);
}

/* Utility classes */
.d-flex {
  display: flex;
}

.d-block {
  display: block;
}

.d-none {
  display: none;
}

.form-row {
  flex-direction: column;
}

/* Inline style replacements - moved from HTML to CSS */

/* Common flex layouts */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.button-group {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.recipe-header-layout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.recipe-image-container {
  flex-shrink: 0;
}

.recipe-info-container {
  flex-grow: 1;
}

.recipe-title-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.recipe-author-info {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}



/* Form layouts */
.centered-form-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.form-card {
  width: 100%;
  max-width: 42rem;
}

.form-section {
  margin-bottom: 1rem;
}

.form-section-large {
  margin-bottom: 2rem;
}

.full-width {
  width: 100%;
}

.text-center {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Recipe layout */
.recipe-layout-grid {
  display: flex;
  gap: 1.5rem;
}

.recipe-ingredients-section {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.recipe-content-section {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

/* Recipe content */
.instruction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.recipe-ingredients-list li {
  margin-bottom: 0.5rem;
}

/* Card layouts */
.recipe-detail-card {
  margin-bottom: 2rem;
}

.collaborator-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.collaborator-info {
  display: flex;
  gap: 0.5rem;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--gray-400);
  margin-bottom: 1.5rem;
}

/* Lists and margins */
.no-margin-bottom {
  margin-bottom: 0;
}

.margin-bottom-small {
  margin-bottom: 0.5rem;
}

.margin-bottom-large {
  margin-bottom: 2rem;
}

.margin-top-large {
  margin-top: 3rem;
}

.margin-top-medium {
  margin-top: 1.5rem;
}

/* Recipe grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .navbar {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .recipe-layout-grid {
    flex-direction: column;
  }

  .recipe-ingredients-section,
  .recipe-content-section {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Mobile page header layout */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Mobile button group layout */
  .button-group {
    justify-content: space-between;
    width: 100%;
  }

  /* Mobile author info */
  .recipe-author-info {
    text-align: center;
    margin-top: 0;
  }

  /* Mobile metadata layout */
  .recipe-metadata {
    justify-content: space-around;
    margin-bottom: 2rem;
  }

  /* Mobile title and badge layout */
  .recipe-title-section {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .form-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .recipe-card-actions {
    flex-direction: column;
  }

  .header .container {
    padding: 0.5rem 1rem;
  }
}