/* ThresholdLibrary Component Styles */
/* Modular library component following Threshold design system */

.library-panel {
  background: var(--panel, #1a1d21);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  box-shadow: var(--shadow, 0 8px 32px rgba(0,0,0,0.3));
  color: var(--text, #e8e8e8);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.library-header {
  padding: 16px 16px 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}


.library-header h3 {
  margin: 0;
  color: var(--gothic-gold, #d4af37);
  font-size: 16px;
  font-weight: 400;
}

.library-search {
  position: relative;
}

.library-search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--panel-hover, #252932);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 4px;
  color: var(--text, #e8e8e8);
  font-size: 14px;
}

.library-search input:focus {
  outline: none;
  border-color: var(--accent, #4a9eff);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.library-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.library-search {
  flex: 1;
  max-width: 250px;
  margin: 0 16px;
}

.filter-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 4px;
  color: var(--muted, #8b949e);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--panel-hover, #252932);
  color: var(--text, #e8e8e8);
}

.filter-btn.active {
  background: var(--accent, #4a9eff);
  color: white;
  border-color: var(--accent, #4a9eff);
}

.marketplace-btn {
  padding: 4px 8px;
  font-size: 11px;
  background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
  border: 1px solid #d4af37;
  color: #1a1a1a;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.marketplace-btn:hover {
  background: linear-gradient(135deg, #e6c547 0%, #d4af37 100%);
  border-color: #e6c547;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.library-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.library-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  justify-items: center;
  padding: 8px 8px 6px 8px;
  margin-top: -10px;
}

.library-item {
  width: 64px;
  height: 64px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: all 0.2s ease;
  filter: brightness(0.9);
  border: none;
  padding: 0;
  display: block;
}

.library-item:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.item-image {
  display: none;
}

.item-details {
  display: none;
}

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

.item-name {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #e8e8e8);
}

.item-description {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--muted, #8b949e);
  line-height: 1.4;
}

.item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.item-type {
  color: var(--accent, #4a9eff);
  font-weight: 500;
}

.item-date {
  color: var(--muted, #8b949e);
}

.item-actions {
  flex-shrink: 0;
}

.item-launch {
  padding: 8px 16px;
  font-size: 14px;
}

.library-empty,
.library-error,
.library-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted, #8b949e);
}

.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.library-empty h4,
.library-error h4 {
  margin: 0 0 8px 0;
  color: var(--text, #e8e8e8);
  font-size: 18px;
}

.library-empty p,
.library-error p {
  margin: 0 0 16px 0;
  font-size: 14px;
}

.library-footer {
  padding: 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  text-align: center;
  flex-shrink: 0;
}

/* Theme variations */
.campaignvtt-theme .library-panel {
  --accent: #d4af37;
  --panel: #2d2d2d;
  --panel-hover: #404040;
  --text: #e8e8e8;
  --muted: #6b6b6b;
  --border: rgba(212, 175, 55, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
  .library-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .library-search {
    width: 100%;
  }
  
  .library-filters {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .library-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .item-details {
    margin: 12px 0;
  }
  
  .item-meta {
    justify-content: center;
  }
}

/* Scrollbar styling */
.library-content::-webkit-scrollbar {
  width: 6px;
}

.library-content::-webkit-scrollbar-track {
  background: var(--panel, #1a1d21);
}

.library-content::-webkit-scrollbar-thumb {
  background: var(--accent, #4a9eff);
  border-radius: 3px;
}

.library-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent, #4a9eff);
  opacity: 0.8;
}

