/* ==========================================================================
   BahasaLang - MyKamus Brand Theme & Layout System
   Consistent with MyKamus.com design system:
   - Brand Blue (#075fc6), Dark Slate (#172033), Light Gray (#f5f7fa)
   - W3Schools-style Left Sidebar Menu
   - High readability, 2026 SEO structured content, responsive layout
   ========================================================================== */

:root {
  --mk-blue: #075fc6;
  --mk-blue-hover: #064f9f;
  --mk-blue-light: #e9f3ff;
  --mk-dark: #172033;
  --mk-text-muted: #536174;
  --mk-bg: #f5f7fa;
  --mk-border: #dfe5ec;
  --mk-border-strong: #ccd5df;
  --mk-card-bg: #ffffff;
  --mk-terminal-bg: #172033;
  --mk-terminal-green: #50fa7b;
  --mk-sidebar-w: 270px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--mk-dark);
  background-color: var(--mk-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--mk-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MyKamus Site Header
   ========================================================================== */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--mk-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.04);
}

.header-inner {
  width: min(100% - 2rem, 1300px);
  margin: auto;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.brand {
  color: var(--mk-blue);
  text-decoration: none;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  flex-shrink: 0;
}

.brand small {
  display: block;
  color: var(--mk-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  margin-top: 0.2rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.header-nav a {
  color: #35445a;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  background: var(--mk-blue-light);
  color: var(--mk-blue);
  text-decoration: none;
}

.btn-header-cta {
  background: var(--mk-blue);
  color: #ffffff !important;
  font-weight: 750;
  border-radius: 8px !important;
}

.btn-header-cta:hover {
  background: var(--mk-blue-hover) !important;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--mk-border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  color: var(--mk-dark);
}

/* ==========================================================================
   Main Layout: W3Schools-Style Left Menu + MyKamus Card Content
   ========================================================================== */
.main-wrapper {
  width: min(100% - 2rem, 1300px);
  margin: 1.25rem auto 3rem auto;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex: 1;
}

/* W3Schools-Style Left Menu */
.w3-sidebar {
  width: var(--mk-sidebar-w);
  background: #ffffff;
  border: 1px solid var(--mk-border);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(23, 32, 51, 0.04);
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 1rem 0.5rem 2rem 0.5rem;
  font-size: 14.5px;
}

.w3-sidebar-search {
  padding: 0 0.5rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--mk-border);
  margin-bottom: 0.5rem;
}

.w3-sidebar-search input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--mk-border-strong);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  background: #ffffff;
}

.w3-sidebar-search input:focus {
  border-color: var(--mk-blue);
  box-shadow: 0 0 0 3px rgba(7, 95, 198, 0.15);
}

.w3-sidebar-title {
  padding: 0.75rem 0.85rem 0.25rem 0.85rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--mk-text-muted);
}

.w3-sidebar a {
  display: block;
  padding: 0.48rem 0.85rem;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  margin: 1px 0;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.w3-sidebar a:hover {
  background: #f1f5f9;
  color: var(--mk-dark);
  text-decoration: none;
}

.w3-sidebar a.active {
  background: var(--mk-blue-light);
  color: var(--mk-blue);
  border-left: 3px solid var(--mk-blue);
  font-weight: 750;
}

.w3-sidebar a .badge {
  float: right;
  font-size: 10px;
  background: #172033;
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Main Content Area */
.content-area {
  flex: 1;
  min-width: 0;
}

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--mk-text-muted);
  margin-bottom: 0.85rem;
}

.breadcrumbs a {
  color: var(--mk-text-muted);
}

.entry-card {
  background: #ffffff;
  border: 1px solid var(--mk-border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(23, 32, 51, 0.05);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.entry-card:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--mk-blue);
}

/* Headings */
h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  color: var(--mk-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--mk-dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.18rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--mk-dark);
}

p {
  margin-bottom: 1rem;
  color: #334155;
  line-height: 1.7;
}

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

li {
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   Navigation Buttons (❮ Sebelumnya / Seterusnya ❯)
   ========================================================================== */
.btn-nav-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 2rem 0;
  gap: 1rem;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mk-blue);
  color: #ffffff !important;
  font-weight: 750;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-nav:hover {
  background: var(--mk-blue-hover);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(7, 95, 198, 0.25);
}

.btn-nav.disabled {
  background: #e2e8f0;
  color: #94a3b8 !important;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* ==========================================================================
   Download Promotion Banner Cards (Kompiler & VS Code VSIX)
   ========================================================================== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0 2.25rem 0;
}

