/* ================================================================= */
/*  SITE FEATURES — cookie, back-to-top, dark mode, transitions, etc  */
/* ================================================================= */

/* ── 1. Cookie Consent Banner ──────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: -200px; left: 0; right: 0; z-index: 9999;
  background: #1a1a1a; color: #fff; padding: 16px 0;
  transition: bottom 0.4s ease; box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-banner.is-visible { bottom: 0; }
.cookie-banner__inner {
  max-width: 1280px; margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.cookie-banner__inner p { font-size: 0.85rem; line-height: 1.5; margin: 0; opacity: 0.9; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-banner__btn {
  padding: 8px 20px; border: none; border-radius: 4px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.cookie-banner__btn:hover { opacity: 0.85; }
.cookie-banner__btn--accept { background: var(--pepla-green); color: #fff; }
.cookie-banner__btn--decline { background: transparent; color: #fff; border: 1px solid #555; }

@media (max-width: 600px) {
  .cookie-banner__inner { flex-direction: column; text-align: center; }
}

/* ── 2. Back to Top Button ─────────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 135px; right: 30px; z-index: 200;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--pepla-green); color: #fff; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (hover: hover) { .back-to-top:hover { background: var(--pepla-orange); } }

/* ── 3. Reading Progress Bar ───────────────────────────────────────── */
.reading-progress {
  position: fixed; top: 60px; left: 0; right: 0; height: 3px;
  z-index: 99; background: transparent;
}
.reading-progress__bar {
  height: 100%; width: 0%; background: var(--pepla-green);
  transition: width 0.1s linear;
}

