
.plugins-layout,
.macros-layout {
  display: grid;
  gap: 14px;
}

.macros-layout {
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 0.62fr);
}

.macro-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: min(72vh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
}

/* ══════════════════════════════════════
   Extensions Page Header & Cyber-Glass Layout
   ══════════════════════════════════════ */
.plugins-main-card {
  background: rgba(13, 20, 36, 0.75);
  border: 1px solid rgba(112, 152, 220, 0.18);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(14px);
}

.plugins-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.plugins-title-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.plugins-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plugins-heading-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
}

.plugins-heading-text h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.plugins-subtitle {
  font-size: 12px;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.plugin-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.85);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.filter-tab-pill.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.filter-tab-pill .pill-count {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.btn-save-plugins {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
}

.btn-save-plugins:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.5);
}

.plugin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: rgba(11, 18, 33, 0.6);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.plugin-search-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 460px;
}

.plugin-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s;
}

.plugin-search-wrap:focus-within .search-icon {
  color: #3b82f6;
}

.plugin-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 8px;
  font-size: 12.5px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  transition: all 0.2s;
  box-sizing: border-box;
}

.plugin-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.plugin-category-pills {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-pill:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.cat-pill.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
}

.cat-pill-icon {
  font-size: 12px;
  line-height: 1;
}

/* ══════════════════════════════════════
   Modern Plugin / Extensions Card Grid
   ══════════════════════════════════════ */
.plugin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  padding: 4px 0 12px;
}

