/* ── AI Recommendations Modal ──────────────────────────────────────────────── */

.modal--ai {
  max-width: 560px;
  width: 100%;
}

.ai-modal__body {
  max-height: 65vh;
  overflow-y: auto;
  padding: var(--s-6);
}

/* ── Intro screen ────────────────────────────────────────────────────────────── */

.ai-modal__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-4);
  padding: var(--s-2) 0;
}

.ai-modal__intro-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(249,115,22,.15));
  border: 1px solid rgba(245,158,11,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #f59e0b;
  animation: ai-pulse-icon 3s ease-in-out infinite;
}

@keyframes ai-pulse-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,.3); }
  50%       { box-shadow: 0 0 0 10px rgba(245,158,11,0); }
}

.ai-modal__intro-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ai-modal__intro-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 400px;
  margin: 0;
}

.ai-modal__intro-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  text-align: left;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

.ai-modal__intro-tips li {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  line-height: 1.5;
}

.ai-modal__intro-tips li i {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-modal__intro-tips li strong {
  color: var(--text-secondary);
}

/* Quota badge */
.ai-modal__quota-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-xs);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.25);
  color: #f59e0b;
}

.ai-modal__quota-badge--premium {
  background: rgba(168,85,247,.1);
  border-color: rgba(168,85,247,.25);
  color: #a855f7;
}

.ai-modal__quota-badge--admin {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.25);
  color: #f87171;
}

.ai-modal__quota-badge--empty {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.25);
  color: var(--error);
}

/* Launch button */
.ai-modal__launch-btn {
  width: 100%;
  padding: var(--s-4) var(--s-6);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #000;
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 20px rgba(245,158,11,.35);
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.ai-modal__launch-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(245,158,11,.45);
}

.ai-modal__launch-btn:active {
  transform: translateY(0);
}

/* Disabled launch button */
.ai-modal__launch-btn--disabled,
.ai-modal__launch-btn:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}
.ai-modal__launch-btn--disabled:hover,
.ai-modal__launch-btn:disabled:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* ── Limit exceeded screen ───────────────────────────────────────────────────── */

.ai-modal__limit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-4);
  padding: var(--s-4) 0;
}

.ai-modal__limit-icon {
  font-size: 3rem;
  line-height: 1;
}

.ai-modal__limit-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ai-modal__limit-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}

.ai-modal__limit-upgrade {
  width: 100%;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(99,102,241,.1));
  border: 1px solid rgba(168,85,247,.25);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.ai-modal__limit-upgrade i {
  color: #a855f7;
}

.ai-modal__limit-upgrade strong {
  color: var(--text-secondary);
}

/* ── Loading screen ──────────────────────────────────────────────────────────── */

.ai-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-10) 0;
  color: var(--text-muted);
}

/* Orbit animation */
.ai-modal__orbit {
  position: relative;
  width: 80px;
  height: 80px;
}

.ai-modal__orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #f59e0b;
  border-right-color: rgba(245,158,11,.3);
  animation: ai-orbit 1.2s linear infinite;
}

.ai-modal__orbit-ring--2 {
  inset: 10px;
  border-top-color: transparent;
  border-bottom-color: #f97316;
  border-left-color: rgba(249,115,22,.3);
  animation-duration: 0.8s;
  animation-direction: reverse;
}

.ai-modal__orbit-core {
  position: absolute;
  inset: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #f59e0b;
  animation: ai-pulse-core 1.5s ease-in-out infinite;
}

@keyframes ai-orbit {
  to { transform: rotate(360deg); }
}

@keyframes ai-pulse-core {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Animated dots */
.ai-modal__loading-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.ai-modal__dots::after {
  content: '';
  animation: ai-dots 1.5s steps(4, end) infinite;
}

@keyframes ai-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ── Results ─────────────────────────────────────────────────────────────────── */

.ai-modal__results {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.ai-modal__error,
.ai-modal__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--s-8) 0;
}
.ai-modal__error { color: var(--error); }

/* Recommendation card */
.ai-rec-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast);
}
.ai-rec-card:hover { border-color: var(--border-hover); }

.ai-rec-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.ai-rec-card__body {
  flex: 1;
  min-width: 0;
}

.ai-rec-card__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-rec-card__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.ai-rec-card__type {
  color: #f59e0b;
  font-weight: 500;
}

.ai-rec-card__reason {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--s-1);
  line-height: 1.4;
}

.ai-rec-card__btn {
  flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

.ai-modal__footer {
  justify-content: space-between;
}

.ai-modal__quota {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .ai-modal__body { padding: var(--s-4); }
  .ai-rec-card { flex-wrap: wrap; }
  .ai-rec-card__btn { width: 100%; margin-top: var(--s-2); }
}