/* ── 4. Social Sharing ─────────────────────────────────────────────── */
.article__share { margin: 40px 0; text-align: center; }
.article__share h4 {
  font-size: 1rem; font-weight: 700; color: #222; margin-bottom: 12px;
}
.article__share-btns { display: flex; justify-content: center; gap: 10px; }
.share-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #ddd;
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease; color: #555;
  text-decoration: none;
}
.share-btn:hover { transform: translateY(-2px); }
.share-btn--whatsapp:hover { border-color: #25D366; color: #25D366; }
.share-btn--x:hover { border-color: #000; color: #000; }
.share-btn--linkedin:hover { border-color: #0A66C2; color: #0A66C2; }
.share-btn--copy:hover { border-color: var(--pepla-green); color: var(--pepla-green); }

/* ── 6. Breadcrumbs ────────────────────────────────────────────────── */
.breadcrumbs {
  font-size: 0.85rem; margin-bottom: 20px; color: #999;
}
.breadcrumbs a { color: var(--pepla-green); text-decoration: none; font-weight: 500; }
.breadcrumbs a:hover { color: var(--pepla-orange); }
.breadcrumbs__sep { margin: 0 8px; color: #ccc; }
.breadcrumbs__current { color: #666; }

/* ── 8. Table of Contents ──────────────────────────────────────────── */
.article__toc {
  background: #f8f9fa; border-radius: 12px; padding: 24px;
  margin-bottom: 32px; border-left: 4px solid var(--pepla-green);
}
.article__toc-title {
  font-size: 1rem; font-weight: 700; color: #222; margin-bottom: 12px;
}
.article__toc ul { list-style: none; padding: 0; margin: 0; }
.article__toc li { padding: 6px 0; border-bottom: 1px solid #eee; }
.article__toc li:last-child { border-bottom: none; }
.article__toc a {
  color: #555; text-decoration: none; font-size: 0.9rem;
  transition: color 0.2s ease;
}
.article__toc a:hover { color: var(--pepla-green); }

/* ── 9. Blog Search ────────────────────────────────────────────────── */
.blog-search {
  max-width: 500px; margin: 0 auto 24px; position: relative;
}
.blog-search__input {
  width: 100%; padding: 12px 44px 12px 16px; border: 2px solid #ddd;
  border-radius: 8px; font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.2s ease; outline: none;
  background: #fff;
}
.blog-search__input:focus { border-color: var(--pepla-green); }
.blog-search__icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #999; pointer-events: none;
}

/* ── 11. Dark Mode ─────────────────────────────────────────────────── */
.dark-toggle {
  background: none; border: 1.5px solid #ccc; border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 8px; flex-shrink: 0; padding: 0;
  transition: border-color 0.2s;
  color: #555;
}
.dark-toggle:hover { border-color: var(--pepla-orange); color: var(--pepla-orange); }
.dark-toggle__moon { display: none; }

html.dark-mode .dark-toggle__sun { display: none; }
html.dark-mode .dark-toggle__moon { display: block; }

html.dark-mode {
  --dm-bg: #121212;
  --dm-surface: #1e1e1e;
  --dm-text: #e0e0e0;
  --dm-text-muted: #999;
  --dm-border: #333;
}

html.dark-mode body { background: var(--dm-bg); color: var(--dm-text); }
html.dark-mode .site-header {
  background: rgba(18, 18, 18, 0.85);
  border-bottom-color: var(--dm-border);
}
html.dark-mode .main-nav a { color: var(--dm-text); }
html.dark-mode .nav-divider { color: #555; }
html.dark-mode .hero { background: rgba(18,18,18,0.85); }
html.dark-mode .hero-wrapper { background: var(--dm-bg); }

html.dark-mode .service-card,
html.dark-mode .cl-card,
html.dark-mode .blog-card,
html.dark-mode .host-card,
html.dark-mode .con-svc-card,
html.dark-mode .cs-tech__card,
html.dark-mode .ta-model-card,
html.dark-mode .ai-platform-card,
html.dark-mode .ai-usecase,
html.dark-mode .ux-why-card,
html.dark-mode .testimonial-card {
  background: var(--dm-surface); color: var(--dm-text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

html.dark-mode .service-card__desc,
html.dark-mode .cl-card p,
html.dark-mode .blog-card__excerpt,
html.dark-mode .host-card p,
html.dark-mode .con-svc-card p,
html.dark-mode .cs-tech__card p,
html.dark-mode .ta-model-card p,
html.dark-mode .testimonial-text { color: var(--dm-text-muted); }

html.dark-mode .service-card__title,
html.dark-mode .cl-card h4,
html.dark-mode .blog-card__title,
html.dark-mode .host-card h4,
html.dark-mode .cs-tech__card h4,
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3, html.dark-mode h4 { color: var(--dm-text); }

html.dark-mode .contact { background: var(--dm-bg); }
html.dark-mode .contact-heading,
html.dark-mode .contact-col__title { color: var(--dm-text); }
html.dark-mode .contact-item__link { color: var(--dm-text-muted); }
html.dark-mode .contact-col__text { color: var(--dm-text-muted); }

html.dark-mode .clients { background: var(--dm-bg); }
html.dark-mode .clients-heading { color: var(--dm-text); }

html.dark-mode .article { color: var(--dm-text); }
html.dark-mode .article__content { color: var(--dm-text-muted); }
html.dark-mode .article__content h2,
html.dark-mode .article__content h3 { color: var(--dm-text); }
html.dark-mode .article__content blockquote { background: var(--dm-surface); color: var(--dm-text-muted); }
html.dark-mode .article__content pre { background: #0d0d0d; }
html.dark-mode .article__content code { background: var(--dm-surface); color: var(--dm-text); }
html.dark-mode .article__cta { background: var(--dm-surface); }
html.dark-mode .article__toc { background: var(--dm-surface); }
html.dark-mode .article__illustration { background: var(--dm-surface); }

html.dark-mode .blog-search__input {
  background: var(--dm-surface); border-color: var(--dm-border);
  color: var(--dm-text);
}
html.dark-mode .blog-filter {
  background: var(--dm-surface); border-color: var(--dm-border); color: var(--dm-text-muted);
}
html.dark-mode .share-btn { background: var(--dm-surface); border-color: var(--dm-border); color: var(--dm-text-muted); }

html.dark-mode .site-footer { color: var(--dm-text); }
html.dark-mode .footer-hashtag { color: var(--dm-text); }
html.dark-mode .footer-voice-link { color: var(--pepla-blue); }

html.dark-mode .section-image img { opacity: 0.85; }
html.dark-mode .burger span { background: var(--dm-text); }
html.dark-mode .dark-toggle { border-color: var(--dm-border); color: var(--dm-text); }
html.dark-mode .cookie-banner { background: #000; }

/* ── 12. Page Transitions ──────────────────────────────────────────── */
body {
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.page-loaded { opacity: 1; }
body.page-leaving { opacity: 0; }

/* ── 13. Preloader ─────────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

html.dark-mode .preloader { background: #121212; }

.preloader__spinner {
  width: 50px; height: 50px; position: relative;
}
.preloader__dot {
  width: 12px; height: 12px; border-radius: 50%;
  position: absolute; animation: preloaderBounce 1.2s ease infinite;
}
.preloader__dot:nth-child(1) { background: var(--pepla-orange); left: 0; top: 50%; transform: translateY(-50%); animation-delay: 0s; }
.preloader__dot:nth-child(2) { background: var(--pepla-green); left: 50%; top: 50%; transform: translate(-50%, -50%); animation-delay: 0.2s; }
.preloader__dot:nth-child(3) { background: var(--pepla-blue); right: 0; top: 50%; transform: translateY(-50%); animation-delay: 0.4s; }

@keyframes preloaderBounce {
  0%, 80%, 100% { transform: translateY(-50%) scale(0.6); opacity: 0.4; }
  40% { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* ── 14. Testimonial Carousel ───────────────────────────────────────── */
.testimonial-carousel {
  position: relative; overflow: hidden; border-radius: 12px;
}
.testimonial-carousel__track {
  display: flex; transition: transform 0.5s ease;
}
.testimonial-carousel__track .testimonial-card {
  min-width: 100%; flex-shrink: 0; box-sizing: border-box;
  opacity: 1 !important; transform: none !important; transition-delay: 0s !important;
}
.testimonial-carousel__nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 20px;
}
.testimonial-carousel__btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #ddd; background: #fff; font-size: 1.4rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: #555; line-height: 1;
}
.testimonial-carousel__btn:hover {
  border-color: var(--pepla-green); color: var(--pepla-green);
}
.testimonial-carousel__dots { display: flex; gap: 8px; }
.testimonial-carousel__dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: #ddd; cursor: pointer;
  transition: background 0.2s;
}
.testimonial-carousel__dot.is-active { background: var(--pepla-green); }

html.dark-mode .testimonial-carousel__btn {
  background: var(--dm-surface); border-color: var(--dm-border); color: var(--dm-text);
}
html.dark-mode .testimonial-carousel__dot { background: var(--dm-border); }
html.dark-mode .testimonial-carousel__dot.is-active { background: var(--pepla-green); }

/* ── Footer legal links ────────────────────────────────────────────── */
.footer-legal {
  display: flex; gap: 16px; margin-top: 8px;
}
.footer-legal a {
  font-size: 0.8rem; color: #999; text-decoration: none;
  transition: color 0.2s;
}
.footer-legal a:hover { color: var(--pepla-orange); }

/* ── 7. Related Articles (styles only — content injected per page) ── */
.article__related { margin-top: 40px; padding-top: 30px; border-top: 2px solid #f0f0f0; }
.article__related h3 { font-size: 1.2rem; font-weight: 700; color: #222; margin-bottom: 20px; }
html.dark-mode .article__related { border-top-color: var(--dm-border); }
html.dark-mode .article__related h3 { color: var(--dm-text); }
