/* ============================================
   DELYNTRO Documentation - Design System
   Premium, Modern Documentation CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f1f5f9;
  --bg-sidebar-active: #eff6ff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #475569;
  --text-sidebar-active: #4f46e5;
  --border-color: #e2e8f0;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-hero: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 50%, #e0f2fe 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: var(--accent-primary); transition: var(--transition); }
a:hover { color: var(--accent-secondary); }
img { max-width: 100%; height: auto; }
code {
  font-family: 'JetBrains Mono', monospace;
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
}

/* --- Layout --- */
.doc-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.doc-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}
.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
}
.sidebar-brand .brand-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.sidebar-brand .brand-sub {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-section {
  padding: 20px 16px 8px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.sidebar-nav li a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}
.sidebar-nav li a.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-weight: 600;
}
.sidebar-nav li a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}
.sidebar-nav li a.active .nav-icon {
  opacity: 1;
}

/* --- Sidebar Dropdown (Accordion) --- */
.nav-item.has-dropdown .dropdown-toggle {
  display: flex;
  justify-content: space-between;
}
.nav-item.has-dropdown .toggle-icon {
  font-size: 10px;
  transition: transform 0.3s ease;
}
.nav-item.has-dropdown.open .toggle-icon {
  transform: rotate(180deg);
}
.dropdown-menu {
  list-style: none;
  padding-left: 36px;
  display: none;
}
.nav-item.has-dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-menu li a {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: transparent;
}
.dropdown-menu li a:hover {
  color: var(--text-primary);
  background: transparent;
}
.dropdown-menu li a.active {
  color: var(--accent-primary);
  font-weight: 600;
  background: transparent;
}

/* --- Main Content --- */
.doc-main {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
}

/* --- Hero Section --- */
.doc-hero {
  background: var(--gradient-hero);
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}
.doc-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.doc-hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.doc-hero .hero-content { position: relative; z-index: 1; max-width: 720px; }
.doc-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(99,102,241,0.25);
  backdrop-filter: blur(8px);
}
.doc-hero h1 {
  color: var(--text-primary);
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.doc-hero p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

/* --- Content Area --- */
.doc-content {
  padding: 40px 48px;
  max-width: 900px;
}

/* --- Section --- */
.doc-section {
  margin-bottom: 48px;
}
.doc-section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.doc-section-title .section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}
.doc-section-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

/* --- Step Cards --- */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  transition: var(--transition);
  position: relative;
}
.step-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(99,102,241,0.2);
  transform: translateY(-1px);
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.step-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.step-content ul, .step-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.step-content li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.6;
}

/* --- Alert Boxes --- */
.doc-alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.doc-alert .alert-icon {
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.doc-alert.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.doc-alert.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.doc-alert.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.doc-alert.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* --- Tables --- */
.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  font-size: 13px;
}
.doc-table thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.doc-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover { background: #fafbfe; }

/* --- Accordion --- */
.doc-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-card);
}
.doc-accordion summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  list-style: none;
  user-select: none;
}
.doc-accordion summary::-webkit-details-marker { display: none; }
.doc-accordion summary::before {
  content: '▸';
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.doc-accordion[open] summary::before { transform: rotate(90deg); }
.doc-accordion summary:hover { background: #fafbfe; }
.doc-accordion .accordion-body {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.doc-accordion .accordion-body ul,
.doc-accordion .accordion-body ol {
  padding-left: 20px;
  margin: 8px 0;
}

/* --- Checklist --- */
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.checklist li:last-child { border-bottom: none; }
.checklist li .check-icon {
  color: #22c55e;
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* --- Module Cards (Home Page) --- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.module-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}
.module-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.module-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.module-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.module-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
}
.module-card .card-link:hover { gap: 10px; }

/* Module card accent colors */
.module-card.social-media::before { background: linear-gradient(90deg, #1877F2, #E4405F, #0077b5); }
.module-card.meta-api::before { background: linear-gradient(90deg, #25D366, #0668E1); }
.module-card.lead-master::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* --- Platform Badge --- */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}
.platform-badge.facebook { background: #e8f0fe; color: #1877F2; }
.platform-badge.instagram { background: #fce7f3; color: #E4405F; }
.platform-badge.linkedin { background: #e0f2fe; color: #0077b5; }
.platform-badge.twitter { background: #e0f2fe; color: #1DA1F2; }
.platform-badge.telegram { background: #e0f7fa; color: #2CA5E0; }
.platform-badge.youtube { background: #fef2f2; color: #FF0000; }
.platform-badge.whatsapp { background: #ecfdf5; color: #25D366; }
.platform-badge.meta { background: #eff6ff; color: #0668E1; }
.platform-badge.google { background: #e8f0fe; color: #1a73e8; }

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  cursor: pointer;
  z-index: 50;
  border: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.5);
}

/* --- Mobile Hamburger --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  z-index: 200;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.hamburger {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger:hover { background: var(--bg-sidebar-hover); }
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* --- Footer --- */
.doc-footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .doc-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
  }
  .doc-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .doc-main {
    margin-left: 0;
    padding-top: 60px;
  }
  .doc-hero { 
    padding: 40px 20px; 
    border-radius: 0;
  }
  .doc-hero .hero-content {
    text-align: center;
  }
  .doc-hero .hero-badge {
    margin: 0 auto 16px auto;
  }
  .doc-hero h1 { font-size: 26px; }
  .doc-content { padding: 24px 16px; }
  .module-grid { grid-template-columns: 1fr; }
  .doc-footer { padding: 24px 16px; }
  
  /* Fix layout breaks on small screens */
  .doc-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .step-card {
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
  }
  .doc-alert {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }
  code {
    word-break: break-all;
    white-space: normal;
  }
}
