/* Inspect Panel - Slide-in entity detail panel
 *
 * Shows detailed information about entities when clicked.
 * Slides in from the right side of the screen.
 */

/* ==========================================================================
   Backdrop
   ========================================================================== */

.inspect-panel__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.inspect-panel__backdrop--visible {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* ==========================================================================
   Panel Container
   ========================================================================== */

.inspect-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--bg-primary, #1e1e1e);
  border-left: 1px solid var(--border-color, #3e3e3e);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.inspect-panel--open {
  transform: translateX(0);
}

.inspect-panel--closing {
  transform: translateX(100%);
}

/* ==========================================================================
   Header
   ========================================================================== */

.inspect-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color, #3e3e3e);
  background: var(--bg-secondary, #252526);
}

.inspect-panel__header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.inspect-panel__type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(97, 175, 239, 0.1);
  color: var(--accent-primary, #61afef);
  flex-shrink: 0;
}

.inspect-panel__type-icon svg {
  width: 20px;
  height: 20px;
}

.inspect-panel__titles {
  flex: 1;
  min-width: 0;
}

.inspect-panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspect-panel__type-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inspect-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #888);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.inspect-panel__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #fff);
}

.inspect-panel__close svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Body
   ========================================================================== */

.inspect-panel__body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.inspect-panel__subtitle {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: var(--text-secondary, #888);
  font-style: italic;
}

.inspect-panel__description {
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary, #fff);
}

/* ==========================================================================
   Stats Grid
   ========================================================================== */

.inspect-panel__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.inspect-panel__stat {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--bg-tertiary, #2a2a2a);
  border-radius: 6px;
  border: 1px solid var(--border-color, #3e3e3e);
}

.inspect-panel__stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.inspect-panel__stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.inspect-panel__section {
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #3e3e3e);
}

.inspect-panel__section-title {
  margin: 0 0 8px 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Relationship badge */
.inspect-panel__relationship {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.inspect-panel__relationship--friendly {
  background: rgba(152, 195, 121, 0.2);
  color: var(--accent-secondary, #98c379);
}

.inspect-panel__relationship--neutral {
  background: rgba(150, 150, 150, 0.2);
  color: var(--text-secondary, #888);
}

.inspect-panel__relationship--hostile {
  background: rgba(224, 108, 117, 0.2);
  color: var(--accent-error, #e06c75);
}

.inspect-panel__notes {
  margin: 8px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #888);
  font-style: italic;
}

/* Tags */
.inspect-panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspect-panel__tag {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(97, 175, 239, 0.15);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--accent-primary, #61afef);
}

/* Components */
.inspect-panel__components {
  font-size: 0.9rem;
  color: var(--text-primary, #fff);
  font-family: var(--font-mono, 'Fira Code', monospace);
}

/* List */
.inspect-panel__list {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-primary, #fff);
}

.inspect-panel__list li {
  margin-bottom: 4px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.inspect-panel__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary, #888);
  gap: 12px;
}

.inspect-panel__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(97, 175, 239, 0.2);
  border-top-color: var(--accent-primary, #61afef);
  border-radius: 50%;
  animation: inspect-panel-spin 0.8s linear infinite;
}

@keyframes inspect-panel-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Footer Actions
   ========================================================================== */

.inspect-panel__footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #3e3e3e);
  background: var(--bg-secondary, #252526);
}

.inspect-panel__action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #3e3e3e);
  border-radius: 6px;
  background: var(--bg-tertiary, #2a2a2a);
  color: var(--text-primary, #fff);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inspect-panel__action:hover {
  background: var(--bg-primary, #1e1e1e);
  border-color: var(--accent-primary, #61afef);
}

.inspect-panel__action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.inspect-panel__action--primary {
  background: linear-gradient(
    180deg,
    rgba(97, 175, 239, 0.2) 0%,
    rgba(97, 175, 239, 0.1) 100%
  );
  border-color: rgba(97, 175, 239, 0.4);
  color: var(--accent-primary, #61afef);
}

.inspect-panel__action--primary:hover {
  background: linear-gradient(
    180deg,
    rgba(97, 175, 239, 0.3) 0%,
    rgba(97, 175, 239, 0.15) 100%
  );
  border-color: var(--accent-primary, #61afef);
}

/* ==========================================================================
   Type-specific Styling
   ========================================================================== */

/* NPC */
.inspect-panel--npc .inspect-panel__type-icon {
  background: rgba(8, 145, 178, 0.15);
  color: #22d3ee;
}

/* Location */
.inspect-panel--location .inspect-panel__type-icon {
  background: rgba(22, 163, 106, 0.15);
  color: #4ade80;
}

/* Item */
.inspect-panel--item .inspect-panel__type-icon {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
}

/* Spell */
.inspect-panel--spell .inspect-panel__type-icon {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
}

/* Creature/Monster */
.inspect-panel--creature .inspect-panel__type-icon,
.inspect-panel--monster .inspect-panel__type-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ==========================================================================
   Action States
   ========================================================================== */

.inspect-panel__action--success {
  background: rgba(152, 195, 121, 0.2);
  border-color: var(--accent-secondary, #98c379);
  color: var(--accent-secondary, #98c379);
}

.inspect-panel__action--success:hover {
  background: rgba(152, 195, 121, 0.3);
  border-color: var(--accent-secondary, #98c379);
}

.inspect-panel__action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Error State
   ========================================================================== */

.inspect-panel__error {
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(224, 108, 117, 0.15);
  border: 1px solid rgba(224, 108, 117, 0.3);
  border-radius: 6px;
  color: var(--accent-error, #e06c75);
  font-size: 0.85rem;
  animation: inspect-panel-error-fade-in 0.2s ease;
}

@keyframes inspect-panel-error-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  .inspect-panel {
    width: 100%;
    max-width: none;
  }
}
