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

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
  color: #333333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  color: #2c3e50;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 16px;
  background-color: #e9ecef;
  color: #495057;
  text-decoration: none;
  border: 1px solid #ced4da;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn:hover {
  background-color: #d4edda;
  text-decoration: none;
}

.btn-primary {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

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

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.tag-filter {
  margin-bottom: 20px;

  a {
    color: black;
    margin-right: 10px;
    text-decoration: none;
  }
}

/* Recipe grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.recipe-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.recipe-card h3 {
  margin-bottom: 10px;
}

.recipe-card h3 a {
  color: #2c3e50;
  text-decoration: none;
}

.recipe-card h3 a:hover {
  color: #007bff;
}

.recipe-card .recipe-thumbnail {
  width: 100%;
}

.recipe-meta {
  color: #6c757d;
  font-size: 14px;
  margin: 10px 0;
}

.recipe-meta span {
  margin-right: 15px;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Recipe show page */
.recipe-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}
.recipe-header .recipe-photo {
  margin-top: 30px;

  img {
    width: 100%;
  }
}

.recipe-description {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.recipe-meta {
  display: flex;
  gap: 10px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  justify-content: space-between;
}

.meta-item {
  font-size: 14px;
}

.recipe-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

.recipe-tags code {
  background: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-family: mono;
  font-size: 0.8em;
  padding: 0 10px;

  a {
    color: #495057;
    font-style: italic;
    text-decoration: none;

    &:before {
      content: "#";
    }
  }
}

.ingredients-section, .instructions-section {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.ingredients-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
  margin: 16px;

  &.section-title {
    font-weight: bold;
    padding: 16px 0 8px 0;

    &:before {
      display: none;
    }
  }
}

.ingredients-list li:before {
  content: "•";
  color: #007bff;
  margin-left: -15px;
  margin-right: 5px;
}

.instructions-list {
  padding-left: 20px;
}

.instructions-list li {
  margin-bottom: 15px;
  line-height: 1.8;
}

/* Forms */
.recipe-form {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 800px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert ul {
  margin: 10px 0 0 0;
  padding-left: 20px;
}

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .recipe-header {
    flex-direction: column;
    gap: 15px;
  }

  .recipe-meta {
    flex-direction: column;
    gap: 10px;
  }

  .recipes-grid {
    grid-template-columns: 1fr;
  }
}
