/**
 * Shared Platform Theme Customizer Stylesheet
 * 100% Platform Owned — Ensures consistent, beautiful Edit Mode UI across ALL themes
 */

[x-cloak] { display: none !important; }

:root {
  --agy-editor-bg: #090e17;
  --agy-editor-card-bg: #111827;
  --agy-editor-card-soft: #1f2937;
  --agy-editor-border: rgba(255, 255, 255, 0.12);
  --agy-editor-border-strong: rgba(255, 255, 255, 0.2);
  --agy-editor-primary: #2563eb;
  --agy-editor-primary-hover: #1d4ed8;
  --agy-editor-emerald: #10b981;
  --agy-editor-text: #f9fafb;
  --agy-editor-text-muted: #9ca3af;
  --agy-editor-text-subtle: #6b7280;
  --agy-editor-radius: 8px;
  --agy-editor-radius-sm: 6px;
}

/* Base Panel */
.agy-editor-panel,
.tv5-editor-panel {
  background: var(--agy-editor-card-bg) !important;
  color: var(--agy-editor-text) !important;
  padding: 32px 0;
  border-bottom: 2px solid var(--agy-editor-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.agy-editor-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.agy-editor-header,
.tv5-editor-header {
  margin-bottom: 24px;
}

.agy-editor-badge,
.tv5-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.agy-editor-title,
.tv5-editor-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 8px 0 0;
}

.agy-editor-desc,
.tv5-editor-desc {
  font-size: 0.85rem;
  color: var(--agy-editor-text-muted);
  margin: 4px 0 16px;
}

/* Tabs */
.agy-editor-tabs,
.tv5-editor-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-bottom: 1px solid var(--agy-editor-border);
  padding-bottom: 12px;
}

