/**
 * Carbon4Planet — Micro-interactions v1.0
 * D223: Button hover/focus/active transitions + smooth reveals
 */

/* ── Button micro-interactions ── */
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s, color 0.15s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Card hover lift ── */
.card, .tool-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.card:hover, .tool-card:hover {
  transform: translateY(-2px);
}

/* ── Form input focus glow ── */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.15);
}

/* ── Nav link animation ── */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width 0.2s ease, left 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* ── Smooth page entry ── */
@keyframes c4p-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  animation: c4p-fade-in 0.4s ease;
}

.tool-card {
  animation: c4p-fade-in 0.5s ease both;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }

/* ── Skeleton loading state ── */
@keyframes c4p-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.c4p-skeleton {
  background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-border) 50%, var(--color-surface-alt) 75%);
  background-size: 200% 100%;
  animation: c4p-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Tooltip (native-like) ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--color-dark);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 999;
}

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