/* Inventory Tracking CSS - Faith & Fire Preparedness Suite */

.inventory-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
  color: #f3f4f6;
  font-family: inherit;
}

/* Navigation Header Tabs */
.preparedness-nav-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  background: #1f2937;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #374151;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.preparedness-nav-tab {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preparedness-nav-tab:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

.preparedness-nav-tab.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Overview Header Stats Banner */
.inventory-stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.inventory-stat-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 4px;
}

/* Control Bar (Search, Filter & Add) */
.inventory-control-bar {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 280px;
}

.inventory-search-input {
  flex: 1;
  min-width: 180px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
}

.inventory-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.inventory-filter-select {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 14px;
  color: #d1d5db;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

.add-item-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.add-item-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

/* Category Group Accordions */
.inventory-category-group {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.inventory-category-group[open] {
  border-color: #3b82f6;
}

.inventory-category-header {
  padding: 16px 20px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.inventory-category-header::-webkit-details-marker {
  display: none;
}

.category-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.category-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-stock-badge {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.category-chevron {
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.inventory-category-group[open] .category-chevron {
  transform: rotate(180deg);
}

/* Items Grid Inside Category */
.inventory-items-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  background: #15191c;
  border-top: 1px solid #374151;
}

.inventory-item-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.inventory-item-card:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.inventory-item-card.has-stock {
  border-left: 4px solid #10b981;
}

.inventory-item-card.zero-stock {
  border-left: 4px solid #f59e0b;
}

.inventory-item-card.expired {
  border-left: 4px solid #ef4444;
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.35;
}

.custom-tag {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.item-recommended-ref {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 2px;
}

.item-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #111827;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2d3748;
}

.item-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
}

.item-detail-label {
  color: #9ca3af;
  font-weight: 500;
}

.item-detail-value {
  font-weight: 700;
  color: #e5e7eb;
}

/* Condition Badges */
.condition-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.condition-new {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.condition-good {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.condition-fair {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.condition-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.item-notes-text {
  font-size: 0.8rem;
  color: #d1d5db;
  font-style: italic;
  background: rgba(31, 41, 55, 0.5);
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid #60a5fa;
  word-break: break-word;
}

.item-card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.item-action-btn {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item-action-btn:hover {
  background: #4b5563;
  color: #ffffff;
}

.item-action-btn.delete-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.item-action-btn.delete-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Modal Form for Editing / Adding Items */
.inventory-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inventory-modal-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 14px;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 18px 22px;
  background: #111827;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .modal-grid-2 {
    grid-template-columns: 1fr;
  }
}

.modal-footer {
  padding: 16px 22px;
  background: #111827;
  border-top: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
