/* =============================================================
   "BUGÜN NE OKUSAM?" — Suggestion Widget
   ============================================================= */

/* ── FAB Button ─────────────────────────────────────────────── */
.ao-suggest-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--ao-primary, #6c5ce7), #a29bfe);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.45);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  white-space: nowrap;
}

.ao-suggest-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108, 92, 231, 0.55);
}

.ao-suggest-fab.is-active {
  background: linear-gradient(135deg, #4a3eb0, #7d6ff5);
}

.ao-suggest-fab__icon {
  flex-shrink: 0;
  animation: ao-suggest-roll 0.4s ease;
}

.ao-suggest-fab.is-active .ao-suggest-fab__icon {
  animation: ao-suggest-roll 0.4s ease;
}

@keyframes ao-suggest-roll {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@media (max-width: 480px) {
  .ao-suggest-fab {
    bottom: 70px; /* above mobile nav */
    left: 16px;
    padding: 10px 14px;
  }
  .ao-suggest-fab__label {
    display: none;
  }
  .ao-suggest-fab {
    padding: 12px;
    border-radius: 50%;
  }
}

/* ── Overlay ─────────────────────────────────────────────────── */
.ao-suggest-overlay {
  position: fixed;
  inset: 0;
  z-index: 901;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.ao-suggest-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Card ─────────────────────────────────────────────────────── */
.ao-suggest-card {
  position: fixed;
  bottom: 80px;
  left: 24px;
  z-index: 902;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--ao-card-bg, #151b2e);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(108, 92, 231, 0.15);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.ao-suggest-card.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

@media (max-width: 480px) {
  .ao-suggest-card {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .ao-suggest-card.is-open {
    transform: translateY(0);
  }
}

/* ── Close Button ────────────────────────────────────────────── */
.ao-suggest-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.ao-suggest-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ── Card Body (result state) ────────────────────────────────── */
.ao-suggest-card__body,
.ao-suggest-card__loading,
.ao-suggest-card__error {
  display: none;
}

.ao-suggest-card[data-state="result"] .ao-suggest-card__body {
  display: flex;
}
.ao-suggest-card[data-state="loading"] .ao-suggest-card__loading {
  display: flex;
}
.ao-suggest-card[data-state="error"] .ao-suggest-card__error {
  display: flex;
}

.ao-suggest-card__body {
  gap: 0;
}

/* ── Cover ───────────────────────────────────────────────────── */
.ao-suggest-card__media {
  position: relative;
  flex-shrink: 0;
  width: 110px;
}

.ao-suggest-cover {
  width: 110px;
  height: 160px;
  overflow: hidden;
}

.ao-suggest-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ao-suggest-cover__placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
}

.ao-suggest-type-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  letter-spacing: 0.04em;
}

.ao-suggest-type-badge--novel {
  background: rgba(162, 155, 254, 0.85);
}
.ao-suggest-type-badge--manhwa {
  background: rgba(253, 121, 168, 0.85);
}
.ao-suggest-type-badge--manhua {
  background: rgba(255, 177, 66, 0.85);
  color: #111;
}

/* ── Info ─────────────────────────────────────────────────────── */
.ao-suggest-card__info {
  flex: 1;
  padding: 14px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ao-suggest-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ao-primary, #6c5ce7);
  margin: 0;
}

.ao-suggest-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Stars ────────────────────────────────────────────────────── */
.ao-suggest-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}

.ao-suggest-star {
  color: rgba(255, 255, 255, 0.2);
}

.ao-suggest-star.is-filled {
  color: #f9ca24;
}

.ao-suggest-rating-num {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #f9ca24;
}

.ao-suggest-rating-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Genres ───────────────────────────────────────────────────── */
.ao-suggest-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ao-suggest-genre {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}

/* ── Excerpt ──────────────────────────────────────────────────── */
.ao-suggest-excerpt {
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Meta ─────────────────────────────────────────────────────── */
.ao-suggest-meta {
  display: flex;
  gap: 12px;
}

.ao-suggest-chapters {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Actions ──────────────────────────────────────────────────── */
.ao-suggest-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
}

.ao-suggest-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--ao-primary, #6c5ce7);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.15s;
  flex-shrink: 0;
}

.ao-suggest-read-btn:hover {
  background: #5a4ad1;
  transform: translateX(2px);
}

.ao-suggest-reroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}

.ao-suggest-reroll-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Loading State ────────────────────────────────────────────── */
.ao-suggest-card__loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.ao-suggest-spinner {
  width: 36px;
  height: 36px;
}

.ao-suggest-spinner__ring {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(108, 92, 231, 0.2);
  border-top-color: var(--ao-primary, #6c5ce7);
  border-radius: 50%;
  animation: ao-suggest-spin 0.7s linear infinite;
}

@keyframes ao-suggest-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Error State ──────────────────────────────────────────────── */
.ao-suggest-card__error {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.ao-suggest-card__error svg {
  color: rgba(255, 255, 255, 0.2);
}
