/* Documentation Styles for RewardSmart */
/* Built on top of blog.css patterns with doc-specific enhancements */

/* ============================================ */
/* DOCS HERO */
/* ============================================ */

.docs-hero {
  background: linear-gradient(135deg, #0F0F23 0%, #1a1a3e 50%, #0F0F23 100%);
  padding: 140px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.docs-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(124, 58, 237, 0.15), transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.1), transparent 50%);
  pointer-events: none;
}

.docs-hero .container {
  position: relative;
  z-index: 1;
}

.docs-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.docs-subtitle {
  font-size: 1.15rem;
  color: #9CA3AF;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* Search Bar */
.docs-search-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.docs-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.25s ease;
}

.docs-search-input::placeholder {
  color: #6B7280;
}

.docs-search-input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.docs-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6B7280;
  pointer-events: none;
}

/* ============================================ */
/* CATEGORY CARDS */
/* ============================================ */

.docs-categories {
  padding: 3rem 0;
  background: #0F0F23;
}

.docs-categories .container {
  max-width: 1200px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.category-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-card:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
}

.category-card.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.4);
}

.category-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  flex-shrink: 0;
}

.category-info h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.category-info p {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin: 0;
  line-height: 1.4;
}

.category-count {
  font-size: 0.7rem;
  color: #7C3AED;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ============================================ */
/* DOCS LISTING */
/* ============================================ */

.docs-content {
  background: #0a0a1a;
  padding: 2rem 0 4rem;
  min-height: 400px;
}

.docs-content .container {
  max-width: 1200px;
}

.docs-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* Doc Card */
.doc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-card:hover {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.1);
}

.doc-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-card-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
}

.doc-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.doc-card h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.doc-card p {
  font-size: 0.88rem;
  color: #9CA3AF;
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: #6B7280;
}

.doc-read-more {
  font-size: 0.82rem;
  color: #7C3AED;
  font-weight: 500;
  transition: color 0.2s ease;
}

.doc-card:hover .doc-read-more {
  color: #8B5CF6;
}

/* ============================================ */
/* LOADING & EMPTY STATES */
/* ============================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: #7C3AED;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state p {
  color: #9CA3AF;
  font-size: 0.9rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #9CA3AF;
  font-size: 0.9rem;
}

/* ============================================ */
/* ARTICLE PAGE STYLES */
/* ============================================ */

.doc-article-page {
  background: #0a0a1a;
  padding-top: 80px;
  min-height: 100vh;
}

.doc-article-hero {
  background: linear-gradient(135deg, #0F0F23 0%, #1a1a3e 50%, #0F0F23 100%);
  padding: 2.5rem 0;
  position: relative;
}

.doc-article-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.12), transparent 50%);
  pointer-events: none;
}

.doc-article-hero .container {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.doc-breadcrumb a {
  color: #9CA3AF;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}

.doc-breadcrumb a:hover {
  color: #7C3AED;
}

.doc-breadcrumb .separator {
  color: #4B5563;
}

.doc-article-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.12);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.doc-article-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.doc-article-summary {
  font-size: 1.05rem;
  color: #9CA3AF;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.doc-article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: #6B7280;
  flex-wrap: wrap;
}

.doc-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-meta-item svg {
  opacity: 0.6;
}

/* Article Body */
.doc-article-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
}

.doc-article-body {
  color: #D1D5DB;
  font-size: 1rem;
  line-height: 1.8;
}

.doc-article-body h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.doc-article-body h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #ffffff;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.3;
}

.doc-article-body h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #E5E7EB;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.3;
}

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

.doc-article-body a {
  color: #8B5CF6;
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.doc-article-body a:hover {
  color: #A78BFA;
  border-bottom-color: rgba(167, 139, 250, 0.5);
}

.doc-article-body ul, .doc-article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.doc-article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

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

.doc-article-body code {
  background: rgba(124, 58, 237, 0.1);
  color: #A78BFA;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.doc-article-body pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.doc-article-body pre code {
  background: none;
  padding: 0;
  color: #D1D5DB;
}

.doc-article-body blockquote {
  border-left: 3px solid #7C3AED;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(124, 58, 237, 0.06);
  border-radius: 0 8px 8px 0;
  color: #D1D5DB;
}

.doc-article-body blockquote strong {
  color: #8B5CF6;
}

/* Tags */
.doc-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-tag {
  font-size: 0.78rem;
  color: #9CA3AF;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.doc-tag:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
  color: #8B5CF6;
}

/* Sidebar */
.doc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 100px;
  align-self: start;
}

.doc-sidebar-nav {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

.doc-sidebar-nav h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.doc-sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-sidebar-nav li {
  margin-bottom: 0.25rem;
}

.doc-sidebar-nav a {
  display: block;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #9CA3AF;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.doc-sidebar-nav a:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #8B5CF6;
}

.doc-sidebar-nav a.active {
  background: rgba(124, 58, 237, 0.12);
  color: #8B5CF6;
  font-weight: 500;
}

/* Related Docs Sidebar */
.doc-sidebar-related {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

.doc-sidebar-related h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.doc-sidebar-related-item {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: all 0.2s ease;
}

.doc-sidebar-related-item:last-child {
  border-bottom: none;
}

.doc-sidebar-related-item:hover h5 {
  color: #8B5CF6;
}

.doc-sidebar-related-item span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #7C3AED;
}

.doc-sidebar-related-item h5 {
  font-size: 0.85rem;
  font-weight: 500;
  color: #D1D5DB;
  margin: 0.25rem 0 0;
  line-height: 1.4;
  transition: color 0.2s ease;
}

/* CTA Card in Sidebar */
.doc-sidebar-cta {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.doc-sidebar-cta h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.doc-sidebar-cta p {
  font-size: 0.82rem;
  color: #9CA3AF;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.doc-sidebar-cta .cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 20px;
  background: linear-gradient(135deg, #7C3AED, #6366F1);
  color: #ffffff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.doc-sidebar-cta .cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Reading progress */
.doc-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #7C3AED, #6366F1);
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0%;
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 0;
  text-align: center;
}

.error-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.error-state h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.error-state p {
  color: #9CA3AF;
  margin-bottom: 1.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #7C3AED;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: #8B5CF6;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
  .docs-hero {
    padding: 120px 20px 40px;
  }

  .docs-title {
    font-size: 1.75rem;
  }

  .docs-subtitle {
    font-size: 1rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .doc-article-container {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 3rem;
  }

  .doc-sidebar {
    position: static;
    order: -1;
  }

  .doc-article-title {
    font-size: 1.5rem;
  }

  .doc-article-meta {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .docs-title {
    font-size: 1.5rem;
  }

  .doc-card {
    padding: 1.25rem;
  }
}
