/* Code Garden Styles */

:root {
  --primary-color: #2ecc71;
  --secondary-color: #27ae60;
  --background: #f8f9fa;
  --card-background: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  margin: 0;
  padding: 0;
}

.code-garden-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.garden-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.garden-header h1 {
  font-size: 3rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Section Styles */
.snippet-section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

/* Search and Filter Section */
.search-filter-section {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-box {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  outline: none;
  transition: var(--transition);
  background: var(--card-background);
}

.search-box:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.tag-filter {
  padding: 0.5rem 1rem;
  background: var(--card-background);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  color: var(--text-primary);
  font-weight: 500;
}

.tag-filter:hover {
  border-color: var(--primary-color);
  background: rgba(46, 204, 113, 0.05);
}

.tag-filter.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Snippets Grid */
.snippets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Snippet Card */
.snippet-card {
  background: var(--card-background);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.snippet-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.snippet-header {
  margin-bottom: 1rem;
}

.snippet-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.snippet-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.snippet-title a:hover {
  color: var(--primary-color);
}

.snippet-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
}

.snippet-description {
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.5;
  flex-grow: 1;
}

.snippet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(46, 204, 113, 0.1);
  color: var(--secondary-color);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.snippet-preview {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.snippet-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.snippet-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  margin-top: auto;
  transition: var(--transition);
}

.snippet-link:hover {
  color: var(--secondary-color);
  transform: translateX(4px);
}

/* No Results */
.no-results,
.no-snippets {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.no-snippets {
  grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .garden-header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .snippets-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .code-garden-container {
    padding: 1rem;
  }

  .filter-tags {
    justify-content: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1a1a;
    --card-background: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #3d3d3d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .search-box {
    background: var(--card-background);
    color: var(--text-primary);
  }

  .tag-filter {
    background: var(--card-background);
    color: var(--text-primary);
  }
}