.agy-tab-btn,
.tv5-tab-btn {
  background: transparent;
  border: 1px solid var(--agy-editor-border);
  color: var(--agy-editor-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--agy-editor-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agy-tab-btn:hover,
.tv5-tab-btn:hover {
  background: var(--agy-editor-card-soft);
  color: #ffffff;
  border-color: var(--agy-editor-border-strong);
}

.agy-tab-btn--active,
.tv5-tab-btn--active {
  background: var(--agy-editor-primary) !important;
  border-color: var(--agy-editor-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Section Card */
.agy-editor-section-card,
.tv5-editor-section-card {
  background: var(--agy-editor-card-soft);
  border: 1px solid var(--agy-editor-border);
  border-radius: var(--agy-editor-radius);
  padding: 24px;
}

.agy-editor-section-grid,
.tv5-editor-section-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .agy-editor-section-grid,
  .tv5-editor-section-grid {
    grid-template-columns: 1fr 1.5fr;
  }
}

.agy-editor-field-block,
.tv5-editor-field-block {
  display: flex;
  flex-direction: column;
}

.agy-editor-field-label,
.tv5-editor-field-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.agy-editor-field-sub,
.tv5-editor-field-sub {
  font-size: 0.8rem;
  color: var(--agy-editor-text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.agy-editor-logo-box,
.tv5-editor-logo-box {
  max-width: 160px;
  border-radius: var(--agy-editor-radius-sm);
  overflow: hidden;
  border: 1px dashed var(--agy-editor-border-strong);
  background: var(--agy-editor-bg);
  padding: 8px;
}

.agy-editor-button-box,
.tv5-editor-button-box {
  background: var(--agy-editor-bg);
  border: 1px dashed var(--agy-editor-border-strong);
  border-radius: var(--agy-editor-radius-sm);
  padding: 16px;
  display: inline-block;
}

/* Links List */
.agy-editor-list,
.tv5-editor-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.agy-editor-card,
.tv5-editor-card {
  background: #1e293b;
  border: 1px solid var(--agy-editor-border-strong);
  border-radius: var(--agy-editor-radius);
  padding: 18px;
  transition: border-color 0.2s;
}

.agy-editor-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
}

.agy-editor-row,
.tv5-editor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agy-editor-index,
.tv5-editor-index {
  font-size: 0.82rem;
  color: var(--agy-editor-emerald);
  font-weight: 700;
  font-family: monospace;
}

.agy-editor-input,
.tv5-editor-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--agy-editor-border-strong);
  border-radius: var(--agy-editor-radius-sm);
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.9rem;
}

.agy-editor-input:focus,
.tv5-editor-input:focus {
  outline: none;
  border-color: var(--agy-editor-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.agy-editor-remove,
.tv5-editor-remove {
  background: transparent;
  border: 1px solid var(--agy-editor-border);
  color: var(--agy-editor-text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--agy-editor-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.agy-editor-remove:hover,
.tv5-editor-remove:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.agy-editor-picker-wrap,
.tv5-editor-picker-wrap {
  margin-top: 12px;
}

.agy-editor-children,
.tv5-editor-children {
  margin-top: 14px;
  padding-top: 14px;
  padding-left: 18px;
  border-left: 2px dashed var(--agy-editor-border-strong);
}

.agy-editor-children-header,
.tv5-editor-children-header {
  font-size: 0.78rem;
  color: var(--agy-editor-text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.agy-editor-child-row,
.tv5-editor-child-row {
  margin-bottom: 10px;
}

.agy-editor-sub-btn,
.tv5-editor-sub-btn {
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--agy-editor-border-strong);
  color: var(--agy-editor-emerald);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--agy-editor-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.agy-editor-sub-btn:hover,
.tv5-editor-sub-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--agy-editor-emerald);
}

.agy-editor-add-btn,
.tv5-editor-add-btn {
  background: var(--agy-editor-primary);
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--agy-editor-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.agy-editor-add-btn:hover,
.tv5-editor-add-btn:hover {
  background: var(--agy-editor-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Mega Menu Toggle Button in Link Card */
.agy-editor-mega-toggle-wrap,
.tv5-editor-mega-toggle-wrap {
  margin-top: 12px;
  padding: 10px 14px;
  background: #0f172a;
  border-radius: var(--agy-editor-radius-sm);
  border: 1px dashed var(--agy-editor-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agy-mega-toggle-btn,
.tv5-mega-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid var(--agy-editor-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.agy-mega-toggle-btn:hover,
.tv5-mega-toggle-btn:hover {
  border-color: #3b82f6;
  color: #60a5fa;
}

.agy-mega-toggle-btn.is-active,
.tv5-mega-toggle-btn.is-active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.agy-mega-toggle-pill,
.tv5-mega-toggle-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}

.agy-mega-toggle-btn.is-active .agy-mega-toggle-pill,
.tv5-mega-toggle-btn.is-active .tv5-mega-toggle-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.agy-mega-toggle-hint,
.tv5-mega-toggle-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Tab 4: Mega Menu Panel */
.agy-editor-mega-panel,
.tv5-editor-mega-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agy-editor-mega-panel-intro,
.tv5-editor-mega-panel-intro {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--agy-editor-border);
}

.agy-editor-mega-columns-grid,
.tv5-editor-mega-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.agy-editor-mega-box,
.tv5-editor-mega-box {
  background: #1e293b;
  border: 1px solid var(--agy-editor-border);
  border-radius: var(--agy-editor-radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agy-editor-mega-box-head,
.tv5-editor-mega-box-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agy-editor-mega-col-tag,
.tv5-editor-mega-col-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

.agy-editor-mega-box-title,
.tv5-editor-mega-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.agy-editor-mega-box-desc,
.tv5-editor-mega-box-desc {
  font-size: 0.78rem;
  color: var(--agy-editor-text-muted);
  margin: 0;
  line-height: 1.4;
}

.agy-editor-selector-wrap,
.tv5-editor-selector-wrap {
  margin-top: 4px;
}

.agy-editor-mega-banner-preview-card,
.tv5-editor-mega-banner-preview-card {
  background: linear-gradient(135deg, #090e17 0%, #172554 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--agy-editor-radius-sm);
  padding: 18px;
  color: white;
  display: flex;
  flex-direction: column;
}
