/* Plugins Page Styles — Cropus AI */

/* Top bar */
.plugins-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.plugins-topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.plugins-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: transparent;
}

.plugins-tab-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--secondary-300);
  cursor: pointer;
  transition: background-color 140ms, color 140ms;
}

.plugins-tab-btn:hover {
  color: #180f08;
  background: rgba(0, 0, 0, 0.03);
}

.plugins-tab-btn.is-active {
  background: var(--sand, #eae2dc);
  color: var(--foreground, #180f08);
  font-weight: 500;
}

.plugins-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plugins-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: #180f08;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms, transform 120ms;
}

.plugins-add-btn:hover {
  background: #2b1d14;
  transform: translateY(-1px);
}

.plugins-add-btn svg {
  width: 12px;
  height: 12px;
}

/* Page content */
.plugins-content-container {
  box-sizing: border-box;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 36px 80px;
}

.plugins-header {
  margin-bottom: 24px;
}

.plugins-title {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  color: #180f08;
  letter-spacing: -0.3px;
}

.plugins-subtitle {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--secondary-300);
  line-height: 1.45;
}

/* Search input */
.plugins-search-bar {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.plugins-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--secondary-300);
  pointer-events: none;
}

.plugins-search-input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 0 18px 0 44px;
  font-family: inherit;
  font-size: 14px;
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(24, 15, 8, 0.03);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.plugins-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 143, 0.15);
}

.plugins-search-input::placeholder {
  color: var(--secondary-300);
}

/* Category Filter Pills */
.plugins-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 36px;
  scrollbar-width: none;
}

.plugins-category-row::-webkit-scrollbar {
  display: none;
}

.plugins-cat-pill {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--secondary-300);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms, color 140ms;
}

.plugins-cat-pill:hover {
  background: var(--secondary-700);
  color: #180f08;
}

.plugins-cat-pill.is-active {
  background: var(--sand, #eae2dc);
  color: var(--foreground, #180f08);
  font-weight: 500;
}

/* Section */
.plugins-section {
  margin-bottom: 40px;
}

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

.plugins-section-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: #180f08;
}

.plugins-see-all-link {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--secondary-300);
  cursor: pointer;
  transition: color 140ms;
}

.plugins-see-all-link:hover {
  color: #180f08;
  text-decoration: underline;
}

/* Grid of Cards */
.plugins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 36px;
}

.plugin-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 140ms;
  cursor: pointer;
}

.plugin-card:hover {
  background: rgba(0, 0, 0, 0.025);
}

.plugin-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(24, 15, 8, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plugin-icon-tile svg,
.plugin-icon-tile img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.plugin-body {
  display: flex;
  flex-direction: column;
}

.plugin-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #180f08;
  line-height: 1.3;
}

.plugin-desc {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-300);
  line-height: 1.45;
}

.plugins-empty-search {
  display: none;
  text-align: center;
  padding: 48px 0;
  color: var(--secondary-300);
  font-size: 14.5px;
}

.plugins-empty-search.is-visible {
  display: block;
}

/* Responsive */
@media (max-width: 860px) {
  .plugins-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .plugins-content-container {
    padding: 24px 20px 60px;
  }
}

@media (max-width: 767px) {
  .plugins-topbar {
    padding: 0 16px;
  }
}

@media (max-width: 440px) {
  .plugins-tab-btn:not(.is-active) {
    display: none;
  }
}

/* YouTube Integration Card & Modal Styles */
.plugin-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plugin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
}

.plugin-status-badge.is-connected {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.yt-badge-connected {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.yt-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
}

/* Modal Overlay */
.yt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 15, 8, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ytModalFadeIn 180ms ease;
}

@keyframes ytModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.yt-modal-card {
  width: 100%;
  max-width: 480px;
  background: #fefdfb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(24, 15, 8, 0.12), 0 2px 6px rgba(24, 15, 8, 0.04);
  padding: 24px;
  box-sizing: border-box;
  animation: ytModalScaleIn 180ms ease;
}

@keyframes ytModalScaleIn {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.yt-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  position: relative;
}

