/* Projects Header */
header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  flex-wrap: wrap;
  padding: 0 2rem;
}

.header-left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  position: relative;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projects-logo {
  width: 28px;
  height: 100%;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.7;
  filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.4));
  transition: all 0.8s;
  overflow: visible;
}

.projects-logo:hover {
  opacity: 1;
  transform: rotate(360deg) scale(1.1);
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Controls */
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--glass);
  color: inherit;
  min-width: 180px;
}

input.search::placeholder {
  color: var(--muted);
}

.search option {
  background: var(--card);
  color: #e6eef6;
}

select.search option[disabled][hidden] {
  color: var(--muted);
  opacity: 0.1;
}

select.search:invalid {
  color: var(--muted);
}

.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(125,211,252,0.3);
  background: var(--glass);
  color: inherit;
}

.search:active {
  background: var(--glass);
  border-color: var(--accent);
}

/* Project List */
#list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 2rem;
}

/* Project Card */
.project-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.6);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(2,6,23,0.9), 0 0 20px rgba(125,211,252,0.3);
  border-color: rgba(125,211,252,0.6);
  transition: all 0.3s ease;
}

.project-card .organization {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
  background: linear-gradient(135deg, #d1fae5, #bbf7d0);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}

/* Thumbnail */
.thumb {
  width: 80px;
  height: 80px;
  border-radius: 12%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #042;
  background: linear-gradient(135deg, #d1fae5, #bbf7d0);
}

/* Meta Information */
.meta {
  flex: 1;
  min-width: 0;
}

.title {
  margin: 0;
  font-size: 1.2rem;
}

.desc {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Tags */
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125,211,252,0.08);
  color: var(--accent);
  border: 1px solid rgba(125,211,252,0.06);
}

.meta .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.project-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.project-link {
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(125,211,252,0.1);
  color: var(--accent);
  border: 1px solid rgba(125,211,252,0.3);
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.project-link:hover {
  background: rgba(125,211,252,0.2);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Difficulty */
.difficulty {
  margin-top: 6px;
  color: #fafa15;
  opacity: 0.75;
  font-size: 1rem;
  letter-spacing: 2px;
  user-select: none;
}

/* Status Messages */
.loading, .error, .empty {
  text-align: center;
  padding: 18px 1rem;
  color: var(--muted);
}

button.retry {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(125,211,252,0.15);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .controls {
    width: 100%;
    justify-content: flex-start;
  }
  
  .search {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .thumb {
    width: 56px;
    height: 56px;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search {
    width: 100%;
  }
}