/**
 * notdore.css — Giao diện chung NotDore (tông sáng, hiện đại)
 * Phụ thuộc: Bootstrap 5 (assets/plugins/bootstrap/css/bootstrap.min.css)
 * Phong cách: sáng, thoáng, có chiều sâu; điểm nhấn tím–hồng.
 * Dùng cho: index.html và tất cả trang con (kèm assets/css/pages.css).
 */

/* ============================================================
   1. Biến theme
   ============================================================ */
:root {
  --bg-body: #f7f8fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4fa;
  --bg-input: #ffffff;

  --border: #e5e8f0;
  --border-accent: #7c4dff;
  --border-strong: #d6dae6;

  --text-primary: #191b2e;
  --text-secondary: #4d5170;
  --text-muted: #7c819c;

  --accent-purple: #6a3ba5;
  --accent-purple-light: #8b4af0;
  --accent-pink: #ff5c9d;
  --accent-cyan: #12b8e6;
  --accent-green: #17c98d;
  --accent-orange: #ffa53b;
  --accent-red: #ff4d6d;

  --gradient-primary: linear-gradient(135deg, var(--accent-purple-light), var(--accent-pink));
  --gradient-soft: linear-gradient(135deg, rgba(139, 74, 240, 0.1), rgba(255, 92, 157, 0.08));

  --shadow-card: 0 6px 20px rgba(24, 28, 60, 0.06);
  --shadow-hover: 0 16px 40px rgba(124, 77, 255, 0.16);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Quicksand', 'Inter', system-ui, sans-serif;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse 60% 40% at 15% -5%, rgba(139, 74, 240, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 0%, rgba(18, 184, 230, 0.08), transparent 60%),
    var(--bg-body);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-purple); }

::selection { background: var(--accent-purple-light); color: #fff; }

[id] { scroll-margin-top: 96px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #cfd3e2; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple-light); }

/* ============================================================
   2. Bố cục & trang trí nền
   ============================================================ */
.anime-container {
  position: relative;
  z-index: 1;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Sakura petals */
.sakura-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.sakura {
  position: absolute;
  top: -6%;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple-light));
  border-radius: 50% 0 50% 0;
  opacity: 0.45;
  animation: sakuraFall linear infinite;
}

.sakura:nth-child(1)  { left: 8%;  animation-duration: 14s; animation-delay: 0s; }
.sakura:nth-child(2)  { left: 20%; animation-duration: 17s; animation-delay: 2s; }
.sakura:nth-child(3)  { left: 33%; animation-duration: 12s; animation-delay: 4s; }
.sakura:nth-child(4)  { left: 46%; animation-duration: 15s; animation-delay: 1s; }
.sakura:nth-child(5)  { left: 58%; animation-duration: 13s; animation-delay: 3.5s; }
.sakura:nth-child(6)  { left: 70%; animation-duration: 18s; animation-delay: 5s; }
.sakura:nth-child(7)  { left: 82%; animation-duration: 14s; animation-delay: 2.5s; }
.sakura:nth-child(8)  { left: 14%; animation-duration: 19s; animation-delay: 6s; }
.sakura:nth-child(9)  { left: 52%; animation-duration: 11s; animation-delay: 0.8s; }
.sakura:nth-child(10) { left: 90%; animation-duration: 16s; animation-delay: 4s; }
.sakura:nth-child(11) { left: 37%; animation-duration: 15s; animation-delay: 7s; }
.sakura:nth-child(12) { left: 76%; animation-duration: 13s; animation-delay: 5.5s; }

@keyframes sakuraFall {
  0%   { transform: translateY(-6vh) rotate(0deg) translateX(0); opacity: 0; }
  8%   { opacity: 0.5; }
  50%  { transform: translateY(52vh) rotate(180deg) translateX(28px); }
  92%  { opacity: 0.25; }
  100% { transform: translateY(108vh) rotate(360deg) translateX(-18px); opacity: 0; }
}

/* Sparkles */
.sparkle,
.anime-sparkle {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--accent-orange);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 8px rgba(255, 165, 59, 0.5);
  animation: sparkleTwinkle 3s ease-in-out infinite;
}

