/**
 * @file src/ui/styles/action-bar.css
 * @description Styles for Bottom Smart Action Bar, Narrative Feed, Dice Roll Cards, and Tactical Panel
 * Modified: 2026-09-06T17:00:00Z
 */

/* Master Layout Grid */
.vtt-layout-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

#vtt-header-hud {
  flex-shrink: 0;
}

#vtt-action-bar {
  flex-shrink: 0;
}

.vtt-main-split {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Character Sheet Left Sidebar Drawer */
.vtt-sheet-sidebar {
  width: 440px;
  min-width: 440px;
  max-width: 440px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

.vtt-sheet-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border-right: none !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Center Narrative Feed Column */
.vtt-narrative-center {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: rgba(7, 10, 15, 0.85);
}

/* Right Tactical Panel Sidebar */
.vtt-tactical-sidebar {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  position: relative;
  z-index: 10;
}

@media (max-width: 1280px) {
  .vtt-sheet-sidebar {
    width: 380px;
    min-width: 380px;
    max-width: 380px;
  }
  .vtt-tactical-sidebar {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }
}

@media (max-width: 1024px) {
  .vtt-sheet-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 380px;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.8);
    transform: translateX(-100%);
  }
  .vtt-sheet-sidebar:not(.collapsed), .vtt-sheet-sidebar.drawer-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }
  .vtt-tactical-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.8);
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .vtt-tactical-sidebar.drawer-open {
    transform: translateX(0);
  }
}

@media (max-width: 767px) {
  .vtt-sheet-sidebar, .vtt-tactical-sidebar {
    width: 100vw;
    max-width: 440px;
  }
}

/* Narrative Feed (Center Main) */
.narrative-feed-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px 32px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  min-height: 0;
  flex: 1;
  scroll-behavior: smooth;
}

.feed-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.25s ease-out;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

.feed-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sender-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.sender-storyteller {
  background: rgba(168, 85, 247, 0.2);
  color: var(--color-purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.sender-arbiter {
  background: rgba(168, 85, 247, 0.2);
  color: var(--color-mint);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.sender-player {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.feed-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.feed-text-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Embedded Dice Roll Card */
.dice-roll-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-mint);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dice-roll-card.critical-hit {
  border-left-color: var(--color-gold);
  box-shadow: var(--glow-gold);
}

.dice-roll-card.critical-fail {
  border-left-color: var(--color-crimson);
  box-shadow: var(--glow-crimson);
}

.roll-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roll-title {
  font-size: 12px;
  font-weight: 700;
}

.roll-outcome-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.roll-outcome-badge.success {
  background: rgba(168, 85, 247, 0.2);
  color: var(--color-mint);
}

.roll-outcome-badge.failure {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-crimson);
}

.roll-calculation {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.roll-d20-box {
  color: var(--text-secondary);
}

.roll-total {
  font-size: 18px;
  font-family: var(--font-stats);
  color: #ffffff;
}

.roll-details {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Dialogue Choices */
.dialogue-choices-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.dialogue-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dialogue-choice-btn:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: var(--color-purple);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
  transform: translateX(4px);
}

/* Bottom Floating Smart Action Bar */
.smart-action-bar-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 20;
}

.action-economy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.economy-btn, .economy-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.economy-btn.spent, .economy-indicator.spent {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

.economy-btn.available:hover {
  border-color: var(--border-active);
  box-shadow: var(--glow-arcane);
}

.economy-status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-purple-light);
}

.economy-btn.spent .economy-status-dot {
  background: var(--color-crimson);
}

.movement-pill {
  color: var(--color-cyan);
}

.mode-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-gold);
  color: #000000;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.mode-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
}

/* Exploration Chips Sliding Drawer */
.exploration-chips-drawer {
  position: absolute;
  bottom: 100%;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
}

.exploration-chips-drawer.drawer-open {
  transform: translateY(0);
}

/* Quick Action Suggestions */
.suggestions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.suggestions-header {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-purple-light);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.suggestions-pills-wrapper {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.suggestion-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: #e0e7ff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.suggestion-pill:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: var(--border-active);
  box-shadow: var(--glow-arcane);
  transform: translateY(-1px);
}

/* Custom Prompt Action Input */
.custom-action-row {
  display: flex;
  gap: 8px;
}

.custom-action-input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-action-input:focus {
  border-color: var(--border-active);
  box-shadow: var(--glow-arcane);
}

.custom-action-send-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.custom-action-send-btn:hover {
  box-shadow: var(--glow-arcane);
  transform: translateY(-1px);
}

/* Tactical Panel Styles */
.tactical-panel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  height: 100%;
  overflow-y: auto;
}

.tactical-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-mint);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.target-creature-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.target-name {
  font-size: 14px;
}

.target-health-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.target-health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width 0.3s ease;
}

.target-status-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.tactical-zones-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tactical-zone-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.zone-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.zone-occupants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zone-occupant-pill {
  font-size: 10.5px;
  padding: 2px 6px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.zone-empty-text {
  font-size: 10.5px;
  color: var(--text-muted);
}

.initiative-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.initiative-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.initiative-row.active-turn {
  border-color: var(--color-mint);
  background: rgba(168, 85, 247, 0.1);
}

/* Combat Thumbnail Expand Affordances */
/* Added: 2026-09-16T20:00:00Z */
.target-portrait {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.target-portrait:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  border-color: #f59e0b !important;
}

.initiative-avatar {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.initiative-avatar:hover {
  transform: scale(1.22);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
  outline: 2px solid #f59e0b;
}
