/* ═══════════════════════════════════════════════════════════════════
   MODULAR INTERACTIVE FEATURES STYLES
   ═══════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────
   FEATURE 1: Live API Demo Styles
   ────────────────────────────────────────────────────────────────── */

.live-api-demo-container {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(255, 102, 196, 0.08));
  border: 1px solid rgba(255, 102, 196, 0.3);
  border-radius: 12px;
}

.live-api-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.live-api-demo-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.live-api-demo-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.api-status {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.api-status-loading {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.api-status-success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.api-status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.refresh-api-btn {
  background: linear-gradient(135deg, #667eea, #ff66c4);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.refresh-api-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 102, 196, 0.4);
}

.refresh-api-btn:active {
  transform: translateY(0);
}

.api-response-container {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}

.api-response-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.api-response-block {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.85rem;
  color: #4ade80;
  white-space: pre;
  overflow-x: auto;
  margin: 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
}

/* ──────────────────────────────────────────────────────────────────
   FEATURE 2: Copy Button Styles
   ────────────────────────────────────────────────────────────────── */

.code-block-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.copy-btn.copy-success {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #fff !important;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
  animation: pulse-success 0.6s ease-out;
}

.copy-btn.copy-error {
  background: #ef4444 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
  animation: shake 0.3s ease-in-out;
}

/* ──────────────────────────────────────────────────────────────────
   FEATURE 3: Interactive Tier Highlights
   ────────────────────────────────────────────────────────────────── */

.comparison-table tbody tr {
  transition: background 0.2s ease;
}

.comparison-table tbody tr.row-highlight {
  background: rgba(255, 102, 196, 0.08);
}

.comparison-table td.tier-highlight,
.comparison-table th.tier-highlight {
  background: rgba(255, 102, 196, 0.15) !important;
  position: relative;
}

.comparison-table td.tier-highlight::after,
.comparison-table th.tier-highlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid rgba(255, 102, 196, 0.4);
  pointer-events: none;
  border-radius: 0;
}

.comparison-table tbody tr td {
  transition: all 0.2s ease;
}

/* Module Active State (from live API) */
.comparison-table tbody tr.module-active {
  background: rgba(34, 197, 94, 0.05);
}

.comparison-table tbody tr.module-active td:first-child::before {
  content: "🟢 ";
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .live-api-demo-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-api-demo-controls {
    width: 100%;
    justify-content: space-between;
  }

  .api-status {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .refresh-api-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .copy-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .api-response-block {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .live-api-demo-title {
    font-size: 1.2rem;
  }

  .api-status {
    font-size: 0.75rem;
  }
}

/* ──────────────────────────────────────────────────────────────────
   ANIMATION ENHANCEMENTS
   ────────────────────────────────────────────────────────────────── */

@keyframes pulse-success {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.api-status-success {
  animation: pulse-success 2s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.copy-btn.copy-error {
  animation: shake 0.3s ease-in-out;
}
