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

:root {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --brand-navy: #0f172a;
  --brand-navy-light: #1e293b;
  --brand-orange: #f97316;
  --brand-orange-hover: #ea580c;
  --brand-orange-light: #ffedd5;
  
  --border-color: #e2e8f0;
  --border-focus: #f97316;
  
  --toc-active-bg: #fff7ed;
  --toc-active-border: #f97316;
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Layout */
  --max-width: 1280px;
  --sidebar-width: 280px;
  --header-height: 72px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  /* Colors */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --brand-navy: #38bdf8;
  --brand-navy-light: #7dd3fc;
  --brand-orange: #f97316;
  --brand-orange-hover: #fb923c;
  --brand-orange-light: #2c1a10;
  
  --border-color: #1e293b;
  --border-focus: #f97316;
  
  --toc-active-bg: #2c1a10;
  --toc-active-border: #f97316;
}

/* Base Reset & Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  transition: color var(--transition-normal);
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--brand-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-orange-hover);
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-orange);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Header Styles */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: rgba(var(--bg-primary-rgb, 255, 255, 255), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

body[data-theme="dark"] .header {
  background-color: rgba(11, 15, 25, 0.8);
}

body:not([data-theme="dark"]) .header {
  background-color: rgba(255, 255, 255, 0.8);
}

.header-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
}

.logo-image {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity var(--transition-fast);
}

.logo-image:hover {
  opacity: 0.9;
}

.logo-badge {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Language Switcher Styling */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  padding: 0.15rem;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: #ffffff;
  background-color: var(--brand-orange);
}

[data-theme="dark"] .lang-btn.active {
  color: #ffffff;
  background-color: var(--brand-orange);
}

/* Language Visibility Rules */
html[lang="en"] .lang-id,
html:not([lang="id"]) .lang-id {
  display: none !important;
}

html[lang="id"] .lang-en {
  display: none !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--brand-orange);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-btn .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

.market-btn {
  display: inline-flex;
  align-items: center;
  background-color: var(--brand-navy);
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background-color var(--transition-fast);
}

[data-theme="dark"] .market-btn {
  background-color: var(--brand-orange);
}

[data-theme="dark"] .market-btn:hover {
  background-color: var(--brand-orange-hover);
}

body:not([data-theme="dark"]) .market-btn:hover {
  background-color: var(--brand-navy-light);
}

/* Hero Section */
.hero {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem 1.5rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-orange);
  background-color: var(--brand-orange-light);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Main Layout Structure */
.layout-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 3rem;
  position: relative;
}

/* Sidebar Navigation (Table of Contents) */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  padding-bottom: 2rem;
  display: block;
}

/* Hide scrollbar for sidebar, keeping functionality */
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
}

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

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

.toc-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-link:hover {
  color: var(--brand-orange);
  background-color: var(--bg-secondary);
  border-left-color: var(--border-color);
}

.toc-link.active {
  color: var(--brand-orange);
  font-weight: 600;
  background-color: var(--toc-active-bg);
  border-left-color: var(--toc-active-border);
}

/* Content Area */
.content {
  flex-grow: 1;
  max-width: 800px;
  padding: 3rem 0 6rem;
}

.content-section {
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.content-section p:first-of-type {
  margin-top: 1rem;
}

/* Style cards for structured listings */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.info-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.info-card:hover {
  border-color: var(--brand-orange);
}

.info-card h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card h4 svg {
  width: 18px;
  height: 18px;
  color: var(--brand-orange);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.info-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.list-badge {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
}

/* Contact Box styling */
.contact-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-orange);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin: 2rem 0;
}

.contact-box h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.contact-details {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.contact-details li {
  display: flex;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.contact-details li strong {
  width: 140px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.contact-details li span {
  color: var(--text-secondary);
}

/* Back to top button for mobile */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--brand-navy);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal), transform var(--transition-fast);
  z-index: 99;
}

[data-theme="dark"] .back-to-top {
  background-color: var(--brand-orange);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mobile Quick Navigation Sticky Menu */
.mobile-nav-bar {
  display: none;
  position: sticky;
  top: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  z-index: 49;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.mobile-nav-select {
  width: 100%;
  padding: 0.625rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.mobile-nav-select:focus {
  border-color: var(--brand-orange);
}

/* Footer Styles */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-info {
  max-width: 360px;
}

.footer-logo {
  height: 38px;
  width: auto;
  display: block;
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  gap: 4rem;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-links-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--brand-orange);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
}

/* Media Queries for Layout Responsiveness */
@media (max-width: 1023px) {
  .sidebar {
    display: none;
  }
  
  .mobile-nav-bar {
    display: block;
  }
  
  .layout-container {
    gap: 0;
  }
  
  .content {
    padding-top: 2rem;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 60px;
  }

  h1 {
    font-size: 1.875rem;
  }
  
  .hero {
    padding: 3rem 1rem;
  }
  
  .layout-container {
    padding: 0 1rem;
  }
  
  .content {
    padding-bottom: 4rem;
  }
  
  /* Header Mobile Optimizations */
  .header-container {
    padding: 0 1rem;
  }
  
  .logo-image {
    height: 32px;
  }
  
  .logo-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
  }
  
  .header-actions {
    gap: 0.75rem;
  }
  
  .header-actions .market-btn {
    display: none !important;
  }
  
  /* Card Mobile Optimizations */
  .info-card {
    padding: 1rem;
  }
  
  /* Contact Details Stack on Mobile */
  .contact-details li {
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
  }
  
  .contact-details li strong {
    width: auto;
  }
  
  .contact-details li span a {
    word-break: break-all;
    overflow-wrap: break-word;
  }
  
  .footer-nav {
    flex-direction: column;
    gap: 2rem;
  }
}

/* High Contrast & Focus Styles (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}
