/* Inventory Modal */
.inventory-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.inventory-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.inventory-modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(10, 10, 26, 0.98), rgba(26, 26, 52, 0.98));
  border: 2px solid rgba(0, 255, 159, 0.3);
  border-radius: 12px;
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Header */
.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid #333;
  background: #111;
}

.inventory-header h2 {
  margin: 0;
  color: #4ade80;
  font-size: 1.1em;
  font-weight: bold;
}

.inventory-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: all 0.2s;
}

.inventory-close:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

/* Tabs */
.inventory-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 2px solid #333;
  background: #0f0f0f;
}

.inventory-tab {
  padding: 6px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-left: 2px solid #3b82f6;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75em;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}

.inventory-tab:hover {
  color: #fff;
  background: #222;
  border-left-color: #60a5fa;
}

.inventory-tab.active {
  background: #1e3a5f;
  border-left-color: #3b82f6;
  color: #60a5fa;
}

/* Body */
.inventory-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Equipment Panel */
.equipment-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-radius: 6px;
  padding: 10px;
}

.equipment-panel h3 {
  margin: 0 0 8px 0;
  color: #00ff9f;
  font-size: 0.9em;
  font-weight: bold;
  padding: 6px 8px;
  background: #1a1a1a;
  border-left: 3px solid #4ade80;
}

.equipment-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.equipment-slot {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-left: 2px solid #3b82f6;
  border-radius: 4px;
  padding: 6px 8px;
  transition: all 0.2s;
}

.equipment-slot:hover {
  border-left-color: #60a5fa;
  background: rgba(0, 255, 159, 0.05);
}

.slot-label {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.slot-content {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.75em;
  font-style: italic;
}

.equipped-item {
  width: 100%;
}

.equipped-item .item-icon {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 4px;
}

.equipped-item .item-name {
  color: #fff;
  font-size: 0.75em;
  text-align: center;
  margin-bottom: 4px;
}

.equipped-item .item-actions {
  display: flex;
  justify-content: center;
}

/* Inventory Panel */
.inventory-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.inventory-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 8px;
  background: #1a1a1a;
  border-left: 3px solid #4ade80;
}

.inventory-panel-header h3 {
  margin: 0;
  color: #00ff9f;
  font-size: 0.9em;
  font-weight: bold;
}

.inventory-capacity {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75em;
  font-family: 'Courier New', monospace;
}

/* Inventory Grid */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  overflow-y: auto;
}

.inventory-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-left: 2px solid #3b82f6;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.inventory-item:hover {
  border-left-color: #60a5fa;
  background: rgba(0, 255, 159, 0.05);
  transform: translateY(-1px);
}

.inventory-item .item-icon {
  font-size: 1.5rem;
  text-align: center;
}

.inventory-item .item-info {
  text-align: center;
}

.inventory-item .item-name {
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
}

.inventory-item .item-quantity {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7em;
  line-height: 1.2;
}

.inventory-item .item-volume {
  color: rgba(0, 255, 159, 0.7);
  font-size: 0.65em;
  font-style: italic;
  line-height: 1.2;
}

.item-rarity {
  text-align: center;
  font-size: 0.65em;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.item-rarity.common {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.item-rarity.uncommon {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.item-rarity.rare {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.item-rarity.legendary {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.item-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.item-action-btn {
  background: rgba(0, 255, 159, 0.1);
  border: 1px solid rgba(0, 255, 159, 0.3);
  color: #00ff9f;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.65em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.item-action-btn:hover {
  background: rgba(0, 255, 159, 0.2);
  border-color: #00ff9f;
}

.item-action-btn.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.item-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* Loading State */
.inventory-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: rgba(255, 255, 255, 0.6);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 255, 159, 0.2);
  border-top-color: #00ff9f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Empty State */
.inventory-empty-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
}

/* Ship Fittings */
.ship-fittings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fitting-section {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 159, 0.15);
  border-radius: 4px;
  padding: 8px;
}

.fitting-section h4 {
  margin: 0 0 6px 0;
  color: #00ff9f;
  font-size: 0.75em;
  font-weight: bold;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid #4ade80;
}

.fitting-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fitting-slot {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-left: 2px solid #3b82f6;
  border-radius: 4px;
  padding: 6px 8px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fitting-slot:hover {
  border-left-color: #60a5fa;
  background: rgba(0, 255, 159, 0.05);
}

.fitting-slot.filled {
  border-left-color: #4ade80;
}

.fitting-slot.empty {
  border-style: dashed;
}

.fitting-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fitting-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.fitting-info {
  flex-grow: 1;
  min-width: 0;
}

.fitting-name {
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
}

.fitting-stats {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fitting-action-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.65em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.fitting-action-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* Storehouse Locations */
.storehouse-locations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-info {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-radius: 4px;
  padding: 8px;
}

.location-info h4 {
  margin: 0 0 6px 0;
  color: #00ff9f;
  font-size: 0.75em;
  font-weight: bold;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid #4ade80;
}

.current-location-display {
  padding: 8px;
  text-align: center;
  font-size: 0.85em;
  color: #fff;
  font-weight: 600;
}

.location-section {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 159, 0.15);
  border-radius: 4px;
  padding: 8px;
}

.location-section h4 {
  margin: 0 0 8px 0;
  color: #00ff9f;
  font-size: 0.75em;
  font-weight: bold;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid #4ade80;
}

.storage-locations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.storage-location {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 159, 0.2);
  border-left: 2px solid #3b82f6;
  border-radius: 4px;
  padding: 8px;
  transition: all 0.2s;
}

.storage-location:hover {
  border-left-color: #60a5fa;
  background: rgba(0, 255, 159, 0.05);
}

.storage-location.current {
  border-left-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.storage-location.unavailable {
  opacity: 0.5;
  border-left-color: #6b7280;
}

.location-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.location-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.location-details {
  flex-grow: 1;
  min-width: 0;
}

.location-name {
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.location-type {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65em;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.65em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.location-status {
  font-size: 0.65em;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 6px;
}

.location-status.current {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.location-status.available {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.location-status.unavailable {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.location-action-btn {
  background: rgba(0, 255, 159, 0.1);
  border: 1px solid rgba(0, 255, 159, 0.3);
  color: #00ff9f;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.65em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: 100%;
  margin-top: 4px;
}

.location-action-btn:hover {
  background: rgba(0, 255, 159, 0.2);
  border-color: #00ff9f;
}

.location-help {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  padding: 8px;
}

.location-help p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.7em;
  line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .inventory-modal {
    padding: 0;
  }

  .inventory-modal-content {
    max-height: 100vh;
    border-radius: 0;
  }

  .inventory-body {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .equipment-panel {
    order: 2;
  }

  .inventory-panel {
    order: 1;
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
