/* ============================================================
   AI-AMM | ADDIE-MTSS STEM Design — Custom Styles
   ============================================================ */

/* ---------- Animations ---------- */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Scrollbar ---------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------- Step Indicator ---------- */
.step-indicator-active {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px #e0e7ff;
}
.step-indicator-inactive {
  background-color: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

/* ---------- Hover Zone (dashed underline) ---------- */
.hover-zone {
  cursor: help;
  border-bottom: 2px dashed #818cf8;
  padding-bottom: 2px;
  transition: all 0.2s;
}
.hover-zone:hover {
  color: #4f46e5;
  border-color: #4f46e5;
}

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  padding: 14px 24px;
  border-radius: 12px;
  color: white;
  font-weight: bold;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
}

/* ---------- AI Loading Overlay ---------- */
#ai-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---------- AI Output Cards ---------- */
.ai-card {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 24px;
  padding: 2.5rem;
  color: #1e293b !important;
  line-height: 1.8;
  text-align: left;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}
.ai-card h3 {
  color: #1e3a8a !important;
  font-size: 1.5rem;
  font-weight: 900;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}
.ai-card h4 {
  color: #3b82f6 !important;
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.ai-card ul {
  margin-left: 1.5rem;
  list-style-type: disc;
  margin-bottom: 1.5rem;
}
.ai-card li {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}
.ai-card p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.ai-card strong {
  color: #4338ca !important;
}

/* ---------- Info Popover ---------- */
.info-popover {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 105%;
  top: 0;
  width: 340px;
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  z-index: 50;
  transition: all 0.2s ease-in-out;
  pointer-events: none;
  color: #334155;
  font-weight: normal;
  font-size: 0.875rem;
  text-align: left;
  line-height: 1.6;
}
.group:hover .info-popover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(5px);
}
.info-popover ul {
  margin-left: 1.2rem;
  list-style-type: disc;
  margin-top: 0.5rem;
}

/* ---------- Locked / Disabled State ---------- */
.locked-state {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(100%);
  transition: all 0.3s;
}

/* ---------- Tier Color Bars ---------- */
.tier-1-box { border-left: 6px solid #3b82f6 !important; }
.tier-2-box { border-left: 6px solid #10b981 !important; }
.tier-3-box { border-left: 6px solid #f59e0b !important; }

/* ---------- Final Editor ---------- */
#final-editor {
  background: white;
  min-height: 600px;
  padding: 4rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  outline: none;
  line-height: 1.8;
}

/* ---------- Dropdown Menu ---------- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #ffffff;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
  z-index: 100;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}
.dropdown-content a {
  color: #334155;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
}
.dropdown-content a:hover {
  background-color: #f8fafc;
  color: #4f46e5;
}
.dropdown:hover .dropdown-content {
  display: block;
}

/* ---------- Language Toggle ---------- */
body.lang-zh .en { display: none !important; }
body:not(.lang-zh) .zh { display: none !important; }

/* ---------- API Key Input ---------- */
#api-key-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
#api-key-input {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.75rem;
  width: 260px;
  outline: none;
  transition: all 0.2s;
}
#api-key-input::placeholder {
  color: rgba(255,255,255,0.55);
}
#api-key-input:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}
#api-key-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
}
#api-key-toggle:hover {
  color: white;
  background: rgba(255,255,255,0.15);
}

/* ============================================================
   n8n Material Generation — Cards & Results
   ============================================================ */

/* N8N card hover */
.n8n-card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.n8n-card:hover {
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Result item base */
.n8n-result-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
}

/* YouTube video card */
.n8n-video-card {
  display: flex;
  gap: 14px;
  cursor: pointer;
  padding: 12px;
  border-radius: 16px;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.n8n-video-card:hover {
  background: #fff;
  border-color: #e2e8f0;
}
.n8n-video-thumb {
  width: 140px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}
.n8n-video-info {
  flex: 1;
  min-width: 0;
}
.n8n-video-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.n8n-video-channel {
  font-size: 0.75rem;
  color: #64748b;
}

/* Embedded YouTube player */
.n8n-video-player {
  margin-top: 10px;
  display: none;
}
.n8n-video-player.open {
  display: block;
}
.n8n-video-player iframe {
  width: 100%;
  height: 340px;
  border-radius: 14px;
  border: none;
}

/* PPTX / Image download card */
.n8n-download-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}
.n8n-download-card .n8n-file-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.n8n-download-card .n8n-file-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: #1e293b;
  flex: 1;
}
.n8n-download-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  background: #4f46e5;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.n8n-download-btn:hover {
  background: #4338ca;
}

/* Image preview */
.n8n-image-preview {
  max-width: 100%;
  max-height: 360px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: block;
}

/* Error banner in results */
.n8n-error {
  color: #dc2626;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px 16px;
  background: #fef2f2;
  border-radius: 12px;
  border: 1px solid #fecaca;
}