/*
 * 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.
 */

/* AI Sous Chef Home Page Styles */
.home-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-title {
  font-size: 3.5rem;
  color: white;
  margin-bottom: 1rem;
  font-weight: 300;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.welcome-subtitle {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0;
  font-weight: 300;
}

.form-section {
  background: white;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.textarea-container {
  position: relative;
}

.user-textarea {
  width: 100%;
  padding: 1.5rem;
  border: 2px solid #e1e5e9;
  border-radius: 15px;
  font-size: 1.1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.user-textarea:focus {
  outline: none;
  border-color: #ff7e5f;
  box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.1);
  transform: translateY(-2px);
}

.user-textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

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

.submit-button {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 20px rgba(255, 126, 95, 0.3);
}

.submit-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(255, 126, 95, 0.4);
}

.submit-button:active {
  transform: translateY(-1px);
}

/* Loading Spinner Styles */
.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.spinner-circle {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 126, 95, 0.2);
  border-top: 3px solid #ff7e5f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
}

.spinner-circle::after {
  content: "🍳";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  animation: cookRotate 2s ease-in-out infinite;
}

.spinner-text {
  color: #ff7e5f;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes cookRotate {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-50%, -50%) rotate(180deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Reset body styles for full gradient */
body {
  margin: 0;
  padding: 0;
}

/* Recipe Display Styles */
.recipe-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.recipe-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.recipe-main {
  min-width: 0;
}

.recipe-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f8f9fa;
}

.recipe-title {
  font-size: 2.5rem;
  color: #2d3748;
  margin-bottom: 1rem;
  font-weight: 700;
}

.recipe-description {
  font-size: 1.2rem;
  color: #718096;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.recipe-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.meta-item {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  border-radius: 12px;
  color: white;
}

.meta-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.meta-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.recipe-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  color: #2d3748;
  margin-bottom: 1.5rem;
  font-weight: 600;
  border-bottom: 2px solid #ff7e5f;
  padding-bottom: 0.5rem;
}

.ingredients-list {
  list-style: none;
  padding: 0;
}

.ingredient-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 4px solid #ff7e5f;
  font-weight: 500;
}

.instructions-list {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 12px;
  counter-increment: step-counter;
}

.step-number {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 1rem;
  flex-shrink: 0;
}

.step-text {
  line-height: 1.6;
  font-size: 1rem;
}

.tips-section {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(255, 126, 95, 0.1) 0%, rgba(254, 180, 123, 0.1) 100%);
  border-radius: 12px;
}

.tips-list {
  list-style: none;
  padding: 0;
}

.tip-item {
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #feb47b;
  font-style: italic;
}

.tip-item:before {
  content: "💡 ";
  margin-right: 0.5rem;
}

.recipe-actions {
  text-align: center;
  padding-top: 2rem;
  border-top: 2px solid #f8f9fa;
}

.action-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(255, 126, 95, 0.3);
}

.action-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(255, 126, 95, 0.4);
  text-decoration: none;
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  .home-container {
    padding: 2rem 1rem;
  }
  
  .welcome-title {
    font-size: 2.5rem;
  }
  
  .form-section {
    padding: 2rem;
  }

  .recipe-container {
    margin: 1rem;
    padding: 1.5rem;
  }

  .recipe-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .recipe-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .recipe-title {
    font-size: 2rem;
  }

  .chat-sidebar {
    position: static;
    max-height: none;
  }

  .chat-messages {
    max-height: 300px;
  }
}

/* Recipe Navigation Styles */
.recipe-nav {
  margin-bottom: 1rem;
}

.home-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(255, 126, 95, 0.3);
}

.home-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 126, 95, 0.4);
  text-decoration: none;
  color: white;
}

/* Chat Styles */
.chat-sidebar {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(255, 126, 95, 0.05) 0%, rgba(254, 180, 123, 0.05) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 126, 95, 0.1);
  height: fit-content;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
}

.chat-header {
  text-align: center;
  margin-bottom: 2rem;
}

.chat-header h3 {
  font-size: 1.5rem;
  color: #2d3748;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.chat-header p {
  color: #718096;
  font-size: 1rem;
  margin: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 15px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  min-height: 300px;
  max-height: 500px;
}

.chat-message {
  margin-bottom: 1rem;
}

.chat-message.user-message {
  display: flex;
  justify-content: flex-end;
}

.chat-message.ai-message {
  display: flex;
  justify-content: flex-start;
}

.message-content {
  display: flex;
  align-items: center;
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  word-wrap: break-word;
}

.user-message .message-content {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  flex-direction: row-reverse;
}

.ai-message .message-content {
  background: #f7fafc;
  color: #2d3748;
  border: 1px solid #e1e5e9;
}

.message-icon {
  font-size: 1.2rem;
  margin: 0 0.5rem;
  flex-shrink: 0;
}

.message-text {
  line-height: 1.4;
  font-size: 0.95rem;
}

.chat-input {
  position: relative;
}

.input-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-text-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 25px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.chat-text-input:focus {
  border-color: #ff7e5f;
  box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.1);
}

.chat-send-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(255, 126, 95, 0.3);
}

.chat-send-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 126, 95, 0.4);
}

.chat-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  position: absolute;
  right: 0;
  top: 0;
  background: white;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-spinner .spinner-circle {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 126, 95, 0.2);
  border-top: 2px solid #ff7e5f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.chat-spinner .spinner-text {
  font-size: 0.9rem;
  color: #ff7e5f;
  font-weight: 500;
}
