/* Enhanced Customizer Page Styles */

.customizer-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Modern Title Styles */
.modern-title {
  font-family: var(--font-headline) !important;
  font-weight: var(--font-weight-semibold) !important;
  font-size: var(--font-size-headline) !important;
  color: #fff !important;
  text-align: center;
  margin-bottom: 30px !important;
  line-height: var(--line-height-tight);
}

.section-title {
  font-family: var(--font-headline) !important;
  font-weight: var(--font-weight-semibold) !important;
  font-size: var(--font-size-subheadline) !important;
  color: #2c3e50 !important;
  margin-bottom: 20px !important;
  line-height: var(--line-height-tight);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 14px;
  background-color: #f8f9fa;
  padding: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/*.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 3px;
  background: #3498db;
  border-radius: 2px;
}*/

/* Card-based layout */
.customizer-section {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  padding: 25px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Dark mode styling for customizer cards */
body.dark-mode .customizer-section {
  background-color: #121212 !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

body.dark-mode .customizer-section:hover {
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.15);
}

.customizer-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Section headers */
.customizer-section h2 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/*.customizer-section h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 24px;
  background-color: #000;
  margin-right: 12px;
  border-radius: 4px;
}
*/

.section-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Dark mode text styling */
body.dark-mode .customizer-section h2 {
  color: #FFFFFF !important;
}

body.dark-mode .customizer-section h2::before {
  background-color: #E4572E !important;
}

body.dark-mode .section-description {
  color: #CCCCCC !important;
}

body.dark-mode .section-title {
  color: #FFFFFF !important;
}

/* Dark mode styling for buttons and controls */
body.dark-mode .amount-btn,
body.dark-mode .percentage-btn,
body.dark-mode .toggle-btn {
  background-color: #2a2a2a !important;
  color: #FFFFFF !important;
  border-color: #444444 !important;
}

body.dark-mode .amount-btn:hover,
body.dark-mode .percentage-btn:hover,
body.dark-mode .toggle-btn:hover {
  background-color: #3a3a3a !important;
  border-color: #555555 !important;
}

body.dark-mode .amount-btn.selected,
body.dark-mode .percentage-btn.selected,
body.dark-mode .toggle-btn.selected {
  background-color: var(--accent-primary) !important;
  color: #FFFFFF !important;
  border-color: var(--accent-primary) !important;
}

/* Dark mode styling for sliders */
body.dark-mode .flour-slider {
  background-color: #333333 !important;
}

body.dark-mode .flour-slider::-webkit-slider-thumb {
  background-color: var(--accent-primary) !important;
}

body.dark-mode .flour-percentage {
  color: #FFFFFF !important;
}

/* Dark mode styling for tooltips */
body.dark-mode .tooltip-icon {
  background-color: #333333 !important;
  color: #FFFFFF !important;
}

body.dark-mode .tooltip-text {
  background-color: #1a1a1a !important;
  color: #FFFFFF !important;
  border: 1px solid #444444 !important;
}

/* Tab navigation for ingredient categories */
.ingredient-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.ingredient-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.ingredient-tab {
  padding: 12px 20px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ingredient-tab.active {
  border-bottom: 3px solid #000;
  color: #000;
  font-weight: 600;
}

.ingredient-tab:hover:not(.active) {
  border-bottom: 3px solid #ccc;
}

/* Ingredient grid with images */
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.ingredient-card {
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.ingredient-card.selected {
  border-color: #333;
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  background-color: #333;
  color: white;
}

.ingredient-card.selected .ingredient-name,
.ingredient-card.selected .ingredient-amount {
  color: white;
}

.ingredient-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 10px;
  transition: transform 0.2s ease;
}

.ingredient-card:hover .ingredient-image {
  transform: scale(1.05);
}

.ingredient-name {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.ingredient-amount {
  font-size: 0.8rem;
  color: #666;
}

/* Improved flour sliders */
.flour-sliders {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.flour-option {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
}

.flour-option label {
  display: flex;
  align-items: center;
  font-weight: 500;
  margin-bottom: 10px;
}

.flour-option label img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.flour-percent {
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.flour-slider {
  flex-grow: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  outline: none;
  border-radius: 3px;
}

.flour-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
}

.flour-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}

/* Enhanced option buttons */
.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.amount-btn {
  flex: 1;
  min-width: 100px;
  padding: 15px;
  border: 2px solid #eee;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.amount-btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.amount-btn:hover img {
  transform: scale(1.1);
}

.amount-btn:hover {
  border-color: #ccc;
  transform: translateY(-2px);
}

.amount-btn.selected {
  background-color: #333;
  border-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  color: white;
}

.amount-btn.selected span,
.amount-btn.selected small {
  color: white;
}

/* Toggle options for flavor boosts */
.toggle-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border: 2px solid #eee;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.toggle-btn img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.toggle-btn:hover {
  border-color: #ccc;
}

.toggle-btn.active {
  background-color: #000;
  border-color: #000;
  color: white;
}

/* Preview section */
.preview-section {
  background-color: #f9f9f9;
  border: 2px solid #eee;
}

.loaf-preview {
  display: flex;
  gap: 20px;
}

.loaf-image {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.loaf-details {
  flex: 1;
  padding: 15px;
  overflow-y: visible;
  height: auto;
}

.loaf-details h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  position: sticky;
  top: 0;
  background-color: #f9f9f9;
  padding: 5px 0;
  z-index: 1;
}

.loaf-details ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.loaf-details li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

/* AI Recipe section */
.ai-recipe-search {
  margin-bottom: 25px;
}

.search-container {
  display: flex;
  gap: 10px;
}

.recipe-input {
  flex-grow: 1;
  padding: 12px 15px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.recipe-input:focus {
  border-color: #000;
  outline: none;
}

.recipe-result {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.recipe-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Previous orders carousel */
.previous-orders-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.previous-orders-container::-webkit-scrollbar {
  display: none;
}

.previous-order-card {
  min-width: 200px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  height: 100%;
  transition: all 0.2s ease;
}

.previous-order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .option-buttons {
    flex-direction: column;
  }
  
  .amount-btn {
    flex-direction: row;
  }
  
  .ingredient-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Animation for selected items */
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(0,0,0,0.2); }
  70% { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.amount-btn.selected, .toggle-btn.active, .ingredient-card.selected {
  animation: pulse-border 2s infinite;
}

/* Sticky navigation for mobile */
.sticky-nav {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 100;
  padding: 10px 0;
  margin: 0 -25px 20px;
  padding: 15px 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  cursor: help;
  z-index: 100;
}

.section-header .tooltip {
  position: static;
}

.customizer-section {
  position: relative;
}

/* Make sure tooltip is contained within customizer section */
.customizer-section .tooltip .tooltip-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.section-header {
  position: relative;
}

/* Fix for tooltip positioning on mobile */
@media (max-width: 768px) {
  .tooltip .tooltip-text {
    width: 280px;
    left: 0;
    transform: none;
  }
  
  .tooltip .tooltip-text::after {
    left: 15%;
  }
}

.tooltip .tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: #333;
  color: white !important;
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
  margin-left: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 80%;
  max-width: 500px;
  background-color: #333;
  color: #fff !important;
  text-align: left;
  border-radius: 6px;
  padding: 15px;
  position: absolute;
  z-index: 1000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  word-wrap: break-word;
  pointer-events: none;
  border: 1px solid #ddd;
  white-space: normal;
}

/* Remove the tooltip arrow as it's now centered */
.tooltip .tooltip-text::after {
  display: none;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
