/* ============================================================
   HARYADI FRAMEWORK DOCUMENTATION STYLES - PROFESSIONAL VERSION
   Author: Deni Agus Haryadi
   File: assets/css/documentation.css
   ============================================================ */

/* ===============================
   Base Styling
=============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --primary-color: #3a86ff;
  --primary-gradient: linear-gradient(135deg, #3a86ff, #8338ec);
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --error-color: #e74c3c;

  /* Text Colors */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #6b7585;
  --text-white: #ffffff;

  /* Background Colors */
  --bg-primary: #f7fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #f8f9fa;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Typography */
  --font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-code: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-heading: "Inter", "SF Pro Display", system-ui, sans-serif;

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Border */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
}

.dark-mode {
  --text-primary: #f7fafc;
  --text-secondary: #cbd5e0;
  --text-light: #a0aec0;
  --text-white: #ffffff;

  --bg-primary: #0f1419;
  --bg-secondary: #1a202c;
  --bg-card: #2d3748;
  --bg-code: #1a202c;

  --border-color: #2d3748;
  --border-light: #2d3748;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.25), 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3), 0 10px 10px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===============================
   Layout & Container
=============================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===============================
   Header Navigation
=============================== */
.header-custom {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand h2 {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.nav-brand span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
  background: rgba(58, 134, 255, 0.08);
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: var(--font-semibold);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
}

.theme-toggle button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: rotate(15deg);
}

/* ===============================
   Sidebar
=============================== */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-inner h1 {
  font-size: 1.4rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.sidebar-inner p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: var(--font-medium);
  font-size: 0.9rem;
}

.sidebar nav a:hover {
  background: rgba(58, 134, 255, 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar nav a.active {
  background: var(--primary-color);
  color: var(--text-white);
  font-weight: var(--font-semibold);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
}

.badge {
  background: var(--primary-gradient);
  color: var(--text-white);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: var(--font-semibold);
  margin-right: 0.5rem;
}

/* ===============================
   Main Content
=============================== */
.main-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-2xl);
}

.overview-header h2 {
  font-size: 2.5rem;
  font-weight: var(--font-extrabold);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.text-muted {
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1.7;
  /* font-weight: var(--font-normal); */
  max-width: 550px;
}

.kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ===============================
   Documentation Section
=============================== */
.docs-section {
  margin-top: var(--space-2xl);
  padding: var(--space-2xl);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
}

.docs-section:hover {
  box-shadow: var(--shadow-xl);
}

.section-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.section-title {
  font-size: 2rem;
  font-weight: var(--font-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.section-title::before {
  content: "#";
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: var(--font-medium);
  line-height: 1.6;
  max-width: 800px;
}
.section-sub {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: var(--font-semibold);
  line-height: 1.4;
  margin: 2rem 0 1rem 0;
  padding: 1rem 1;
  border-bottom: 5px solid var(--border-light);
  position: relative;
}

/* ===============================
   Subsection Styling
=============================== */
.subsection {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.subsection:hover {
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.subsection-header {
  margin-bottom: var(--space-lg);
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.subsection-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-gradient);
  color: var(--text-white);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: var(--font-bold);
  flex-shrink: 0;
}

.subsection-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-left: 3.25rem;
}

/* ===============================
   Code Blocks - Enhanced
=============================== */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-md);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-code);
}

.code-filename {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: var(--font-medium);
}

.code-actions {
  display: flex;
  gap: var(--space-xs);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.copy-btn:hover {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

pre {
  margin: 0;
  padding: var(--space-lg);
  overflow-x: auto;
  background: var(--bg-code);
  font-family: var(--font-code);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

code {
  font-family: var(--font-code);
  font-size: 0.85em;
  font-weight: var(--font-medium);
}

/* Inline code */
:not(pre) > code {
  background: rgba(58, 134, 255, 0.1);
  color: var(--primary-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: var(--font-medium);
}

/* ===============================
   Tables - Enhanced
=============================== */
.table-container {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.docs-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  padding: var(--space-md);
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.docs-table tr:hover {
  background: rgba(58, 134, 255, 0.03);
}

.docs-table code {
  background: rgba(58, 134, 255, 0.1);
  color: var(--primary-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: var(--font-medium);
}

/* ===============================
   Notes & Alerts
=============================== */

.note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  border-left: 3px solid;
  background: var(--bg-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all var(--transition-fast);
}

.note:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.note.info {
  border-left-color: var(--primary-color);
  background: rgba(58, 134, 255, 0.04);
}

.note.warning {
  border-left-color: var(--warning-color);
  background: rgba(243, 156, 18, 0.04);
}

.note.success {
  border-left-color: var(--success-color);
  background: rgba(39, 174, 96, 0.04);
}

.note.danger {
  border-left-color: var(--error-color);
  background: rgba(231, 76, 60, 0.04);
}

.note-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  width: 16px;
  text-align: center;
}

.note-content {
  flex: 1;
}

.note-content strong {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  font-size: 0.92rem;
}

.note-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.note-content p:not(:first-child) {
  margin-top: 0.5rem;
}

.note code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: var(--font-medium);
}

/* ===============================
   Lists
=============================== */
.helper-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0;
}

.helper-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  line-height: 1.6;
}

.helper-list li:last-child {
  border-bottom: none;
}

.helper-list li::before {
  content: "→";
  color: var(--primary-color);
  font-weight: var(--font-bold);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.helper-list code {
  background: rgba(58, 134, 255, 0.1);
  color: var(--primary-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: var(--font-medium);
}

/* ===============================
   Responsive Design
=============================== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.active {
    left: 0;
  }

  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .navbar {
    padding: 1rem;
  }

  .main-content {
    padding: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--space-md);
  }

  .docs-section {
    padding: var(--space-lg);
    margin-top: var(--space-xl);
  }

  .subsection {
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
  }

  .overview-header {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .overview-header h2 {
    font-size: 2rem;
  }

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

  .subsection-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 640px) {
  .nav-menu {
    display: none;
  }

  .docs-section {
    padding: var(--space-md);
  }

  .subsection {
    padding: var(--space-md);
  }

  pre {
    padding: var(--space-md);
    font-size: 0.8rem;
  }
}

/* ===============================
   Utility Classes
=============================== */
.mt-3 {
  margin-top: var(--space-md);
}
.mt-4 {
  margin-top: var(--space-lg);
}
.mt-5 {
  margin-top: var(--space-xl);
}
.mb-3 {
  margin-bottom: var(--space-md);
}
.mb-4 {
  margin-bottom: var(--space-lg);
}
.mb-5 {
  margin-bottom: var(--space-xl);
}

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-lg);
}

/* ===============================
   Animation Keyframes
=============================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docs-section {
  animation: fadeIn 0.5s ease-out;
}

.subsection {
  animation: fadeIn 0.6s ease-out;
}
