/* ======================================================================
   ENHANCEMENTS CSS
   Cookie Consent, Breadcrumbs, Search, TOC, Social Share,
   Newsletter, Exit-Intent, Skip Link, Print Styles
   ====================================================================== */

/* ======================================================================
   SKIP-TO-CONTENT LINK
   ====================================================================== */

.byt-skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  background: var(--color-electric-blue, #00D9FF);
  color: var(--color-deep-navy, #0A1628);
  padding: 10px 20px;
  border-radius: var(--radius-md, 8px);
  z-index: 10000;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.byt-skip-link:focus {
  top: 16px;
  outline: 2px solid var(--color-electric-blue, #00D9FF);
  outline-offset: 2px;
}

/* ======================================================================
   COOKIE CONSENT BANNER
   ====================================================================== */

.byt-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1060;
  background: var(--color-deep-navy, #0A1628);
  border-top: 1px solid rgba(0, 217, 255, 0.15);
  padding: 24px 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-body, 'Inter', sans-serif);
}

.byt-consent-banner.byt-consent-visible {
  transform: translateY(0);
}

.byt-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.byt-consent-text {
  flex: 1;
}

.byt-consent-text h3 {
  color: #fff;
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.byt-consent-text p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.byt-consent-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.byt-consent-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body, 'Inter', sans-serif);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.byt-consent-accept {
  background: linear-gradient(135deg, var(--color-electric-blue, #00D9FF), var(--color-vibrant-purple, #8B5CF6));
  color: #fff;
}

.byt-consent-accept:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.byt-consent-necessary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.byt-consent-necessary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.byt-consent-customize {
  background: none;
  border: none;
  color: var(--color-electric-blue, #00D9FF);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  font-family: var(--font-body, 'Inter', sans-serif);
}

/* Consent Settings Panel */
.byt-consent-settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1070;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.byt-consent-settings-panel.byt-consent-visible {
  opacity: 1;
  visibility: visible;
}

.byt-consent-settings-modal {
  background: var(--color-deep-navy, #0A1628);
  border: 1px solid rgba(0, 217, 255, 0.15);
  border-radius: var(--radius-lg, 16px);
  padding: 32px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.byt-consent-settings-modal h3 {
  color: #fff;
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 20px;
  margin: 0 0 20px;
}

.byt-consent-category {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.byt-consent-category:last-of-type {
  border-bottom: none;
}

.byt-consent-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.byt-consent-category-header label {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.byt-consent-category p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.4;
  margin: 4px 0 0;
}

/* Toggle switch */
.byt-consent-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.byt-consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.byt-consent-toggle-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.byt-consent-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.byt-consent-toggle input:checked + .byt-consent-toggle-track {
  background: var(--color-electric-blue, #00D9FF);
}

.byt-consent-toggle input:checked + .byt-consent-toggle-track::after {
  transform: translateX(20px);
}

.byt-consent-toggle input:disabled + .byt-consent-toggle-track {
  opacity: 0.5;
  cursor: not-allowed;
}

.byt-consent-settings-save {
  margin-top: 20px;
  width: 100%;
}

/* ======================================================================
   BREADCRUMBS
   ====================================================================== */

.byt-breadcrumbs {
  background: transparent;
  padding: 0;
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  z-index: 10;
}

.byt-breadcrumbs .container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.byt-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  font-size: 13px;
  gap: 0;
}

.byt-breadcrumbs li {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
}

.byt-breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.3);
}

.byt-breadcrumbs a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.byt-breadcrumbs a:hover {
  color: var(--color-electric-blue, #00D9FF);
}

.byt-breadcrumbs li:last-child {
  color: rgba(255, 255, 255, 0.4);
}

/* ======================================================================
   SEARCH MODAL
   ====================================================================== */

.byt-search-trigger {
  background: none;
  border: none;
  color: var(--color-dark-gray, #374151);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.byt-search-trigger:hover {
  color: var(--color-electric-blue, #00D9FF);
}

.byt-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1080;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.byt-search-overlay.byt-search-active {
  opacity: 1;
  visibility: visible;
}

.byt-search-modal {
  background: var(--color-charcoal, #1A1F2E);
  border: 1px solid rgba(0, 217, 255, 0.15);
  border-radius: var(--radius-lg, 16px);
  width: 90%;
  max-width: 640px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.byt-search-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}

.byt-search-header .ti-search {
  color: var(--color-electric-blue, #00D9FF);
  font-size: 20px;
  flex-shrink: 0;
}

.byt-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-family: var(--font-body, 'Inter', sans-serif);
}

.byt-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.byt-search-kbd {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.byt-search-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.byt-search-close:hover {
  color: #fff;
}

.byt-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.byt-search-hint {
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  padding: 24px 16px;
  text-align: center;
  margin: 0;
}

.byt-search-no-results {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  padding: 24px 16px;
  text-align: center;
  margin: 0;
}

.byt-search-result {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: background 0.15s ease;
}

.byt-search-result:hover {
  background: rgba(255, 255, 255, 0.05);
}

.byt-search-result-title {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.byt-search-result-desc {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.byt-search-result-category {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-electric-blue, #00D9FF);
  opacity: 0.7;
}

.byt-search-result mark {
  background: rgba(0, 217, 255, 0.2);
  color: var(--color-electric-blue, #00D9FF);
  border-radius: 2px;
  padding: 0 1px;
}

/* ======================================================================
   BLOG TABLE OF CONTENTS
   ====================================================================== */

.byt-toc {
  background: var(--color-light-gray, #F5F7FA);
  border-radius: var(--radius-lg, 16px);
  padding: 24px 32px;
  margin-bottom: 40px;
  border-left: 4px solid var(--color-electric-blue, #00D9FF);
}

.byt-toc-title {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--color-deep-navy, #0A1628);
}

.byt-toc ol {
  list-style: decimal;
  padding-left: 20px;
  margin: 0;
}

.byt-toc li {
  margin-bottom: 10px;
}

.byt-toc li:last-child {
  margin-bottom: 0;
}

.byt-toc a {
  color: var(--color-electric-blue, #00D9FF);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.byt-toc a:hover {
  text-decoration: underline;
  color: var(--color-vibrant-purple, #8B5CF6);
}

/* ======================================================================
   SOCIAL SHARING
   ====================================================================== */

.byt-social-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-light-gray, #E5E7EB);
}

.byt-share-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-medium-gray, #6B7280);
  margin-right: 4px;
}

.byt-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-light-gray, #E5E7EB);
  background: #fff;
  color: var(--color-dark-gray, #374151);
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.byt-share-btn:hover {
  border-color: var(--color-electric-blue, #00D9FF);
  color: var(--color-electric-blue, #00D9FF);
  transform: translateY(-2px);
}

.byt-share-linkedin:hover {
  border-color: #0077B5;
  color: #0077B5;
}

.byt-share-twitter:hover {
  border-color: #1DA1F2;
  color: #1DA1F2;
}

/* ======================================================================
   RELATED POSTS
   ====================================================================== */

.byt-related-posts {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--color-light-gray, #E5E7EB);
}

.byt-related-posts > h3 {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-deep-navy, #0A1628);
  margin: 0 0 24px;
}

.byt-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.byt-related-card {
  display: block;
  padding: 24px;
  background: var(--color-light-gray, #F5F7FA);
  border-radius: var(--radius-lg, 16px);
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.byt-related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 217, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.byt-related-category {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-electric-blue, #00D9FF);
  font-weight: 600;
  margin-bottom: 8px;
}

.byt-related-card h4 {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-deep-navy, #0A1628);
  margin: 0 0 10px;
  line-height: 1.4;
}

.byt-related-meta {
  font-size: 12px;
  color: var(--color-medium-gray, #6B7280);
}

/* ======================================================================
   NEWSLETTER SECTION
   ====================================================================== */

.byt-newsletter {
  background: linear-gradient(135deg, var(--color-deep-navy, #0A1628) 0%, var(--color-charcoal, #1A1F2E) 100%);
  padding: 60px 0;
  border-top: 1px solid rgba(0, 217, 255, 0.1);
}

.byt-newsletter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 48px;
}

.byt-newsletter-content {
  flex: 1;
}

.byt-newsletter-content h3 {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.byt-newsletter-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.byt-newsletter-form {
  flex-shrink: 0;
  width: 420px;
}

.byt-newsletter-input-group {
  display: flex;
  gap: 8px;
}

.byt-newsletter-input-group input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-family: var(--font-body, 'Inter', sans-serif);
  outline: none;
  transition: border-color 0.2s ease;
}

.byt-newsletter-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.byt-newsletter-input-group input:focus {
  border-color: var(--color-electric-blue, #00D9FF);
}

.byt-newsletter-input-group .btn {
  white-space: nowrap;
}

.byt-newsletter-status {
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.byt-newsletter-success {
  color: var(--color-neon-teal, #14F195);
}

.byt-newsletter-error {
  color: #ff6b6b;
}

/* ======================================================================
   EXIT-INTENT POPUP
   ====================================================================== */

.byt-exit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1090;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.byt-exit-overlay.byt-exit-visible {
  opacity: 1;
  visibility: visible;
}

.byt-exit-popup {
  background: var(--color-deep-navy, #0A1628);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: var(--radius-lg, 16px);
  padding: 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  position: relative;
}

.byt-exit-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.byt-exit-close:hover {
  color: #fff;
}

.byt-exit-popup h3 {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

.byt-exit-popup > p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px;
}

.byt-exit-form {
  display: flex;
  gap: 8px;
}

.byt-exit-form input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-family: var(--font-body, 'Inter', sans-serif);
  outline: none;
}

.byt-exit-form input:focus {
  border-color: var(--color-electric-blue, #00D9FF);
}

.byt-exit-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.byt-exit-status {
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ======================================================================
   COOKIE SETTINGS FOOTER LINK
   ====================================================================== */

.byt-consent-settings-trigger {
  color: var(--color-electric-blue, #00D9FF) !important;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.byt-consent-settings-trigger:hover {
  opacity: 0.8;
}

/* ======================================================================
   RESPONSIVE
   ====================================================================== */

@media (max-width: 768px) {
  /* Consent Banner */
  .byt-consent-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .byt-consent-actions {
    flex-direction: column;
    width: 100%;
  }

  .byt-consent-btn {
    width: 100%;
  }

  /* Search */
  .byt-search-overlay {
    padding-top: 5vh;
  }

  .byt-search-modal {
    width: 95%;
  }

  .byt-search-kbd {
    display: none;
  }

  /* Related Posts */
  .byt-related-grid {
    grid-template-columns: 1fr;
  }

  /* Newsletter */
  .byt-newsletter-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .byt-newsletter-form {
    width: 100%;
  }

  .byt-newsletter-input-group {
    flex-direction: column;
  }

  /* Exit Intent */
  .byt-exit-form {
    flex-direction: column;
  }

  /* Social Share */
  .byt-social-share {
    flex-wrap: wrap;
  }

  /* Breadcrumbs */
  .byt-breadcrumbs {
    top: 90px;
  }

  .byt-breadcrumbs ol {
    font-size: 12px;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .byt-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ======================================================================
   PRINT STYLESHEET
   ====================================================================== */

@media print {
  /* Hide non-essential elements */
  #header,
  .back-to-top,
  .byt-chat-launcher,
  .byt-consent-banner,
  .byt-consent-settings-panel,
  .byt-search-overlay,
  .byt-exit-overlay,
  .byt-newsletter,
  .byt-social-share,
  .byt-breadcrumbs,
  .cta-section,
  .footer-social,
  .mobile-nav-toggle,
  .particles-container,
  .btn,
  .byt-skip-link {
    display: none !important;
  }

  /* Reset backgrounds for print */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  .hero {
    background: none !important;
    color: black !important;
    min-height: auto !important;
    padding: 20px 0 !important;
  }

  .hero h1,
  .hero h2,
  .hero p,
  .text-white {
    color: black !important;
    -webkit-text-fill-color: black !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
  }

  /* Show URLs for external links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  a[href^="#"]::after {
    content: none;
  }

  /* Page break control */
  h2, h3 {
    page-break-after: avoid;
  }

  .blog-content {
    max-width: 100% !important;
  }

  /* Simplify footer */
  .footer {
    background: none !important;
    color: black !important;
    padding: 20px 0 !important;
  }

  .footer-grid {
    display: none !important;
  }

  .footer-bottom {
    border-top: 1px solid #ccc !important;
    color: black !important;
  }

  /* TOC for print */
  .byt-toc {
    border: 1px solid #ccc;
    background: #f9f9f9 !important;
    page-break-inside: avoid;
  }

  .byt-toc a {
    color: black !important;
  }

  .byt-related-posts {
    display: none !important;
  }
}

/* ======================================================================
   VISUALLY HIDDEN (Accessibility)
   ====================================================================== */

.byt-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
