/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* ── Card ── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.card__description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--line-height-relaxed);
}

/* ── Progress Bar ── */
.progress {
  width: 100%;
  margin-bottom: var(--space-4);
}

.progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.progress__label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.progress__value {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
}

.progress__track {
  width: 100%;
  height: 10px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Progress color classes */
.progress__bar--red { background: var(--progress-0-25); }
.progress__bar--orange { background: var(--progress-26-50); }
.progress__bar--blue { background: var(--progress-51-75); }
.progress__bar--green { background: var(--progress-76-100); }

/* ── Tag / Badge ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag--primary {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
}

.tag--accent {
  background: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-accent);
}

.tag--success {
  background: rgba(0, 132, 61, 0.1);
  color: #00843D;
}

.tag--danger {
  background: rgba(227, 25, 55, 0.1);
  color: #E31937;
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--text-light);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: var(--text-light);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--text-light);
}

.btn--accent:hover {
  background: var(--color-accent-dark);
  color: var(--text-light);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: var(--text-light);
}

/* ── Stat ── */
.stat {
  text-align: center;
  padding: var(--space-6);
}

.stat__number {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--color-gray-900);
  color: var(--text-light);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ── Fade In Animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Language Switch Transition ── */
.lang-switching {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lang-switched {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ── Staggered animation for cards on re-render ── */
.lang-switched .area-card,
.lang-switched .project-card,
.lang-switched .experiment-card,
.lang-switched .publication-item,
.lang-switched .talk-card,
.lang-switched .timeline__item,
.lang-switched .future-card,
.lang-switched .collab-card {
  animation: slideUpFade 0.5s ease both;
}

.lang-switched .area-card:nth-child(1),
.lang-switched .project-card:nth-child(1),
.lang-switched .experiment-card:nth-child(1),
.lang-switched .publication-item:nth-child(1),
.lang-switched .timeline__item:nth-child(1),
.lang-switched .future-card:nth-child(1),
.lang-switched .collab-card:nth-child(1) { animation-delay: 0.05s; }

.lang-switched .area-card:nth-child(2),
.lang-switched .project-card:nth-child(2),
.lang-switched .experiment-card:nth-child(2),
.lang-switched .publication-item:nth-child(2),
.lang-switched .timeline__item:nth-child(2),
.lang-switched .future-card:nth-child(2),
.lang-switched .collab-card:nth-child(2) { animation-delay: 0.1s; }

.lang-switched .area-card:nth-child(3),
.lang-switched .project-card:nth-child(3),
.lang-switched .experiment-card:nth-child(3),
.lang-switched .publication-item:nth-child(3),
.lang-switched .timeline__item:nth-child(3),
.lang-switched .future-card:nth-child(3) { animation-delay: 0.15s; }

.lang-switched .area-card:nth-child(n+4),
.lang-switched .project-card:nth-child(n+4),
.lang-switched .experiment-card:nth-child(n+4),
.lang-switched .publication-item:nth-child(n+4),
.lang-switched .timeline__item:nth-child(n+4),
.lang-switched .future-card:nth-child(n+4) { animation-delay: 0.2s; }

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