.anime-sparkle-1 { top: 16%; left: 10%; animation-delay: 0s; }
.anime-sparkle-2 { top: 30%; left: 86%; animation-delay: 1s; }
.anime-sparkle-3 { top: 62%; left: 42%; animation-delay: 2s; }
.anime-sparkle-4 { top: 80%; left: 72%; animation-delay: 0.6s; }
.anime-sparkle-5 { top: 46%; left: 92%; animation-delay: 1.6s; }

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 0.9; transform: scale(1.2); }
}

/* ============================================================
   3. Header
   ============================================================ */
.anime-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  margin: 0 -2rem 0;
  padding-left: 2rem;
  padding-right: 2rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.anime-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.anime-brand-text {
  display: flex;
  align-items: center;
  gap: 0;
}

.brand-fragment {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-fragment--main {
  background: linear-gradient(135deg, var(--accent-purple-light), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGlow 4s ease-in-out infinite;
}

@keyframes textGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(139, 74, 240, 0.35)); }
  50%      { filter: drop-shadow(0 0 12px rgba(255, 92, 157, 0.55)); }
}

.anime-brand-deco {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-pink);
  animation: pulseDot 2s ease-in-out infinite;
}

.brand-dot:nth-child(2) {
  background: var(--accent-cyan);
  animation-delay: 0.5s;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.4); opacity: 1; }
}

.anime-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.anime-nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.anime-nav-link:hover {
  color: var(--accent-purple-light);
  background: var(--bg-card-hover);
}

.anime-nav-link[aria-current="page"] {
  color: var(--accent-purple);
  background: var(--bg-card-hover);
}

/* ============================================================
   4. Buttons
   ============================================================ */
.anime-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s ease;
}

.anime-btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 74, 240, 0.3);
}

.anime-btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139, 74, 240, 0.4);
}

.anime-btn--outline {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.anime-btn--outline:hover {
  color: var(--accent-purple-light);
  border-color: var(--accent-purple-light);
  box-shadow: 0 8px 20px rgba(139, 74, 240, 0.14);
  transform: translateY(-2px);
}

.anime-btn--sm { padding: 0.45rem 1rem; font-size: 0.85rem; border-radius: 10px; }
.anime-btn--lg { padding: 0.85rem 1.9rem; font-size: 1rem; border-radius: 14px; }
.anime-btn--full { width: 100%; }

/* ============================================================
   5. Hero
   ============================================================ */
.anime-hero {
  position: relative;
  text-align: center;
  padding: 4.5rem 1rem 3.5rem;
}

.anime-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 90%);
  height: 520px;
  background: radial-gradient(circle, rgba(139, 74, 240, 0.12) 0%, rgba(255, 92, 157, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.anime-hero-kicker {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  margin-bottom: 1.3rem;
  border: 1px solid rgba(139, 74, 240, 0.28);
  border-radius: 999px;
  background: var(--gradient-soft);
  color: var(--accent-purple);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.anime-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1.2rem;
  color: var(--text-primary);
}

.anime-hero-title .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.anime-hero-sub {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.2rem;
}

.anime-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ============================================================
   6. Sections
   ============================================================ */
.anime-section {
  padding: 3rem 0;
  position: relative;
}

.anime-section-heading {
  position: relative;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 auto 0.6rem;
}

.anime-section-heading::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  margin: 0.7rem auto 0;
  border-radius: 3px;
  background: var(--gradient-primary);
}

.anime-section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.anime-divider {
  border: none;
  height: 1px;
  margin: 1rem 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.anime-text-center { text-align: center; }

.anime-notice {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--gradient-soft);
  border: 1px solid rgba(139, 74, 240, 0.2);
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ============================================================
   7. Tabs
   ============================================================ */
.anime-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.anime-tabs .nav-item { margin: 0; }

.anime-tabs .nav-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.22s ease;
}

.anime-tabs .nav-link:hover {
  color: var(--accent-purple-light);
  border-color: rgba(139, 74, 240, 0.4);
  background: var(--bg-card-hover);
}

.anime-tabs .nav-link.active {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(139, 74, 240, 0.3);
}

/* ============================================================
   8. Tool cards (markup do index.js render)
   ============================================================ */
.tool-category .section-heading {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 74, 240, 0.4);
  box-shadow: var(--shadow-hover);
}

.tool-card .card-body { padding: 1.4rem; }

.badge-cat {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--gradient-soft) !important;
  color: var(--accent-purple) !important;
  border: 1px solid rgba(139, 74, 240, 0.22);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tool-card .card-title { margin-bottom: 0.5rem; }

