/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Button Components */
.btn {
  display: inline-block;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #d1d5db;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #9ca3af;
}

.btn-success {
  background-color: #059669;
  color: white;
}

.btn-success:hover {
  background-color: #047857;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-gray {
  background-color: #4b5563;
  color: white;
}

.btn-gray:hover {
  background-color: #374151;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* Card Components */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.card-hover {
  transition: box-shadow 0.2s;
}

.card-hover:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 1.5rem;
}

.card-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Form Components */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-select {
  background-color: white;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggc3Ryb2tlPSIjNmI3MjgwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41IiBkPSJtNiA4IDQgNCA0LTQiLz48L3N2Zz4=");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.form-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.form-error-title {
  font-weight: 500;
  color: #991b1b;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.form-error-list {
  color: #dc2626;
  font-size: 0.875rem;
  margin: 0;
  padding-left: 1rem;
  list-style-type: disc;
}

.form-error-list li {
  margin-bottom: 0.25rem;
}

/* Flash Message Components */
.flash {
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.flash-notice {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.flash-alert {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Navigation Components */
.nav-link {
  color: #6b7280;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link.active {
  color: #2563eb;
}

/* Mobile Navigation */
.mobile-menu-toggle {
  display: none;
}

.mobile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.mobile-menu-button:hover {
  color: #2563eb;
  background-color: #f3f4f6;
}

.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: currentColor;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 50;
}

.mobile-menu-content {
  padding: 1rem 0;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  border-left: 4px solid transparent;
}

.mobile-nav-link:hover {
  background-color: #f3f4f6;
  color: #2563eb;
}

.mobile-nav-link.active {
  color: #2563eb;
  background-color: #eff6ff;
  border-left-color: #2563eb;
}

/* Show mobile menu when checkbox is checked */
.mobile-menu-toggle:checked ~ .mobile-menu {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Animate hamburger to X when menu is open */
.mobile-menu-toggle:checked ~ .mobile-menu-button .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle:checked ~ .mobile-menu-button .hamburger span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle:checked ~ .mobile-menu-button .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Consistent Page Layout Components */
.page-container {
  max-width: 72rem;
  margin: 0 auto;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.page-title {
  font-size: 1.875rem;
  font-weight: bold;
  color: #111827;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .page-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) {
  .page-title {
    font-size: 2.5rem;
  }
}

/* Consistent Content Cards */
.content-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.content-card-hover {
  transition: box-shadow 0.2s ease;
}

.content-card-hover:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-padding {
  padding: 1rem;
}

@media (min-width: 640px) {
  .card-padding {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .card-padding {
    padding: 2rem;
  }
}

/* Consistent Button Styles */
.btn-primary {
  background-color: #2563eb;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  color: white;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease;
}

.btn-secondary:hover {
  background-color: #4b5563;
  color: white;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease;
}

.btn-danger:hover {
  background-color: #b91c1c;
  color: white;
}

.btn-full-mobile {
  width: 100%;
}

@media (min-width: 640px) {
  .btn-full-mobile {
    width: auto;
  }
}

/* Icon Buttons */
.btn-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-icon-gray {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-icon-gray:hover {
  background-color: #e5e7eb;
}

.btn-icon-danger {
  background-color: #fecaca;
  color: #dc2626;
}

.btn-icon-danger:hover {
  background-color: #fca5a5;
}

/* Recipe Components */
.recipe-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .recipe-meta {
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

.recipe-meta-item {
  text-align: center;
  min-width: 0;
}

.recipe-meta-value {
  font-size: 1.25rem;
  font-weight: bold;
  display: block;
}

@media (min-width: 640px) {
  .recipe-meta-value {
    font-size: 1.5rem;
  }
}

.recipe-meta-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  word-break: break-word;
}

@media (min-width: 640px) {
  .recipe-meta-label {
    font-size: 0.875rem;
  }
}

.recipe-ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.recipe-ingredient-item span {
  word-break: break-word;
}

.recipe-step {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .recipe-step {
    gap: 1rem;
  }
}

.recipe-step-number {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  background-color: #2563eb;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

@media (min-width: 640px) {
  .recipe-step-number {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
    margin-top: 0;
  }
}

.recipe-step-content {
  color: #374151;
  line-height: 1.6;
  word-break: break-word;
  flex: 1;
}
