/* Reset and base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fafafa;
}

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

/* Header styles */
.site-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}
.site-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.tagline {
  font-size: 1rem;
  opacity: 0.9;
}
.main-nav {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  font-weight: 500;
}

/* Section styles */
section { margin-bottom: 2.5rem; }
section h2 { font-size: 1.5rem; margin-bottom: 1rem; color: #2c3e50; }
section h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: #34495e; }

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tab-button {
  padding: 0.75rem 1.25rem;
  background: #ecf0f1;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.tab-button:hover {
  background: #dce1e5;
}
.tab-button.active {
  background: #3498db;
  color: white;
}

/* Add controls */n.add-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.add-button {
  background: #27ae60;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.add-button:hover { background: #2ecc71; }

#search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  font-size: 1rem;
}

/* Item grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Item cards */
.item-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.item-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}
.difficulty {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.difficulty.beginner { background: #d4edda; color: #155724; }
.difficulty.intermediate { background: #fff3cd; color: #856404; }
.difficulty.advanced { background: #f8d7da; color: #721c24; }

.item-links {
  list-style: none;
  font-size: 0.9rem;
}
.item-links li { margin-bottom: 0.25rem; }
.item-links a {
  color: #3498db;
  text-decoration: none;
}
.item-links a:hover { text-decoration: underline; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}
.empty-icon { width: 64px; height: 64px; margin-bottom: 1rem; }

/* Sample items section */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.sample-card {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.sample-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.sample-card .difficulty {
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}
.sample-links { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.sample-links li { margin-bottom: 0.25rem; }
.sample-links a { color: #27ae60; text-decoration: none; }
.sample-links a:hover { text-decoration: underline; }

/* Help section */
.help-section ul, .info-section ul { list-style: none; padding-left: 1rem; }
.help-section ul li::before {
  content: "• ";
  color: #3498db;
}
.mistakes-list { padding-left: 0; }
.mistakes-list li { margin-bottom: 0.5rem; }

/* Modal styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h2 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 0.75rem; border: 1px solid #bdc3c7; border-radius: 6px; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }
.save-button { background: #27ae60; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; cursor: pointer; }
.save-button:hover { background: #2ecc71; }
.cancel-button { background: #95a5a6; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; cursor: pointer; }
.cancel-button:hover { background: #bdc3d6; }

/* Footer */
.site-footer {
  background: #2c3e50;
  color: #bdc3c7;
  padding: 1.5rem 0;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.site-footer a { color: #3498db; }

/* Responsive adjustments */n@media (max-width: 768px) {
  .site-header h1 { font-size: 1.5rem; }
  .category-tabs { justify-content: center; }
  .add-controls { flex-direction: column; align-items: stretch; }
  .sample-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 1.5rem; }
}

/* Visibility utilities */n.hidden { display: none !important; }


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