.tool-title-link {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tool-title-link:hover { color: var(--accent-purple-light); }

.tool-card .card-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.youtube-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buttons inside tool cards — override Bootstrap */
.tool-actions .btn,
.resource-list .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.42rem 0.9rem;
  transition: all 0.2s ease;
}

.tool-actions .btn-primary,
.resource-list .btn-primary {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 74, 240, 0.25);
}

.tool-actions .btn-primary:hover,
.resource-list .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(139, 74, 240, 0.35);
  color: #fff;
}

.tool-actions .btn-secondary,
.resource-list .btn-secondary {
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  color: var(--text-secondary);
}

.tool-actions .btn-secondary:hover,
.resource-list .btn-secondary:hover {
  color: var(--accent-purple-light);
  border-color: var(--accent-purple-light);
  background: var(--bg-card-hover);
}

/* Reference / resource list */
.resource-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.resource-list .list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.resource-list .list-group-item:hover { background: var(--bg-card-hover); }
.resource-list .list-group-item strong a { font-size: 1rem; }

/* ============================================================
   8b. Category slider (4 cột × 2 hàng mỗi slide)
   ============================================================ */
.tool-slider { position: relative; }

.tool-slider__track {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0.25rem;
  padding: 0.5rem 0.25rem 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tool-slider__track::-webkit-scrollbar { display: none; }

.tool-slider__page {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}

.tool-slider__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.tool-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-slider__btn:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(139, 74, 240, 0.3);
}

.tool-slider__btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.tool-slider__btn--prev { left: -16px; }
.tool-slider__btn--next { right: -16px; }

.tool-slider__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.tool-slider__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #d3d7e6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-slider__dot.is-active {
  width: 24px;
  border-radius: 5px;
  background: var(--gradient-primary);
}

/* ============================================================
   9. Loading & trạng thái
   ============================================================ */
.anime-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.anime-loading i { color: var(--accent-purple-light); font-size: 1.3rem; }

.anime-error {
  display: none;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 77, 109, 0.08);
  border: 1px solid rgba(255, 77, 109, 0.28);
  color: var(--accent-red);
  text-align: center;
}

.tool-state {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}

.single-col-max { max-width: 680px; }

/* ============================================================
   10. Contact
   ============================================================ */
.anime-contact-wrap {
  display: flex;
  justify-content: center;
}

.anime-contact-form {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.signup-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.anime-form-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.anime-form-input,
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.anime-form-input:focus,
.form-control:focus {
  border-color: var(--accent-purple-light);
  box-shadow: 0 0 0 4px rgba(139, 74, 240, 0.15);
  outline: none;
  background: var(--bg-input);
}

.anime-form-input::placeholder { color: var(--text-muted); }

.anime-form-status { color: var(--text-muted); }

/* ============================================================
   11. Footer
   ============================================================ */
.anime-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.anime-footer p { margin: 0.25rem 0; }

.anime-footer-copy { color: var(--text-secondary); }

.anime-footer-credit {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.anime-footer-credit a {
  color: var(--accent-purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   12. Animation xuất hiện
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anime-hero-kicker,
.anime-hero-title,
.anime-hero-sub,
.anime-hero-actions {
  animation: fadeInUp 0.6s ease both;
}

.anime-hero-title { animation-delay: 0.06s; }
.anime-hero-sub { animation-delay: 0.12s; }
.anime-hero-actions { animation-delay: 0.18s; }

/* ============================================================
   13. Responsive
   ============================================================ */
@media (max-width: 991.98px) {
  .tool-slider__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .anime-header {
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0.65rem 1rem;
  }
  .anime-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0.15rem;
    margin: 0 -0.5rem;
  }
  .anime-nav-link {
    display: inline-flex;
    padding: 0.35rem 0.6rem;
    font-size: 0.84rem;
  }
  #oneko { display: none; }
  .anime-hero { padding: 3rem 0.75rem 2.5rem; }
  .anime-section { padding: 2rem 0; }
  .anime-container { padding: 0 1rem; }
  .signup-form { padding: 1.4rem; }
  .tool-slider__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-slider__btn { display: none; }
}

@media (max-width: 575.98px) {
  .tool-slider__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sakura,
  .sparkle,
  .anime-sparkle,
  .brand-fragment--main,
  .brand-dot,
  .anime-hero-kicker,
  .anime-hero-title,
  .anime-hero-sub,
  .anime-hero-actions {
    animation: none;
  }
}