.download-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  border: 1px solid #c7ddf8;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(7, 95, 198, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.download-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--mk-blue-light);
  color: var(--mk-blue);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.download-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mk-dark);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.download-card-desc {
  font-size: 0.92rem;
  color: var(--mk-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.download-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.btn-download {
  background: var(--mk-blue);
  color: #ffffff !important;
  font-weight: 750;
  font-size: 0.95rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-download:hover {
  background: var(--mk-blue-hover);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(7, 95, 198, 0.3);
}

.btn-download.secondary {
  background: #172033;
}

.btn-download.secondary:hover {
  background: #0f172a;
}

/* ==========================================================================
   Installation Step-by-Step Cards
   ========================================================================== */
.step-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem 0;
}

.step-card {
  display: flex;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--mk-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.step-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--mk-blue);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  margin-top: 0;
  font-size: 1.12rem;
  color: var(--mk-dark);
}

.step-content p {
  margin-bottom: 0.6rem;
}

/* ==========================================================================
   Code Example Widget (Contoh Kod)
   ========================================================================== */
.code-example-card {
  background: #f8fafc;
  border: 1px solid var(--mk-border);
  border-left: 4px solid var(--mk-blue);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.code-example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.code-example-title {
  font-weight: 750;
  font-size: 1.05rem;
  color: var(--mk-dark);
}

.code-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin-bottom: 0.85rem;
  color: #0f172a;
  white-space: pre-wrap;
}

.code-box.dark {
  background: var(--mk-terminal-bg);
  color: #f8fafc;
  border-color: #2e384d;
}

.btn-try {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mk-blue);
  color: #ffffff !important;
  font-weight: 750;
  font-size: 0.92rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-try:hover {
  background: var(--mk-blue-hover);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(7, 95, 198, 0.25);
}

.btn-copy {
  background: #ffffff;
  border: 1px solid var(--mk-border-strong);
  color: #475569;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-copy:hover {
  background: #f1f5f9;
  color: var(--mk-dark);
}

.inline-output {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--mk-terminal-bg);
  color: var(--mk-terminal-green);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  white-space: pre-wrap;
  display: none;
  border-left: 3px solid #10b981;
}

.inline-output.active {
  display: block;
}

/* ==========================================================================
   Alert Note Panels (MyKamus Style)
   ========================================================================== */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.alert-tip {
  background: #f0f7ff;
  border-left: 4px solid var(--mk-blue);
  color: #1e3a8a;
}

.alert-note {
  background: #fefce8;
  border-left: 4px solid #eab308;
  color: #713f12;
}

.alert-info {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

/* ==========================================================================
   Interactive Exercise Card (Uji Diri)
   ========================================================================== */
.exercise-card {
  background: #172033;
  color: #ffffff;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 2rem 0;
}

.exercise-card h3 {
  color: #ffffff;
  margin-top: 0;
  font-size: 1.25rem;
}

.exercise-card p {
  color: #cbd5e1;
  font-size: 0.95rem;
}

.exercise-box {
  background: #ffffff;
  color: #000000;
  padding: 1rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 15px;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.exercise-input {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  padding: 4px 8px;
  border: 2px solid #64748b;
  border-radius: 4px;
  width: 90px;
  text-align: center;
}

.exercise-input:focus {
  border-color: var(--mk-blue);
  outline: none;
}

.btn-check {
  background: var(--mk-blue);
  color: #ffffff;
  font-weight: 750;
  font-size: 0.92rem;
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.exercise-feedback {
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  display: none;
}

.exercise-feedback.correct {
  display: block;
  background: #dcfce7;
  color: #166534;
}

.exercise-feedback.incorrect {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table.mk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: #ffffff;
  border: 1px solid var(--mk-border);
  border-radius: 8px;
  overflow: hidden;
}

table.mk-table th {
  background: #f8fafc;
  color: #334155;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--mk-border);
}

table.mk-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--mk-border);
  color: #334155;
}

table.mk-table tr:hover {
  background: #f8fafc;
}

table.mk-table code {
  background: var(--mk-blue-light);
  color: var(--mk-blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
}

/* Code Highlighting in Examples */
.bahasa-kw { color: #075fc6; font-weight: bold; }
.bahasa-str { color: #059669; }
.bahasa-num { color: #7c3aed; font-weight: bold; }
.bahasa-bool { color: #ea580c; font-weight: bold; }
.bahasa-comm { color: #64748b; font-style: italic; }

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--mk-border);
  background: #ffffff;
  margin-top: auto;
}

.footer-inner {
  width: min(100% - 2rem, 1300px);
  margin: auto;
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  color: var(--mk-blue);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 850;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
}

.footer-links a {
  color: #46566a;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--mk-blue);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .menu-toggle {
    display: block;
  }

  .main-wrapper {
    flex-direction: column;
    margin-top: 1rem;
  }

  .w3-sidebar {
    position: fixed;
    left: -320px;
    top: 80px;
    height: calc(100vh - 80px);
    z-index: 999;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: left 0.25s ease;
    width: 290px;
  }

  .w3-sidebar.open {
    left: 0;
  }

  .header-nav {
    display: none;
  }
}
