/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* GitHub Dark Theme Colors */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-overlay: #21262d;

  --text-primary: #e6edf3;
  --text-secondary: #7d8590;
  --text-muted: #484f58;

  --border-primary: #30363d;
  --border-secondary: #21262d;
  --border-muted: #373e47;

  --accent-primary: #d57455;
  --accent-hover: #e08567;
  --accent-active: #c46343;

  --success: #238636;
  --success-emphasis: #2ea043;
  --danger: #da3633;
  --warning: #d29922;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 60px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: width var(--transition-normal), transform var(--transition-normal);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-logo .logo-text {
  display: none;
}

.logo-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.toggle-icon {
  font-size: 1.125rem;
}

.sidebar-stats {
  padding: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar.collapsed .sidebar-stats {
  grid-template-columns: 1fr;
  padding: var(--spacing-md);
}

.sidebar-stat {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: 8px;
  transition: transform var(--transition-fast);
}

.sidebar-stat:hover {
  transform: translateY(-2px);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
}

.stat-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
  white-space: nowrap;
}

.sidebar.collapsed .stat-text {
  display: none;
}

.sidebar-section {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar.collapsed .sidebar-section {
  padding: var(--spacing-md);
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.sidebar.collapsed .section-title {
  display: none;
}

.section-count {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

.marketplace-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xs);
}

.sidebar.collapsed .marketplace-filters {
  display: none;
}

.marketplace-filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-xs);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.marketplace-filter-btn:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.marketplace-filter-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--border-muted);
}

.marketplace-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: var(--spacing-md);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
  text-align: left;
  position: relative;
}

.marketplace-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.marketplace-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.marketplace-item.disabled {
  opacity: 0.6;
}

.marketplace-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.marketplace-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar.collapsed .marketplace-info {
  display: none;
}

.marketplace-name {
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marketplace-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.marketplace-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.marketplace-status.enabled {
  background: var(--success);
}

.marketplace-status.disabled {
  background: var(--text-muted);
}

.sidebar.collapsed .marketplace-status {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
}

.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  gap: var(--spacing-md);
}

