/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

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

/* Header */
header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2rem 0;
  text-align: center;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Navigation Controls */
.controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
}

.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn,
.stats-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #667eea;
  background: white;
  color: #667eea;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.stats-btn:hover {
  background: #667eea;
  color: white;
}

.filter-btn.active {
  background: #667eea;
  color: white;
}

#categoryFilter {
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 5px;
  background: white;
}

/* Main Content */
main {
  padding: 2rem 0;
  background: white;
  min-height: 70vh;
}

/* Stats Panel */
.stats-panel {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #e0e0e0;
}

.stats-panel h2 {
  margin-bottom: 1rem;
  color: #333;
}

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

.stat-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
}

.category-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.category-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: white;
  border-radius: 5px;
  font-size: 0.9rem;
}

/* Tag Cloud */
.tag-cloud {
  margin-bottom: 2rem;
}

.tag-cloud h2 {
  margin-bottom: 1rem;
  color: #333;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #f0f0f0;
  border-radius: 15px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.tag:hover,
.tag.active {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
}

.tag.size-1 {
  font-size: 0.7rem;
}
.tag.size-2 {
  font-size: 0.8rem;
}
.tag.size-3 {
  font-size: 0.9rem;
}
.tag.size-4 {
  font-size: 1rem;
}
.tag.size-5 {
  font-size: 1.1rem;
}

/* Categories */
.categories {
  display: grid;
  gap: 1.5rem;
}

.category {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.category-header:hover {
  background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

.category-header h2 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.category-description {
  font-size: 0.9rem;
  opacity: 0.9;
}

.category-toggle {
  float: right;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.category.expanded .category-toggle {
  transform: rotate(180deg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

/* Project Cards */
.project-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  background: #fafafa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-header {
  margin-bottom: 0.5rem;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.3rem;
}

.project-level {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.project-links {
  margin: 0.5rem 0;
}

.project-link {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: #e3f2fd;
  color: #1976d2;
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.8rem;
  transition: background 0.3s ease;
}

.project-link:hover {
  background: #bbdefb;
}

.project-tags {
  margin-top: 0.5rem;
}

.project-tag {
  display: inline-block;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
  padding: 0.1rem 0.4rem;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 0.75rem;
  color: #555;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: #666;
}

.error-message {
  text-align: center;
  padding: 2rem;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 5px;
  color: #c62828;
}

/* Footer */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 2rem 0;
}

footer a {
  color: #667eea;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

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

  .controls .container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .filter-controls {
    justify-content: center;
  }

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

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  header {
    padding: 1rem 0;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .project-card {
    padding: 0.8rem;
  }
}
