/* Project Cards Base Styles */
.project-card {
  width: 280px;
  height: 400px;
  border: 2px solid rgba(255,255,255,0.2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  position: relative;
  will-change: transform;
  animation: fadeInUp 0.5s ease-out backwards;
}

/* Type-based background shading for projects - grayscale variations */
.project-card[data-type="web-app"] {
  background: rgba(255, 255, 255, 0.01);
}

.project-card[data-type="mobile"] {
  background: rgba(255, 255, 255, 0.05);
}

.project-card[data-type="extension"] {
  background: rgba(255, 255, 255, 0.09);
}

.project-card[data-type="script"] {
  background: rgba(255, 255, 255, 0.14);
}

.project-card[data-type="hardware"] {
  background: rgba(255, 255, 255, 0.20);
}

.project-card[data-type="infrastructure"] {
  background: rgba(255, 255, 255, 0.27);
}

/* Card stagger animation delays */
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }
.project-card:nth-child(7) { animation-delay: 0.35s; }
.project-card:nth-child(8) { animation-delay: 0.4s; }
.project-card:nth-child(9) { animation-delay: 0.45s; }
.project-card:nth-child(10) { animation-delay: 0.5s; }

/* Card hover state - brightens type-specific background */
.project-card:hover:not(.active):not(.selected-for-reorder) {
  border-color: rgba(255,255,255,0.5);
  filter: brightness(1.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
}

/* Active card (terminal selected) */
.project-card.active {
  border-color: #00ffff;
  background: rgba(0,255,255,0.05);
  box-shadow: 0 0 20px rgba(0,255,255,0.3);
  transform: none !important;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

/* Collapsed state */
.project-card.collapsed {
  height: auto;
  min-height: 70px;
  padding: 0.75rem;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.project-card.collapsed:hover {
  transform: translateY(-2px);
}

.project-card.collapsed .project-thumbnail,
.project-card.collapsed .project-status,
.project-card.collapsed .project-description,
.project-card.collapsed .project-meta,
.project-card.collapsed .card-menu,
.project-card.collapsed .external-link {
  display: none;
}

.project-card.collapsed .project-info {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex: 1;
}

.project-card.collapsed .project-name {
  font-size: 14px;
  margin: 0;
  width: 100%;
  gap: 0.25rem;
}

.project-card.collapsed .project-name span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card.collapsed .project-actions {
  margin: 0;
  gap: 0.5rem;
  flex-wrap: nowrap;
  display: flex;
  justify-content: flex-start;
}

.project-card.collapsed .vscode-link {
  padding: 0.35rem 0.6rem;
  font-size: 10px;
  white-space: nowrap;
}

.project-card.collapsed .external-link {
  padding: 0.35rem 0.75rem;
  font-size: 10px;
}

.project-card.collapsed .terminal-activate-btn {
  padding: 0.35rem 0.5rem;
  font-size: 14px;
}

/* Card content elements */
.project-thumbnail {
  width: 100%;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,0.3);
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-name {
  font-size: 18px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.collapse-toggle {
  font-size: 16px;
  color: rgba(255,255,255,0.4);
  transition: transform 0.3s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 0.15rem;
  flex-shrink: 0;
}

.project-name:hover .collapse-toggle {
  color: rgba(255,255,255,0.7);
}

.project-card.collapsed .collapse-toggle {
  transform: rotate(180deg);
}

.project-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.1em;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.live {
  background: #00ff00;
  box-shadow: 0 0 8px #00ff00;
}

.status-indicator.paused {
  background: #ffaa00;
}

.status-indicator.local-only {
  background: #888888;
}

.project-description {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 60px;
}

.project-meta {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}

/* Project actions container */
.project-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.vscode-link,
.external-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.3);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  position: relative;
}

.vscode-link {
  border-color: rgba(0,255,255,0.4);
  color: #00ffff;
}

.vscode-link:hover {
  border-color: rgba(0,255,255,0.9);
  background: rgba(0,255,255,0.15);
  box-shadow: 0 0 12px rgba(0,255,255,0.4);
  transform: translateY(-1px);
}

.external-link:hover {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.terminal-activate-btn {
  padding: 0.5rem 0.75rem;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  color: #00ff00;
  background: transparent;
  border: 2px solid rgba(0,255,0,0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.terminal-activate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0,255,0,0.1);
  transition: left 0.3s ease;
}

.terminal-activate-btn:hover::before {
  left: 0;
}

.terminal-activate-btn:hover {
  border-color: rgba(0,255,0,0.9);
  background: rgba(0,255,0,0.15);
  box-shadow: 0 0 16px rgba(0,255,0,0.4);
  transform: translateY(-1px);
}

/* Card menu (three dots) */
.card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  z-index: 10;
}

.project-card:hover .card-menu {
  opacity: 1;
}

.card-menu:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.6);
}

.card-menu-dropdown {
  position: fixed;
  background: rgba(20,20,20,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 4px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.card-menu-dropdown .menu-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  border-radius: 2px;
  transition: background 0.2s;
}

.card-menu-dropdown .menu-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Hidden items toggle */
.hidden-toggle {
  width: 100%;
  text-align: center;
  margin-top: 3rem;
  padding: 1rem;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.hidden-toggle .hidden-count {
  cursor: pointer;
  transition: color 0.2s;
}

.hidden-toggle .hidden-count:hover {
  color: rgba(255,255,255,0.6);
}

.hidden-items-list {
  margin-top: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 1rem;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hidden-section-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.hidden-section-header:first-child {
  margin-top: 0;
}

.hidden-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

.hidden-item .unhide-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.hidden-item .unhide-btn:hover {
  border-color: rgba(255,255,255,0.5);
  color: white;
  background: rgba(255,255,255,0.05);
}
