/* Artifact Grid Styles */
.artifact-grid-container {
  margin: 2rem 0;
}

.artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Artifact card base; now piggybacks off .c-card primitive when present */
.artifact-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}
.artifact-card.c-card { background: var(--color-surface-1); border:1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding:0; }

.artifact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  border-color: var(--kg-green);
}

.artifact-card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.artifact-thumbnail {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--kg-green) 0%, var(--kg-green-300) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.artifact-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.artifact-card:hover .artifact-thumbnail img {
  transform: scale(1.05);
}

.artifact-icon {
  font-size: 3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.access-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
}

.access-badge.access-premium {
  background: linear-gradient(45deg, #FFD700, #FFA500);
}

.access-badge.access-subscriber {
  background: linear-gradient(45deg, #9C27B0, #E91E63);
}

.artifact-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.artifact-header {
  margin-bottom: 1rem;
}

.artifact-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--kg-text);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artifact-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #666;
}

.artifact-type {
  background: #f8f9fa;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
}

.artifact-category {
  color: var(--kg-green);
  font-weight: 500;
}

.artifact-summary {
  margin-bottom: 1rem;
  flex: 1;
}

.artifact-summary p {
  color: #666;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artifact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-more {
  background: #f5f5f5;
  color: #666;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.artifact-footer {
  margin-top: auto;
}

.artifact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.difficulty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  text-transform: capitalize;
}

.difficulty-beginner {
  color: #4CAF50;
}

.difficulty-intermediate {
  color: #FF9800;
}

.difficulty-advanced {
  color: #f44336;
}

.read-time,
.quality-score {
  color: #666;
}

.artifact-engagement {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.artifact-date {
  font-size: 0.75rem;
  color: #999;
  text-align: right;
}

/* Search Interface Styles */
.search-interface {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-header {
  margin-bottom: 2rem;
  position: relative;
}

.search-input-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: var(--kg-green);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--kg-green);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-btn:hover {
  background: var(--kg-green-700);
}

.clear-search-btn {
  position: absolute;
  right: 55px;
  top: 50%;
  transform: translateY(-50%);
  background: #f44336;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.875rem;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
  background: #f8f9fa;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.filters-container {
  margin-bottom: 2rem;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filters-header h3 {
  margin: 0;
  color: #2c3e50;
}

.clear-filters-btn {
  background: none;
  border: 1px solid #e0e0e0;
  color: #666;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-filters-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--kg-green);
}

.active-filters {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.active-filters-label {
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  display: flex;
  align-items: center;
  background: var(--kg-green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.875rem;
}

.remove-filter {
  background: none;
  border: none;
  color: white;
  margin-left: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.remove-filter:hover {
  opacity: 0.8;
}

.sort-container {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-group label {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.875rem;
}

.sort-select {
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.results-info {
  background: #e8f5e8;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
}

.results-info p {
  margin: 0;
  color: var(--kg-green);
  font-weight: 500;
}

/* Loading and State Styles */
.loading-indicator {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.load-more-container {
  text-align: center;
  margin: 2rem 0;
}

.load-more-btn {
  background: var(--kg-green);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.load-more-btn:hover {
  background: var(--kg-green-700);
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-message button {
  background: none;
  border: 1px solid #c62828;
  color: #c62828;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.artifact-card.animated {
  animation: fadeInUp 0.6s ease-out;
}

/* Explore Section Styles */
.explore-section {
  background: #f8f9fa;
  padding: 4rem 0;
}

.explore-section h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.explore-section > .container > p {
  text-align: center;
  color: #666;
  margin-bottom: 3rem;
  font-size: 1.125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .artifacts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .search-interface {
    padding: 1rem;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .sort-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sort-group {
    justify-content: space-between;
  }
  
  .artifact-stats {
    font-size: 0.8rem;
  }
  
  .artifact-engagement {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .artifact-thumbnail {
    height: 150px;
  }
  
  .artifact-content {
    padding: 1rem;
  }
  
  .artifact-title {
    font-size: 1.125rem;
  }
  
  .search-input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
  }
  
  .search-btn {
    width: 35px;
    height: 35px;
    right: 5px;
  }
  
  .clear-search-btn {
    width: 25px;
    height: 25px;
    right: 45px;
  }
}
