/* _cards.css */

/* Layout Grids */
.cards-grid,
.vacancies-list, 
#communityTasksListWrap,
.cards-grid-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  width: 100%;
}

/* Base Card Style */
.card-base {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-norm);
}

.card-base:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.card-base:hover {
  /* Subtle glow */
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Vacancy & Task Cards */
.vacancy-card, .task-card {
  min-height: 380px;
  height: 100%;
}

.vac-card-image, .task-img {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface-alt);
}

.vac-card-image img, .task-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-base:hover .vac-card-image img,
.card-base:hover .task-img {
  transform: scale(1.05);
}

.vac-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: blur(8px);
  color: #fff !important;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.05);
}

.vac-content, .task-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vac-company-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.vac-company-line svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.vac-title {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vac-short {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.vac-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.vac-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.card-actions .btn {
  flex: 1;
}

/* Role Cards (Students, Companies, Startups) */
.card-with-overlay {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.card-image-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
  filter: grayscale(100%) brightness(0.6);
}

.card-with-overlay:hover img {
  transform: scale(1.05);
  filter: grayscale(100%) brightness(0.4);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,11,0.85) 0%, rgba(10,10,11,0.15) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px;
  transition: background 0.4s ease;
}

.card-with-overlay:hover .card-overlay {
  background: linear-gradient(to top, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0.5) 50%, rgba(10,10,11,0.3) 100%);
}

.card-overlay-title {
  position: absolute;
  bottom: 32px;
  left: 32px;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 2;
}

.btn-overlay {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: auto;
  z-index: 3;
  cursor: pointer;
}

.card-with-overlay:hover .btn-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.card-with-overlay:hover .card-overlay {
  background: linear-gradient(to top, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0.5) 50%, rgba(10,10,11,0.3) 100%);
}

@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .card-with-overlay {
    aspect-ratio: 16/9;
  }

  .btn-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: static;
    margin-left: 0;
    margin-top: 12px;
  }
  
  .card-overlay-title {
    position: static;
    transform: none;
  }
  
  .card-overlay {
    justify-content: flex-end;
    align-items: flex-start;
  }
}


/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-norm);
  cursor: pointer;
}

.news-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
}

.news-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-card:hover .news-cover {
  transform: scale(1.05);
}

.news-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-read-more {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-primary);
  font-weight: 500;
  transition: color 0.2s;
}

.news-card:hover .news-read-more {
  color: var(--accent-hover, #8B83FF);
}

@media(max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Vacancy List Cards (Account Panel) ===== */
.vacancies-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vac-list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.vac-list-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.vac-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vac-list-company {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vac-list-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.vac-list-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.vac-list-company-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.vac-list-match {
  font-size: 0.9rem;
}

.vac-list-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.vac-list-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vac-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.vac-pill.accent {
  color: var(--accent-primary);
  border-color: rgba(108, 99, 255, 0.25);
  background: rgba(108, 99, 255, 0.08);
}

.vac-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.vac-list-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vac-list-footer .btn {
  padding: 6px 16px;
  font-size: 0.82rem;
}

/* Task Grid Cards (Account Panel) */
.task-grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
}

.task-grid-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.task-grid-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  width: fit-content;
}

.task-grid-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.task-grid-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.task-grid-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-grid-footer {
  margin-top: auto;
}
