/**
 * @file
 * Recipe Management Styles
 * Product Calculator Improved Module
 * Drupal 10 Compatible
 */

/* ======================================
   RECIPE MANAGEMENT SECTION
   ====================================== */

.recipe-management-section {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border-left: 4px solid #0066cc;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.1);
  transition: all 0.3s ease;
}

.recipe-management-section:hover {
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

/* Fieldset styling within recipe management */
.recipe-management-section fieldset {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fafafa;
  transition: border-color 0.3s ease;
}

.recipe-management-section fieldset:last-child {
  margin-bottom: 0;
}

.recipe-management-section fieldset:hover {
  border-color: #0066cc;
  background-color: #f9f9f9;
}

/* Fieldset legend styling */
.recipe-management-section legend {
  padding: 0 10px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* ======================================
   RECIPE SELECTOR DROPDOWN
   ====================================== */

.recipe-selector-dropdown {
  min-width: 300px;
  max-width: 100%;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #ffffff;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.recipe-selector-dropdown:hover {
  border-color: #0066cc;
  background-color: #f0f7ff;
}

.recipe-selector-dropdown:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.recipe-selector-dropdown:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ======================================
   BUTTON STYLES (SAVE & DELETE)
   ====================================== */

.save-recipe-btn,
.delete-recipe-btn {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin-top: 10px;
  margin-right: 10px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.5;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.save-recipe-btn:last-child,
.delete-recipe-btn:last-child {
  margin-right: 0;
}

/* ======================================
   SAVE RECIPE BUTTON
   ====================================== */

.save-recipe-btn {
  background-color: #28a745;
  color: white;
}

.save-recipe-btn:hover {
  background-color: #218838;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
  transform: translateY(-2px);
}

.save-recipe-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.save-recipe-btn:active {
  background-color: #1e7e34;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.save-recipe-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* ======================================
   DELETE RECIPE BUTTON
   ====================================== */

.delete-recipe-btn {
  background-color: #dc3545;
  color: white;
}

.delete-recipe-btn:hover {
  background-color: #c82333;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
  transform: translateY(-2px);
}

.delete-recipe-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.delete-recipe-btn:active {
  background-color: #bd2130;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.delete-recipe-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* ======================================
   FORM INPUTS IN RECIPE SECTION
   ====================================== */

.recipe-management-section input[type="text"],
.recipe-management-section input[type="number"],
.recipe-management-section select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: #ffffff;
  color: #333;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.recipe-management-section input[type="text"]:hover,
.recipe-management-section input[type="number"]:hover,
.recipe-management-section select:hover {
  border-color: #0066cc;
  background-color: #f0f7ff;
}

.recipe-management-section input[type="text"]:focus,
.recipe-management-section input[type="number"]:focus,
.recipe-management-section select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  background-color: #ffffff;
}

.recipe-management-section input[type="text"]:disabled,
.recipe-management-section input[type="number"]:disabled,
.recipe-management-section select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ======================================
   FORM LABELS
   ====================================== */

.recipe-management-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.recipe-management-section .form-group {
  margin-bottom: 15px;
}

/* ======================================
   STATUS MESSAGES
   ====================================== */

.recipe-management-section .messages {
  margin-bottom: 15px;
  padding: 12px 15px;
  border-radius: 4px;
  border-left: 4px solid;
}

.recipe-management-section .messages.status {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.recipe-management-section .messages.error {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.recipe-management-section .messages.warning {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */

/* Tablet devices (768px - 1023px) */
@media (max-width: 1023px) {
  .recipe-management-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .recipe-selector-dropdown {
    min-width: 250px;
  }

  .save-recipe-btn,
  .delete-recipe-btn {
    padding: 10px 18px;
    font-size: 13px;
    min-height: 40px;
  }
}

/* Mobile devices (< 768px) */
@media (max-width: 767px) {
  .recipe-management-section {
    padding: 12px;
    margin-bottom: 15px;
    border-left-width: 3px;
  }

  .recipe-management-section fieldset {
    padding: 12px;
    margin-bottom: 12px;
  }

  .recipe-selector-dropdown {
    min-width: 100%;
    display: block;
    width: 100%;
  }

  .recipe-management-section input[type="text"],
  .recipe-management-section input[type="number"],
  .recipe-management-section select {
    width: 100%;
    display: block;
    margin-bottom: 10px;
  }

  .save-recipe-btn,
  .delete-recipe-btn {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
    width: 100%;
    display: block;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .save-recipe-btn:last-child,
  .delete-recipe-btn:last-child {
    margin-bottom: 0;
  }

  /* Stack legend text better on mobile */
  .recipe-management-section legend {
    font-size: 13px;
    padding: 0 5px;
  }
}

/* Small mobile devices (< 480px) */
@media (max-width: 479px) {
  .recipe-management-section {
    padding: 10px;
  }

  .recipe-management-section fieldset {
    padding: 10px;
  }

  .save-recipe-btn,
  .delete-recipe-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 38px;
  }

  .recipe-management-section label {
    font-size: 12px;
  }
}

/* ======================================
   HIGH CONTRAST & ACCESSIBILITY
   ====================================== */

/* High contrast mode support */
@media (prefers-contrast: more) {
  .recipe-management-section {
    border-left-width: 5px;
    box-shadow: inset 0 0 0 1px #0066cc;
  }

  .save-recipe-btn,
  .delete-recipe-btn {
    border: 2px solid;
  }

  .save-recipe-btn {
    border-color: #1e7e34;
  }

  .delete-recipe-btn {
    border-color: #bd2130;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .recipe-management-section {
    background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    color: #e0e0e0;
  }

  .recipe-management-section fieldset {
    background-color: #1a1a1a;
    border-color: #444;
  }

  .recipe-management-section fieldset legend {
    color: #e0e0e0;
  }

  .recipe-selector-dropdown,
  .recipe-management-section input[type="text"],
  .recipe-management-section input[type="number"],
  .recipe-management-section select {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #444;
  }

  .recipe-selector-dropdown:focus,
  .recipe-management-section input[type="text"]:focus,
  .recipe-management-section input[type="number"]:focus,
  .recipe-management-section select:focus {
    background-color: #242424;
  }

  .recipe-management-section label {
    color: #e0e0e0;
  }
}

/* ======================================
   PRINT STYLES
   ====================================== */

@media print {
  .recipe-management-section {
    page-break-inside: avoid;
    border: 1px solid #999;
    box-shadow: none;
  }

  .save-recipe-btn,
  .delete-recipe-btn {
    display: none;
  }
}