/* Info Panel */
.info-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

/* Updated to use global card styles */
.card {
  composes: card from './cards.css';
}

.api-status-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.api-status-card.error {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
}

.status-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-icon {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.status-icon.online {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}

.status-icon.offline {
  background: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
}

.status-icon.pulse {
  position: relative;
  background: #a855f7;
}

.status-icon.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45);
  animation: statusPulse 1.6s ease-out infinite;
}

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

.status-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.status-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.status-body {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.skeleton {
  width: 140px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  background-size: 200% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(168, 85, 247, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}


.add-api-key-card {
  background: linear-gradient(#ffffff, #f4ecd4) padding-box,
    var(--silver) border-box;
  border: 2px dashed transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px var(--shadow);
}

.add-api-key-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent), transparent, var(--accent));
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.08;
  animation: pulse 3s ease-in-out infinite;
}

.add-api-key-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px var(--shadow-strong);
  border-color: rgba(76, 52, 255, 0.35);
}

.add-api-key-card .add-icon {
  font-size: 1.2rem;
  color: var(--accent-contrast);
}

.add-api-key-card .add-text {
  font-weight: 500;
  color: var(--accent-contrast);
  font-size: 0.9rem;
  text-align: center;
}

.api-key-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
  min-height: 100px;
}

.key-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-fragment {
  color: var(--muted);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  word-break: break-all;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.key-controls {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.api-key-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.api-key-btn:hover {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  transform: scale(1.1);
}

.api-key-btn:active {
  transform: scale(0.95);
}

.api-key-card.disabled {
  opacity: 0.6;
}

.api-key-card.disabled .key-name {
  color: var(--muted);
}