/*
 * AI Mods Right-Click Context Menu and Element Inspector Styles.
 *
 * File: web/ai-mods.css
 * Purpose:
 *     Provides sleek, dark-themed styles matching NSWeb v3 for:
 *     1. Floating right-click context menu (.ai-mods-context-menu) positioned at cursor coordinates.
 *     2. Modal overlay and dialog (.ai-mods-modal-backdrop, .ai-mods-modal-content) for wish submission.
 *     3. Code snippet boxes and feedback toasts (.ai-mods-toast).
 *
 * Rules:
 *     - Strictly zero emojis across all styles, icons, and labels.
 *     - High z-index (999999) to render above Flutter Web CanvasKit elements.
 */

/* ==========================================================================
   1. Floating Right-Click Context Menu
   ========================================================================== */
.ai-mods-context-menu {
  position: fixed;
  z-index: 999999;
  background: #1e2230;
  color: #f8fafc;
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 270px;
  max-width: 380px;
  padding: 6px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  user-select: none;
  animation: aiModsMenuFadeIn 0.12s ease-out;
}

@keyframes aiModsMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ai-mods-menu-header {
  padding: 6px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8c98ac;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-mods-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  color: #e2e8f0;
  transition: background 0.15s, color 0.15s;
}

.ai-mods-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.ai-mods-menu-item.primary {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  font-weight: 700;
  border-left: 3px solid #facc15;
}

.ai-mods-menu-item.primary:hover {
  background: rgba(250, 204, 21, 0.22);
  color: #fef08a;
}

.ai-mods-menu-kbd {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.ai-mods-menu-info {
  font-size: 11px;
  color: #8c98ac;
  cursor: default;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
  padding: 6px 14px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   2. Modal Overlay & Dialog
   ========================================================================== */
.ai-mods-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: aiModsFadeIn 0.15s ease-out;
}

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

.ai-mods-modal-content {
  background: #1e2230;
  border: 1px solid #2e374e;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding: 24px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-height: 90vh;
  overflow-y: auto;
}

.ai-mods-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2e374e;
}

.ai-mods-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.ai-mods-modal-subtitle {
  font-size: 11px;
  color: #8c98ac;
  margin-top: 2px;
}

.ai-mods-close-btn {
  background: transparent;
  border: none;
  color: #8c98ac;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.ai-mods-close-btn:hover {
  color: #ffffff;
}

/* ==========================================================================
   3. Inspector Details & Snippet Box
   ========================================================================== */
.ai-mods-target-card {
  background: #0f121c;
  border: 1px solid #2b3347;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  font-size: 11.5px;
  line-height: 1.5;
}

.ai-mods-target-row {
  margin-bottom: 4px;
  word-break: break-all;
}

.ai-mods-target-label {
  color: #8c98ac;
  font-weight: 700;
}

.ai-mods-target-val {
  color: #facc15;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ai-mods-code-snippet {
  background: #090b10;
  border: 1px solid #1f2537;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #cbd5e1;
  max-height: 90px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 6px;
}

/* ==========================================================================
   4. Form Elements & Category Chips
   ========================================================================== */
.ai-mods-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  margin-top: 14px;
}

.ai-mods-category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ai-mods-chip {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  background: #0f121c;
  color: #94a3b8;
  border: 1px solid #2b3347;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-mods-chip.active {
  background: #facc15;
  color: #0f172a;
  border-color: #facc15;
}

.ai-mods-input,
.ai-mods-textarea {
  width: 100%;
  background: #0f121c;
  border: 1px solid #2b3347;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #ffffff;
  font-family: inherit;
  box-sizing: border-box;
}

.ai-mods-input:focus,
.ai-mods-textarea:focus {
  outline: none;
  border-color: #facc15;
}

.ai-mods-textarea {
  min-height: 90px;
  resize: vertical;
}

/* ==========================================================================
   5. Modal Footer Actions
   ========================================================================== */
.ai-mods-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #2e374e;
}

.ai-mods-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.ai-mods-btn-cancel {
  background: transparent;
  color: #8c98ac;
}

.ai-mods-btn-cancel:hover {
  color: #ffffff;
}

.ai-mods-btn-save {
  background: #facc15;
  color: #0f172a;
  font-weight: 800;
}

.ai-mods-btn-save:hover {
  opacity: 0.92;
}

.ai-mods-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   6. Toast Notifications
   ========================================================================== */
.ai-mods-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 1000001;
  animation: aiModsToastIn 0.2s ease-out;
}

@keyframes aiModsToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
