/* ==========================================================================
   Rogabot Articles & Knowledge Library Stylesheet (articles.css)
   Aesthetics: Luxury Dark Mode (#070a0f, #0d131f), Cyan & Emerald Accents
   ========================================================================== */

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan, #06b6d4), var(--primary-emerald, #10b981));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Articles Index Hero & Search */
.hub-hero {
  padding: 5.5rem 1.5rem 3.5rem;
  text-align: center;
  background: 
    radial-gradient(circle at 50% 25%, rgba(7, 10, 15, 0.70) 0%, rgba(7, 10, 15, 0.96) 75%),
    url('../assets/images/knowledge-hub-bg.jpg') center center / cover no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hub-hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary, #94a3b8);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hub-search-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.hub-search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  background: rgba(13, 19, 31, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.hub-search-input:focus {
  border-color: var(--accent-cyan, #06b6d4);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25), 0 10px 35px rgba(0, 0, 0, 0.45);
}

.hub-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.hub-search-clear {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary, #94a3b8);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.hub-search-clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.hub-search-clear.hidden {
  display: none;
}

/* Filter Tabs & Result Stats */
.hub-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2.5rem 0 1rem;
}

.hub-filter-btn {
  background: rgba(13, 19, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  padding: 0.55rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hub-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.hub-filter-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-color: var(--accent-cyan, #06b6d4);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.hub-result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}

.hub-result-count {
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}

.hub-result-count strong {
  color: var(--accent-cyan, #06b6d4);
}

/* Empty Search State */
.hub-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: rgba(13, 19, 31, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  max-width: 600px;
  margin: 2rem auto;
}

.hub-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.hub-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.hub-empty-desc {
  font-size: 0.95rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 1.5rem;
}

/* Articles Grid Layout */
.hub-section {
  padding: 3.5rem 1.5rem 5rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  max-width: 1240px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Article Card */
.article-card {
  background: linear-gradient(180deg, rgba(13, 19, 31, 0.8) 0%, rgba(7, 10, 15, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan, #06b6d4), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45), 0 0 25px rgba(6, 182, 212, 0.12);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.article-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan, #06b6d4);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.article-tag.tag-tech {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}

.article-tag.tag-roi {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.article-tag.tag-compare {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

.article-read-time {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.article-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.article-card:hover .article-card-title {
  color: var(--accent-cyan, #06b6d4);
}

.article-card-desc {
  font-size: 0.925rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-cyan, #06b6d4);
}

.article-card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s ease;
}

.article-card:hover .article-card-footer span {
  gap: 0.65rem;
}

/* ==========================================================================
   Article Single Page Layout
   ========================================================================== */
.article-header {
  padding: 4.5rem 1.5rem 2.5rem;
  background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.1) 0%, rgba(7, 10, 15, 0) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.article-header-inner {
  max-width: 860px;
  margin: 0 auto;
}

.article-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.article-breadcrumbs a {
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-breadcrumbs a:hover {
  color: var(--accent-cyan, #06b6d4);
}

.article-main-title {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.18;
  color: #ffffff;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary, #94a3b8);
  padding-top: 0.5rem;
}

.article-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-weight: 600;
}

.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* Article Body Typography */
.article-body {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #cbd5e1;
}

.article-body h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #ffffff;
  margin: 2.75rem 0 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  scroll-margin-top: 90px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-body h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: #f1f5f9;
  margin: 2rem 0 0.85rem;
  line-height: 1.35;
  scroll-margin-top: 90px;
}

.article-body p {
  margin-bottom: 1.4rem;
}

.article-body ul, 
.article-body ol {
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}

.article-body li {
  margin-bottom: 0.6rem;
  padding-left: 0.3rem;
}

.article-body strong {
  color: #ffffff;
  font-weight: 700;
}

.article-body a {
  color: var(--accent-cyan, #06b6d4);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.article-body a:hover {
  color: #38bdf8;
}

/* Callout Boxes */
.callout-box {
  background: rgba(13, 19, 31, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left: 4px solid var(--accent-cyan, #06b6d4);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  backdrop-filter: blur(8px);
}

.callout-box.callout-success {
  border-left-color: var(--primary-emerald, #10b981);
  border-color: rgba(16, 185, 129, 0.25);
}

.callout-box.callout-warning {
  border-left-color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.callout-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-box p:last-child {
  margin-bottom: 0;
}

/* Comparison Tables */
.table-responsive-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(13, 19, 31, 0.6);
  -webkit-overflow-scrolling: touch;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.article-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.article-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary, #94a3b8);
}

.article-table tr:last-child td {
  border-bottom: none;
}

.article-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.article-table .badge-highlight {
  color: var(--primary-emerald, #10b981);
  font-weight: 700;
}

/* Dial Code & Code Blocks */
.code-box {
  background: #05080d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

.code-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.code-box code {
  color: #38bdf8;
  display: block;
  overflow-x: auto;
  line-height: 1.6;
}

.code-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
}

.code-copy-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  color: #ffffff;
  border-color: var(--accent-cyan, #06b6d4);
}

.code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--primary-emerald, #10b981);
  color: #34d399;
}

/* Step By Step List */
.step-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.step-item {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
}

.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan, #06b6d4) 0%, var(--primary-emerald, #10b981) 100%);
  color: #070a0f;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

/* In-Article Conversion CTA Card */
.article-cta-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 16px;
  padding: 2.25rem;
  margin: 3rem 0;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.article-cta-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.article-cta-desc {
  font-size: 1.05rem;
  color: var(--text-secondary, #94a3b8);
  max-width: 600px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}

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

.article-cta-trust {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-top: 1.25rem;
}

/* FAQ Accordion in Articles */
.faq-container {
  margin: 2.5rem 0;
}

.faq-item {
  background: rgba(13, 19, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: inherit;
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.25s ease;
  color: var(--accent-cyan, #06b6d4);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.65;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Sticky Sidebar */
.article-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-widget {
  background: rgba(13, 19, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.sidebar-widget-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 0.5rem;
}

.toc-link {
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.toc-link:hover,
.toc-link.active {
  color: var(--accent-cyan, #06b6d4);
  background: rgba(6, 182, 212, 0.1);
  padding-left: 0.75rem;
}

/* Related Articles Section */
.related-articles-section {
  padding: 4rem 1.5rem;
  background: rgba(13, 19, 31, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.related-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  margin-bottom: 2.5rem;
}

/* Light Theme Overrides for Articles & Knowledge Hub */
html.theme-light .hub-hero {
  background: 
    radial-gradient(circle at 50% 25%, rgba(248, 250, 252, 0.88) 0%, rgba(241, 245, 249, 0.98) 75%),
    url('../assets/images/knowledge-hub-bg.jpg') center center / cover no-repeat;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html.theme-light .hub-search-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html.theme-light .hub-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2), 0 8px 24px rgba(15, 23, 42, 0.08);
}

html.theme-light .hub-filter-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}

html.theme-light .hub-filter-btn.active,
html.theme-light .hub-filter-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

html.theme-light .article-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

html.theme-light .article-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.12);
}

html.theme-light .article-card-title {
  color: #0f172a;
}

html.theme-light .article-card-desc {
  color: #475569;
}

html.theme-light .article-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html.theme-light .article-content {
  color: #334155;
}

html.theme-light .article-content h2,
html.theme-light .article-content h3 {
  color: #0f172a;
}

html.theme-light .article-callout,
html.theme-light .article-sidebar-box {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

html.theme-light .code-block,
html.theme-light pre {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

html.theme-light .related-articles-section {
  background: #f1f5f9;
  border-top-color: rgba(15, 23, 42, 0.08);
}