.plugin-card {
  border: 1px solid rgba(112, 152, 220, 0.18);
  border-radius: 12px;
  background: rgba(13, 23, 42, 0.82);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.plugin-card:hover {
  border-color: rgba(112, 152, 220, 0.35);
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.plugin-card.is-active {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 18px -2px rgba(16, 185, 129, 0.12);
}

.plugin-card.is-open {
  grid-column: 1 / -1 !important;
  border-color: rgba(59, 130, 246, 0.55) !important;
  background: rgba(11, 20, 36, 0.95) !important;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.35) !important;
  transform: none !important;
}

/* Card Header */
.plugin-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.plugin-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.plugin-card:hover .plugin-cat-icon {
  transform: scale(1.05);
}

.icon-combat {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.icon-automation {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.icon-movement {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.28);
}

.icon-chat {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.icon-security {
  background: rgba(139, 92, 246, 0.14);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.icon-network {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.icon-utility {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.plugin-card-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plugin-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plugin-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.plugin-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
}

.plugin-status-dot .dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-active {
  color: #34d399;
}

.status-active .dot-pulse {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

.status-idle {
  color: var(--text-2, #94a3b8);
}

.status-idle .dot-pulse {
  background: #64748b;
}

.plugin-mode-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-1, #cbd5e1);
}

/* iOS-Style Toggle Switch */
.plugin-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.plugin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.plugin-switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 22px;
}

.plugin-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #cbd5e1;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.plugin-switch input:checked + .plugin-switch-slider {
  background: linear-gradient(135deg, #059669, #10b981);
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.plugin-switch input:checked + .plugin-switch-slider:before {
  transform: translateX(20px);
  background: #ffffff;
}

/* Engine Tags */
.plugin-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.plugin-tag {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  letter-spacing: 0.02em;
}

.plugin-tag.tag-dual {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.22));
  border: 1px solid rgba(129, 140, 248, 0.45);
  color: #c7d2fe;
}

.plugin-tag.tag-soulfire {
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #67e8f9;
}

.plugin-tag.tag-mineflayer {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

/* Card Body */
.plugin-card-desc {
  font-size: 12.5px;
  color: var(--text-2, #94a3b8);
  padding: 0 16px 12px;
  line-height: 1.45;
  flex: 1 1 auto;
}

/* Card Foot */
.plugin-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
  margin-top: auto;
}

.plugin-target-summary {
  font-size: 12px;
  color: var(--text-2, #94a3b8);
}

.plugin-target-summary strong {
  color: var(--text-0, #fff);
  margin-left: 2px;
}

.btn-configure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  transition: all 0.2s;
}

.btn-configure.btn-open {
  background: rgba(37, 99, 235, 0.25);
  border-color: #3b82f6;
  color: #93c5fd;
}

.btn-configure .chevron-icon {
  transition: transform 0.2s ease;
}

.btn-configure.btn-open .chevron-icon {
  transform: rotate(180deg);
}

/* ══════════════════════════════════════
   Modern Plugin Editor Drawer
   ══════════════════════════════════════ */
.plugin-editor {
  border-top: 1px solid rgba(112, 152, 220, 0.26);
  background: rgba(9, 16, 30, 0.95);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.plugin-editor-top {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(320px, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .plugin-editor-top {
    grid-template-columns: 1fr;
  }
}

.plugin-editor-box {
  border: 1px solid rgba(111, 152, 220, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plugin-editor-box h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0, #fff);
}

.plugin-editor-box p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2, #94a3b8);
}

.plugin-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plugin-chip-actions {
  display: flex;
  gap: 6px;
}

/* Segmented Control */
.plugin-segmented-control {
  display: flex;
  background: rgba(11, 19, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.segmented-item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-2, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.segmented-item:hover {
  color: var(--text-0, #fff);
  background: rgba(255, 255, 255, 0.05);
}

.segmented-item.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Bot Target Chips */
.plugin-bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.bot-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-1, #cbd5e1);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.bot-target-chip:hover {
  border-color: rgba(112, 152, 220, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.bot-target-chip.selected {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
}

.bot-avatar-badge {
  font-size: 13px;
  line-height: 1;
}

.bot-check-icon {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.7;
}

.bot-target-chip.selected .bot-check-icon {
  color: #60a5fa;
  opacity: 1;
}

/* Settings Section */
.plugin-settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plugin-section-heading h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-0, #fff);
}

.plugin-section-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2, #94a3b8);
}

.plugin-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.plugin-setting-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid rgba(113, 156, 226, 0.18);
  border-radius: 10px;
  background: rgba(11, 20, 36, 0.6);
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.plugin-setting-field:focus-within {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(11, 20, 36, 0.85);
}

.plugin-setting-field input[type="text"],
.plugin-setting-field input[type="number"],
.plugin-setting-field input[type="password"],
.plugin-setting-field select,
.plugin-setting-field textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(9, 14, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.plugin-setting-field input[type="text"]:focus,
.plugin-setting-field input[type="number"]:focus,
.plugin-setting-field input[type="password"]:focus,
.plugin-setting-field select:focus,
.plugin-setting-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(9, 14, 26, 0.95);
}

.plugin-setting-field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.4;
}

.plugin-setting-field select {
  cursor: pointer;
}

.plugin-setting-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-0, #fff);
}

.plugin-setting-hint {
  font-size: 11.5px;
  color: var(--text-2, #94a3b8);
  line-height: 1.35;
}

.plugin-setting-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.plugin-switch-text {
  font-size: 12px;
  font-weight: 600;
}

.plugin-switch-text.active {
  color: #34d399;
}

.plugin-switch-text.inactive {
  color: var(--text-2, #94a3b8);
}

.plugin-minmax-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plugin-minmax-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plugin-minmax-field span {
  font-size: 11px;
  color: var(--text-2, #94a3b8);
}

.plugin-string-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plugin-string-list-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plugin-string-list-row input {
  flex: 1 1 auto;
}

/* Editor Footer */
.plugin-editor-footer {
  border-top: 1px solid rgba(113, 156, 226, 0.2);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.plugin-editor-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2, #94a3b8);
  font-size: 12.5px;
}

.footer-mode-tag {
  text-transform: capitalize;
  font-weight: 600;
  color: var(--text-1, #cbd5e1);
}

.footer-sep {
  opacity: 0.5;
}

