/* Recipe App Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #2d3748;
  background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
  min-height: 100vh;
}

/* Navigation */
nav {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

nav .nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav .nav-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

nav .btn-primary {
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

nav .btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.container h2 {
  font-size: 2rem;
  color: #1a202c;
  margin-bottom: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search and Sort Bar */
.search-sort-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 3.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.search-input::placeholder {
  color: #a0aec0;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.recipe-count {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  pointer-events: none;
}

/* Sort Dropdown */
.sort-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.sort-container label {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
}

.sort-select {
  padding: 0.85rem 2.5rem 0.85rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  color: #2d3748;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.sort-select:hover {
  border-color: #667eea;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
}

.sort-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

@media (max-width: 768px) {
  .search-sort-container {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-container {
    justify-content: space-between;
  }

  .sort-select {
    flex: 1;
  }
}

/* Tags */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: lowercase;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tag-clickable {
  cursor: pointer;
}

/* Recipe Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.recipe-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.recipe-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
}

.recipe-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: transform 0.4s ease;
}

.recipe-card:hover img {
  transform: scale(1.05);
}

.recipe-card-content {
  padding: 1.75rem;
  background: linear-gradient(to bottom, white 0%, #fafbff 100%);
}

.recipe-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: #1a202c;
  font-weight: 700;
  line-height: 1.3;
}

.recipe-card p {
  color: #718096;
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Recipe Detail */
.recipe-detail {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  margin-top: 2rem;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.recipe-header h1 {
  font-size: 2.5rem;
  color: #1a202c;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.recipe-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.recipe-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.recipe-section {
  margin-bottom: 2.5rem;
}

.recipe-section h2 {
  font-size: 1.75rem;
  color: #1a202c;
  margin-bottom: 1.25rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
  border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}

.recipe-section p {
  color: #4a5568;
  line-height: 1.8;
  font-size: 1.05rem;
}

.ingredients-list {
  list-style: none;
  background: linear-gradient(to bottom, #fafbff 0%, white 100%);
  border-radius: 12px;
  padding: 1rem;
}

.ingredients-list li {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s ease;
  border-radius: 6px;
  margin-bottom: 0.25rem;
}

.ingredients-list li:last-child {
  border-bottom: none;
}

.ingredients-list li:hover {
  background-color: rgba(102, 126, 234, 0.05);
}

.ingredients-list li:before {
  content: "✓";
  color: #667eea;
  font-weight: bold;
  display: inline-block;
  width: 1.5em;
  margin-left: -1em;
  font-size: 1.1rem;
}

.directions-list {
  list-style: none;
  counter-reset: step-counter;
}

.directions-list li {
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
  border-radius: 12px;
  counter-increment: step-counter;
  position: relative;
  padding-left: 4rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.directions-list li:hover {
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

.directions-list li:before {
  content: counter(step-counter);
  position: absolute;
  left: 1.25rem;
  top: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* Forms */
.form-container {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  max-width: 800px;
  margin: 2rem auto;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.form-container h1 {
  font-size: 2.25rem;
  color: #1a202c;
  margin-bottom: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.65rem;
  color: #2d3748;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #fafbff;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background-color: white;
}

/* Dynamic Lists */
.dynamic-list {
  margin-top: 1rem;
}

.dynamic-list-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dynamic-list-item input {
  flex: 1;
}

/* Buttons */
.btn {
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.btn:hover:before {
  left: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 25px rgba(86, 171, 47, 0.4);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 25px rgba(235, 51, 73, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 25px rgba(149, 165, 166, 0.4);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
}

/* Loading and Messages */
.loading {
  text-align: center;
  padding: 3rem;
  color: #718096;
  font-size: 1.1rem;
  font-weight: 500;
}

.error-message {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
  animation: slideIn 0.3s ease;
}

.success-message {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login Page */
.auth-container {
  max-width: 440px;
  margin: 4rem auto;
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.auth-container h1 {
  text-align: center;
  color: #1a202c;
  margin-bottom: 2rem;
  font-weight: 700;
  font-size: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive */
@media (max-width: 768px) {
  .recipes-grid {
    grid-template-columns: 1fr;
  }

  .recipe-header {
    flex-direction: column;
  }

  .recipe-actions {
    margin-top: 1rem;
  }

  nav .nav-content {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 0.25rem;
  font-size: 2rem;
  margin-top: 0.5rem;
}

.star {
  cursor: pointer;
  color: #ddd;
  transition: all 0.2s ease;
  user-select: none;
}

.star:hover {
  color: #f39c12;
  transform: scale(1.2);
}

.star.selected {
  color: #f39c12;
}

/* Review Cards */
.review-card {
  border-bottom: 1px solid #e0e0e0;
  padding: 1.5rem 0;
  transition: all 0.3s ease;
}

.review-card:hover {
  background-color: rgba(102, 126, 234, 0.02);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  border-radius: 8px;
}

.review-form-container {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 2px solid #e2e8f0;
  transition: border-color 0.3s ease;
}

.review-form-container:focus-within {
  border-color: #667eea;
}