.sidebar-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.sidebar-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.sidebar.collapsed .sidebar-footer {
  padding: var(--spacing-md);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.link-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.sidebar.collapsed .link-text {
  display: none;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--spacing-lg) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left {
  flex: 1;
  min-width: 200px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.title-icon {
  font-size: 1.75rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  width: 250px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.view-controls {
  display: flex;
  gap: var(--spacing-xs);
  background: var(--bg-tertiary);
  padding: var(--spacing-xs);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.view-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.view-icon {
  font-size: 1rem;
}

.filters-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  position: sticky;
  top: 78px;
  z-index: 40;
}

.filter-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.filter-chip.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.chip-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-chip.active .chip-badge {
  background: rgba(0, 0, 0, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.enabled {
  background: var(--success);
}

.status-dot.disabled {
  background: var(--text-muted);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sort-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sort-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-select:hover {
  border-color: var(--border-muted);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ==================== PLUGINS CONTAINER ==================== */
.plugins-container {
  flex: 1;
  padding: var(--spacing-xl);
  overflow-y: auto;
}

.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  animation: fadeIn var(--transition-normal);
  align-items: start;
}

.plugins-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  animation: fadeIn var(--transition-normal);
}

/* Plugin Card (Grid View) */
.plugin-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  position: relative;
  overflow: hidden;
  height: fit-content;
}

.plugin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.plugin-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.plugin-card:hover::before {
  transform: scaleX(1);
}

.plugin-card.disabled {
  opacity: 0.7;
}

.plugin-card.disabled:hover {
  transform: translateY(-2px);
}

.plugin-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.plugin-card-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.plugin-card-status.enabled {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.plugin-card-status.disabled {
  background: var(--text-muted);
}

.plugin-card-title {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.plugin-card-version {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.plugin-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-card-components {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
}

.component-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.plugin-card:hover .component-badge {
  border-color: var(--border-muted);
}

.component-icon {
  font-size: 1.125rem;
}

.component-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-secondary);
  font-size: 0.75rem;
}

.plugin-card-marketplace {
  color: var(--text-secondary);
  font-weight: 500;
}

.plugin-card-total {
  color: var(--text-muted);
}

/* Plugin List Item (List View) */
.plugin-list-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  position: relative;
}

.plugin-list-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform var(--transition-normal);
  border-radius: 10px 0 0 10px;
}

.plugin-list-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.plugin-list-item:hover::before {
  transform: scaleY(1);
}

.plugin-list-item.disabled {
  opacity: 0.7;
}

.plugin-list-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plugin-list-status.enabled {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.plugin-list-status.disabled {
  background: var(--text-muted);
}

.plugin-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.plugin-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.plugin-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plugin-list-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-list-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.plugin-list-version {
  background: var(--bg-overlay);
  padding: 0.125rem 0.5rem;
  border-radius: 8px;
}

.plugin-list-components {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
}

.component-badge-sm {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.component-badge-sm .component-icon {
  font-size: 1rem;
}

.component-badge-sm .component-value {
  font-weight: 600;
  color: var(--accent-primary);
}

.plugin-list-action {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.plugin-list-item:hover .plugin-list-action {
  color: var(--accent-primary);
  transform: translateX(4px);
}

.action-icon {
  font-size: 1.25rem;
}

/* ==================== LOADING & EMPTY STATES ==================== */
.content-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  min-height: 300px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.empty-state-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  min-height: 400px;
}

.empty-state {
  text-align: center;
  max-width: 400px;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: var(--spacing-lg);
}

.empty-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.empty-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: var(--spacing-lg);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-container::-webkit-scrollbar {
  width: 8px;
}

.modal-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.modal-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.modal-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-lg);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.modal-title-section {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.modal-badges {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.modal-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.modal-badge.version-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

.modal-badge.status-badge.enabled {
  background: var(--success);
  color: white;
}

.modal-badge.status-badge.disabled {
  background: var(--text-muted);
  color: white;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.close-icon {
  font-size: 1.25rem;
  font-weight: 300;
}

.modal-body {
  padding: var(--spacing-xl);
}

.modal-section {
  margin-bottom: var(--spacing-xl);
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.modal-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.modal-components-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

.modal-component-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.modal-component-card:hover {
  border-color: var(--border-muted);
  transform: translateY(-2px);
}

.modal-component-icon {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-sm);
}

.modal-component-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.modal-component-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-details-grid {
  display: grid;
  gap: var(--spacing-sm);
}

.detail-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.detail-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.keyword-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.keyword-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border: none;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  font-size: 1.125rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .plugins-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .search-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar.collapsed ~ .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .page-title {
    font-size: 1.25rem;
  }

  .search-input {
    width: 150px;
  }

  .filters-bar {
    padding: var(--spacing-md) var(--spacing-lg);
    flex-direction: column;
    align-items: flex-start;
  }

  .plugins-container {
    padding: var(--spacing-lg);
  }

  .plugins-grid {
    grid-template-columns: 1fr;
  }

  .plugin-card-components {
    grid-template-columns: repeat(2, 1fr);
  }

  .plugin-list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .plugin-list-components {
    width: 100%;
    justify-content: space-around;
  }

  .modal-components-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-header,
  .modal-body {
    padding: var(--spacing-lg);
  }

  .detail-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .detail-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .top-bar-right {
    width: 100%;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .view-controls {
    width: 100%;
    justify-content: center;
  }

  .filter-group {
    width: 100%;
  }

  .filter-chip {
    flex: 1;
    justify-content: center;
  }

  .modal-components-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== PLUGIN ACTIONS ==================== */
.plugin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.action-button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-fast);
}

.action-button:hover {
  background: var(--bg-overlay);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-button:active {
  transform: translateY(0);
}

.action-button.install-btn {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.action-button.install-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.action-button.enable-btn {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.action-button.enable-btn:hover {
  background: var(--success-emphasis);
  border-color: var(--success-emphasis);
  color: white;
}

.action-button.disable-btn {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.action-button.disable-btn:hover {
  background: #e0a928;
  border-color: #e0a928;
  color: white;
}

.action-button.uninstall-btn {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.action-button.uninstall-btn:hover {
  background: #e04643;
  border-color: #e04643;
  color: white;
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.action-icon {
  font-size: 1.125rem;
}

/* ==================== COMMAND REFERENCE ==================== */
.command-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.command-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  padding: var(--spacing-md);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--spacing-md);
  align-items: center;
  transition: all var(--transition-fast);
  position: relative;
}

.command-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.command-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-width: 140px;
}

.command-icon {
  font-size: 1.25rem;
}

.command-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.command-code {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8125rem;
  color: var(--accent-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.command-code::-webkit-scrollbar {
  height: 4px;
}

.command-code::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.command-code::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 2px;
}

.command-copy-btn {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.command-copy-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.command-copy-btn:active {
  transform: scale(0.95);
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  background: var(--success);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-message {
  white-space: nowrap;
}

/* ==================== RESPONSIVE - Commands ==================== */
@media (max-width: 768px) {
  .command-item {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .command-header {
    min-width: auto;
  }

  .command-code {
    width: 100%;
  }

  .command-copy-btn {
    width: 100%;
    justify-content: center;
  }

  .plugin-actions-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    left: var(--spacing-lg);
  }
}

/* ==================== REFRESH BUTTON ==================== */
.refresh-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-right: var(--spacing-sm);
}

.refresh-btn:hover {
  background: var(--bg-overlay);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.refresh-btn:active {
  transform: scale(0.95);
}

.refresh-btn.refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

.refresh-icon {
  font-size: 1.125rem;
  transition: transform var(--transition-normal);
}

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