/* ========================================
 * Inline Action Chips
 * ========================================
 * Clickable action buttons embedded within narrative content.
 * Players can click these to take common actions quickly.
 */

/* Container for action chips */
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Individual action chip - D&D themed golden accent */
.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
  color: #e8e8e8;
  font-size: 13px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-chip:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 215, 0, 0.08) 100%);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.15);
}

.action-chip:active {
  transform: translateY(0);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 215, 0, 0.12) 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Icon within chip */
.action-chip__icon {
  font-size: 1.1em;
}

/* ========================================
 * Action Type Variants
 * ========================================
 */

/* Combat actions - red tint */
.action-chip--combat,
.action-chip--attack {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.action-chip--combat:hover,
.action-chip--attack:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Defense actions - blue tint */
.action-chip--defend,
.action-chip--defensive {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.08);
}

.action-chip--defend:hover,
.action-chip--defensive:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* Talk/social actions - yellow tint */
.action-chip--talk,
.action-chip--social {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.action-chip--talk:hover,
.action-chip--social:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

/* Explore/investigate actions - green tint */
.action-chip--explore,
.action-chip--investigate {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.action-chip--explore:hover,
.action-chip--investigate:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

/* Magic actions - purple tint */
.action-chip--magic,
.action-chip--spell {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.08);
}

.action-chip--magic:hover,
.action-chip--spell:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.15);
  color: #c4b5fd;
}

/* Skill roll actions - D&D dice themed with golden glow */
.action-chip--skill-roll {
  border-color: rgba(255, 215, 0, 0.4);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(218, 165, 32, 0.08) 100%
  );
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 215, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.action-chip--skill-roll::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 215, 0, 0.2) 50%,
    transparent 100%
  );
  animation: skillRollShimmer 3s ease-in-out infinite;
}

@keyframes skillRollShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.action-chip--skill-roll:hover {
  border-color: rgba(255, 215, 0, 0.7);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.25) 0%,
    rgba(218, 165, 32, 0.15) 100%
  );
  color: #ffd700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.25);
  transform: translateY(-2px) scale(1.02);
}

.action-chip--skill-roll:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 215, 0, 0.15);
}

.action-chip--skill-roll .action-chip__icon {
  animation: diceWiggle 2s ease-in-out infinite;
}

@keyframes diceWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* ========================================
 * Roll Prompt CTA
 * ========================================
 * Contextual prompts for dice rolls
 */

.roll-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
}

.roll-cta__prompt {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
}

.roll-cta__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.roll-cta__button:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  transform: scale(1.02);
}

.roll-cta__button:active {
  transform: scale(0.98);
}

.roll-cta__button .dice-icon {
  font-size: 1.2em;
}

/* ========================================
 * Animation
 * ========================================
 */

.inline-actions.animate-in .action-chip {
  animation: chipSlideIn 0.2s ease-out;
  animation-fill-mode: backwards;
}

.inline-actions.animate-in .action-chip:nth-child(1) { animation-delay: 0ms; }
.inline-actions.animate-in .action-chip:nth-child(2) { animation-delay: 50ms; }
.inline-actions.animate-in .action-chip:nth-child(3) { animation-delay: 100ms; }
.inline-actions.animate-in .action-chip:nth-child(4) { animation-delay: 150ms; }

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

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .inline-actions.animate-in .action-chip {
    animation: none;
  }
}

/* ========================================
 * Mobile Adjustments
 * ========================================
 */

@media (max-width: 640px) {
  .inline-actions {
    gap: var(--space-1);
  }

  .action-chip {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
  }

  .roll-cta {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
}