.yt-modal-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f9f6f3;
  border: 1px solid var(--border-soft, #f1ece7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yt-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #180f08;
  line-height: 1.3;
}

.yt-modal-subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--secondary-300, #6b5a50);
  line-height: 1.4;
}

.yt-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  border: none;
  background: transparent;
  color: var(--secondary-300, #6b5a50);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 140ms, color 140ms;
}

.yt-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #180f08;
}

.yt-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Channel Card */
.yt-channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f9f6f3;
  border: 1px solid var(--border-soft, #f1ece7);
  border-radius: 14px;
}

.yt-channel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.yt-channel-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #de9b4a;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.yt-channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.yt-channel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.yt-channel-name {
  font-size: 15px;
  font-weight: 500;
  color: #180f08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yt-channel-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--secondary-300, #6b5a50);
}

/* Permissions & Scopes */
.yt-permissions-card,
.yt-scope-summary-card {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border-soft, #f1ece7);
  border-radius: 14px;
}

.yt-permissions-label,
.yt-scope-heading {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary-300, #6b5a50);
  margin-bottom: 10px;
}

.yt-permissions-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-permissions-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #180f08;
}

.yt-scope-item {
  margin-bottom: 8px;
}

.yt-scope-item:last-child {
  margin-bottom: 0;
}

.yt-scope-item strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #180f08;
}

.yt-scope-item p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--secondary-300, #6b5a50);
  line-height: 1.4;
}

.yt-modal-description {
  margin: 0;
  font-size: 14px;
  color: #3d2e24;
  line-height: 1.5;
}

.yt-modal-disclaimer {
  margin: 0;
  font-size: 11.5px;
  color: var(--secondary-300, #6b5a50);
  line-height: 1.4;
}

/* Actions */
.yt-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.yt-btn-primary,
.yt-btn-secondary,
.yt-btn-disconnect,
.yt-btn-connect-google {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms, transform 120ms, opacity 140ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.yt-btn-primary {
  border: none;
  background: #180f08;
  color: #ffffff;
}

.yt-btn-primary:hover {
  background: #2b1d14;
}

.yt-btn-secondary {
  border: 1px solid var(--border-soft, #f1ece7);
  background: transparent;
  color: #180f08;
}

.yt-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.yt-btn-disconnect {
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.05);
  color: #dc2626;
  margin-right: auto;
}

.yt-btn-disconnect:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.1);
}

.yt-btn-disconnect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.yt-btn-connect-google {
  border: none;
  background: #180f08;
  color: #ffffff;
}

.yt-btn-connect-google:hover {
  background: #2b1d14;
  transform: translateY(-1px);
}

/* Dark Theme Adaptations */
html[data-theme="dark"] .yt-modal-card {
  background: #141414;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .yt-modal-title { color: #f5f5f5; }
html[data-theme="dark"] .yt-modal-subtitle { color: #888888; }
html[data-theme="dark"] .yt-modal-icon-wrap { background: #1c1c1c; border-color: #262626; }
html[data-theme="dark"] .yt-channel-card { background: #1a1a1a; border-color: #262626; }
html[data-theme="dark"] .yt-channel-name { color: #f5f5f5; }
html[data-theme="dark"] .yt-permissions-card,
html[data-theme="dark"] .yt-scope-summary-card { background: #181818; border-color: #262626; }
html[data-theme="dark"] .yt-permissions-list li { color: #e5e5e5; }
html[data-theme="dark"] .yt-scope-item strong { color: #f5f5f5; }
html[data-theme="dark"] .yt-modal-description { color: #cccccc; }
html[data-theme="dark"] .yt-modal-disclaimer { color: #777777; }
html[data-theme="dark"] .yt-btn-primary,
html[data-theme="dark"] .yt-btn-connect-google { background: #ffffff; color: #000000; }
html[data-theme="dark"] .yt-btn-primary:hover,
html[data-theme="dark"] .yt-btn-connect-google:hover { background: #e5e5e5; }
html[data-theme="dark"] .yt-btn-secondary { border-color: #333333; color: #cccccc; }
html[data-theme="dark"] .yt-btn-secondary:hover { background: rgba(255, 255, 255, 0.05); }

