/* ==================================================
   Terakhir Diperbarui: 10 April 2025
   Kode CSS Lengkap - Termasuk Penyesuaian & Gaya Fokus
   ================================================== */

/* ==================================================
   VARIABEL CSS (CUSTOM PROPERTIES)
   ================================================== */
:root {
  /* Warna Utama */
  --primary-color: #007BFF;
  --primary-hover-color: #0056b3;
  --dark-color: #343a40;
  --light-color: #FFFFFF;
  --text-color: #343a40; /* Warna teks utama */
  --text-muted: #6c757d; /* Warna teks sekunder/abu-abu */
  --border-color: #e9ecef; /* Warna border umum */
  --light-bg: #f8f9fa;   /* Warna latar belakang terang */

  /* Warna Menu */
  --menu-bg: #343a40;
  --menu-text-color: #adb5bd;
  --menu-text-hover-bg: #495057;
  --menu-text-hover-color: #ffffff;
  --menu-active-bg: var(--primary-color);
  --menu-active-color: #ffffff;

  /* Warna Status & Aksen */
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --success-bg-light: #d4edda;
  --success-text-dark: #155724;
  --danger-bg-light: #f8d7da;
  --danger-text-dark: #721c24;
  --neutral-bg-light: #e9ecef;
  --neutral-text-dark: #6c757d;

  /* Ukuran & Jarak */
  --base-font-size: 16px;
  --base-line-height: 1.7;
  --paragraph-margin-bottom: 1.2rem;
  --heading-margin-top: 2.2rem;
  --heading-margin-bottom: 1.1rem; /* Default margin bawah judul */
  --container-max-width: 1140px;
  --text-max-width: 70ch;

  /* Dimensi Layout */
  --menu-width: 280px;
  --menu-width-md: 250px;
  --menu-width-sm: 220px;
  --menu-width-xs: 200px;
  --header-height: 60px;
}

/* ==================================================
   RESET & BASE STYLES
   ================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--base-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: var(--base-line-height);
  color: var(--text-color);
  background-color: var(--light-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: margin-left 0.4s ease;
  position: relative;
}

body.menu-open {
  margin-left: var(--menu-width);
  overflow-x: hidden;
}

p, ul, ol, dl, blockquote {
  margin-bottom: var(--paragraph-margin-bottom);
  line-height: inherit;
}
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.5em; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: var(--heading-margin-top);
  margin-bottom: var(--heading-margin-bottom); /* Default jarak bawah */
  color: var(--primary-hover-color);
}
h1 { font-size: 2.5rem; margin-top: 0; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--primary-hover-color); }

img { max-width: 100%; height: auto; display: block; }

/* ==================================================
   AKSESIBILITAS: Gaya Fokus yang Terlihat Jelas
   ================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  /* Menggunakan Box-shadow agar bisa mengikuti border-radius elemen */
  outline: none; /* Hapus outline default browser */
  box-shadow: 0 0 0 3px var(--light-color), 0 0 0 5px var(--primary-color);
  transition: box-shadow 0.1s ease;
}

/* ==================================================
   PENYESUAIAN SPESIFIK (SESUAIKAN!)
   ================================================== */

/* Contoh 1: Menambah jarak di bawah judul H1 utama halaman (jika perlu & jika berbeda dari contoh 2) */
/* Ganti 'h1.main-page-title' dengan selector yang tepat & sesuaikan nilai margin jika ini judul yang berbeda */
/*
h1.main-page-title {
    margin-bottom: 1.8rem; /* Nilai lebih besar dari default 1.1rem */
/* }
*/

/* Contoh 2: Menambah jarak di bawah judul spesifik seperti "Belajar Dasar Kripto" */
/* !! PENTING: Ganti '.judul-belajar-kripto' dengan selector CSS
      yang TEPAT untuk judul tersebut di HTML Anda (gunakan Inspect Element). */
.judul-belajar-kripto { /* <-- !! GANTI SELECTOR INI SESUAI HTML ANDA !! */
    margin-bottom: 2rem; /* CONTOH NILAI: Sesuaikan agar ruang cukup (lebih besar dari 1.1rem) */
}

/* ==================================================
   LAYOUT CONTAINER
   ================================================== */
.container {
  max-width: var(--container-max-width);
  margin-left: auto; margin-right: auto;
  padding-left: 15px; padding-right: 15px;
}
.content-wrapper { padding-top: var(--header-height); }
main#main-content { /* Style spesifik jika perlu */ }
.text-content-container { /* Untuk membatasi lebar teks panjang */
  max-width: var(--text-max-width);
  margin-left: auto; margin-right: auto;
}

/* ==================================================
   HEADER
   ================================================== */
header.new-header {
  background-color: var(--light-color); padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: left 0.4s ease, right 0.4s ease;
}
body.menu-open header.new-header { left: var(--menu-width); right: calc(-1 * var(--menu-width)); }
.header-container {
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--container-max-width); margin-left: auto; margin-right: auto;
  padding-left: 15px; padding-right: 15px;
}
.menu-btn {
  background: none; border: none; color: var(--primary-color);
  font-size: 3.1rem; font-weight: 700; cursor: pointer; padding: 5px;
  display: flex; align-items: center; z-index: 1002;
  position: fixed; top: 0.6rem; left: 15px;
}
.menu-btn i { font-size: 1.4rem; margin-right: 8px; transition: transform 0.3s ease; }
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: inline-block; }
.menu-btn span { margin-left: 5px; font-size: 1rem; }
.logo {
  color: var(--primary-color); font-size: 1.6rem; font-weight: 700;
  text-decoration: none; display: flex; align-items: center;
  margin: 0 auto; position: relative; left: 0;
}
.logo i { margin-right: 10px; font-size: 1.3rem; }

/* ==================================================
   MAIN MENU (SIDEBAR)
   ================================================== */
.main-menu {
  position: fixed; top: 0; left: calc(-1 * var(--menu-width));
  width: var(--menu-width); height: 100%; background-color: var(--menu-bg);
  padding: 5rem 1.5rem 2rem 1.5rem; box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 1001; overflow-y: auto; transition: left 0.4s ease;
}
.main-menu.is-open { left: 0; }
.main-menu ul { list-style: none; padding: 0; margin-bottom: 0; }
.main-menu ul li { margin-bottom: 0.5rem; }
.main-menu ul li a {
  display: flex; align-items: center; color: var(--menu-text-color);
  padding: 12px 15px; font-size: 1.1rem; font-weight: 700; border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.main-menu ul li a i { margin-right: 12px; width: 20px; text-align: center; }
.main-menu ul li a:hover, .main-menu ul li a:focus {
  background-color: var(--menu-text-hover-bg);
  color: var(--menu-text-hover-color);
}
.main-menu ul li a.menu-active {
  background-color: var(--menu-active-bg); color: var(--menu-active-color);
}

/* ==================================================
   CONTENT SECTIONS & PAGE SWITCHING
   ================================================== */
.content-page { display: none; opacity: 0; animation: fadeInPage 0.6s ease forwards; }
.content-page.page-active { display: block; }
@keyframes fadeInPage { from { opacity: 0; } to { opacity: 1; } }
.content-section { padding: 3rem 0; }
.section-title { text-align: center; font-size: 2rem; color: var(--primary-color); } /* Margin diatur oleh base heading */
.section-title i { margin-right: 10px; font-size: 0.9em; }
.bg-light { background-color: var(--light-bg); }

/* ==================================================
   COMPONENTS (Hero, Buttons, Subsections, Table, etc.)
   ================================================== */
/* --- Hero Section --- */
.hero { text-align: center; padding: 4rem 0; background-color: #e7f1ff; overflow: hidden; }
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-content h2 { color: var(--primary-hover-color); }
.hero-content h2 i { margin-right: 10px; color: var(--warning-color); }
.hero-content p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.5rem; color: var(--menu-text-hover-bg); }
.hero-content p strong { color: var(--primary-hover-color); }
.hero-bullets { list-style: none; padding-left: 0; text-align: left; max-width: 600px; margin: 1.5rem auto 2rem auto; }
.hero-bullets li { margin-bottom: 0.8rem; padding-left: 1.8em; position: relative; font-size: 1rem; }
.hero-bullets li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--success-color); position: absolute; left: 0; top: 2px; width: 1.3em; text-align: center; }

/* --- Buttons --- */
.btn { display: inline-block; background-color: var(--primary-color); color: var(--light-color); padding: 12px 25px; border: none; border-radius: 5px; text-decoration: none; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2); text-align: center; vertical-align: middle; line-height: 1.5; }
.btn:hover { background-color: var(--primary-hover-color); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3); color: var(--light-color); }
.btn-secondary { background-color: var(--text-muted); box-shadow: 0 2px 5px rgba(108, 117, 125, 0.2); margin: 5px; }
.btn-secondary:hover { background-color: var(--menu-text-hover-bg); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(108, 117, 125, 0.3); color: var(--light-color); }
.btn i { margin-right: 8px; vertical-align: middle; }
.btn .btn-icon-right { margin-right: 0; margin-left: 8px; }
.btn.btn-hero { padding: 15px 35px; font-size: 1.1rem; }

/* --- Learn Subsections & Content Blocks --- */
.learn-subsection { background-color: var(--light-color); padding: 2rem; margin-bottom: 2rem; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); }
.learn-subsection:last-child { margin-bottom: 0; }
.learn-subsection h3 { border-bottom: 2px solid #e7f1ff; padding-bottom: 0.8rem; display: flex; align-items: center; }
.learn-subsection h3 i { margin-right: 10px; font-size: 0.9em;}
.learn-subsection h3 .icon-pair { margin-left: 5px; }
.learn-subsection h4 { color: var(--primary-color); display: flex; align-items: center; }
.learn-subsection h4 i { margin-right: 8px; font-size: 0.95em; }
.learn-subsection p, .learn-subsection ul, .learn-subsection ol { color: var(--menu-text-hover-bg); }
/* Reset list style dan padding jika menggunakan .icon-list atau .icon-list-ol */
.learn-subsection ul.icon-list, .learn-subsection ol.icon-list-ol,
.learn-subsection ul:not([class]), .learn-subsection ol:not([class]) {
   /* Style default untuk list di dalam .learn-subsection jika tidak pakai icon list */
   /* Anda bisa atur padding-left atau list-style-type di sini jika perlu */
   /* padding-left: 1.5em; */
}
.icon-list, .icon-list-ol { list-style: none; padding-left: 0 !important; /* Pastikan override padding */ }
.icon-list li, .icon-list-ol li { margin-bottom: 0.9rem; padding-left: 2.2em !important; /* Pastikan override padding */ position: relative; }
.icon-list li .list-icon, .icon-list-ol li .list-icon { position: absolute; left: 0; top: 0.15em; width: 1.5em; text-align: center; color: var(--primary-color); font-size: 1rem; }
.placeholder-text { font-style: italic; color: #888; border-left: 3px solid #ddd; padding-left: 1rem; margin-top: 1rem; background-color: #fdfdfd; margin-bottom: var(--paragraph-margin-bottom); }
.exchange-recommendation { border: 1px solid #e0e0e0; padding: 1.5rem; margin-top: 2rem; margin-bottom: 1.5rem; border-radius: 8px; background-color: var(--light-bg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.exchange-recommendation > div:first-child { flex-grow: 1; margin-right: 1.5rem; }
.exchange-recommendation h5 { color: var(--text-color); display: flex; align-items: center; }
.exchange-recommendation p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.exchange-recommendation .btn { flex-shrink: 0; margin-top: 10px; }
.disclaimer { font-size: 0.9rem; color: var(--text-muted); margin-top: 2.5rem; border-top: 1px solid #eee; padding-top: 1.5rem; text-align: center; }
.disclaimer i { margin-right: 5px; }

/* --- Glossary List --- */
.glossary-list { max-width: var(--text-max-width); margin: 0 auto; }
.glossary-list dt { font-weight: 700; color: var(--primary-hover-color); font-size: 1.1rem; margin-top: 1.8rem; padding-bottom: 0.3rem; }
.glossary-list dt:first-child { margin-top: 0; }
.glossary-list dd { margin-left: 0; margin-bottom: 1rem; padding-left: 1.5rem; border-left: 3px solid #e7f1ff; color: var(--menu-text-hover-bg); font-size: 0.95rem; }

/* --- Market Data Table --- */
.market-table-container { overflow-x: auto; margin-top: 2rem; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); }
#market-table { width: 100%; border-collapse: collapse; min-width: 700px; background-color: var(--light-color); }
#market-table th, #market-table td { padding: 15px; border: none; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; font-size: 0.95rem; }
#market-table thead tr { border-bottom: 2px solid var(--primary-color); }
#market-table th { background-color: var(--light-bg); color: var(--text-muted); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
#market-table tbody tr:last-child td { border-bottom: none; }
#market-table tbody tr:hover { background-color: #eef6ff; }
#market-table td:nth-child(1), #market-table th:nth-child(1) { text-align: center; width: 50px; font-weight: 700; color: var(--text-muted); }
#market-table td:nth-child(3), #market-table td:nth-child(6), #market-table th:nth-child(3), #market-table th:nth-child(6) { text-align: right; white-space: nowrap; }
#market-table td.price { font-weight: 700; color: var(--text-color); }
#market-table td:nth-child(4), #market-table th:nth-child(4) { text-align: center; white-space: nowrap; width: 130px; }
#market-table td:nth-child(5), #market-table th:nth-child(5) { width: 120px; text-align: center; padding-top: 10px; padding-bottom: 10px; }
#market-table .coin-name { display: flex; align-items: center; text-align: left; white-space: nowrap;}
#market-table .coin-logo { width: 28px; height: 28px; margin-right: 12px;}
#market-table .coin-main-name { font-weight: 700; color: var(--text-color);}
#market-table .coin-symbol { color: var(--text-muted); margin-left: 6px; font-size: 0.9em;}
#market-table td:nth-child(4) { font-weight: 700; text-align: center; }
#market-table td span.change-value { display: inline-block; padding: 5px 10px; border-radius: 4px; color: var(--light-color); min-width: 70px; text-align: center; font-size: 0.9rem;}
#market-table td.positive-change span.change-value { background-color: var(--success-color); }
#market-table td.negative-change span.change-value { background-color: var(--danger-color); }
#market-table td.neutral-change span.change-value { background-color: var(--text-muted); }
.loading-cell, .error-cell { text-align: center !important; padding: 30px 15px !important; color: var(--text-muted); font-style: italic; background-color: var(--light-color) !important; }
.loading-cell i, .error-cell i { margin-right: 8px; }
.error-cell { color: var(--danger-color) !important; font-weight: bold; font-style: normal; }
.data-provider { font-size: 0.8rem; text-align: center; margin-top: 1.5rem; color: var(--text-muted); }
.data-provider a { color: var(--primary-color); }
.data-provider a:hover { text-decoration: underline; }
.sparkline-cell { vertical-align: middle; }
.sparkline-chart { display: inline-block; }

/* --- Tentang Section (ID Specific) --- */
#tentang p { max-width: var(--text-max-width); margin-left: auto; margin-right: auto; text-align: center; font-size: 1.1rem; color: var(--menu-text-hover-bg); }
#tentang p:last-of-type { margin-top: 1.5rem; }

/* ==================================================
   FOOTER
   ================================================== */
footer { background-color: var(--dark-color); color: var(--menu-text-color); text-align: center; padding: 2.5rem 0; margin-top: 4rem; }
footer p { margin-bottom: 0.5rem; }
.footer-contact { margin-top: 10px; font-size: 0.95rem; }
.footer-contact a { color: #a7d1ff; transition: color 0.3s ease; }
.footer-contact a:hover { color: var(--light-color); text-decoration: underline; }

/* ==================================================
   RESPONSIVE MEDIA QUERIES
   ================================================== */
@media (max-width: 1199.98px) { :root { --container-max-width: 960px; } }
@media (max-width: 991.98px) {
  :root { --container-max-width: 720px; --base-font-size: 15.5px; }
  body.menu-open { margin-left: var(--menu-width-md); }
  body.menu-open header.new-header { left: var(--menu-width-md); right: calc(-1 * var(--menu-width-md)); }
  .main-menu { width: var(--menu-width-md); left: calc(-1 * var(--menu-width-md)); }
  h1 { font-size: 2.3rem; } h2 { font-size: 1.9rem; }
  .exchange-recommendation { justify-content: flex-start; }
  .exchange-recommendation > div:first-child { margin-right: 0; margin-bottom: 1rem; flex-basis: 100%; }
  .exchange-recommendation .btn { width: auto; }
}
@media (max-width: 767.98px) {
  :root { --container-max-width: 540px; --base-font-size: 15px; --paragraph-margin-bottom: 1.1rem; --heading-margin-top: 2rem; --heading-margin-bottom: 1rem; }
  .logo { margin-right: auto; margin-left: 60px; }
  .hero { padding: 3rem 0; } h1 { font-size: 2rem; } h2 { font-size: 1.7rem; }
  .content-section { padding: 2.5rem 0; } .learn-subsection { padding: 1.5rem; }
  .glossary-list, .text-content-container { max-width: 100%; }
  body.menu-open { margin-left: var(--menu-width-sm); }
  header.new-header { padding: 0.6rem 0;}
  body.menu-open header.new-header { left: var(--menu-width-sm); right: calc(-1 * var(--menu-width-sm)); }
  .main-menu { width: var(--menu-width-sm); left: calc(-1 * var(--menu-width-sm)); padding-top: 4.5rem;}
  .menu-btn { top: 0.4rem; left: 10px;}
  #market-table th:nth-child(5), #market-table td:nth-child(5) { display: none; }
}
@media (max-width: 575.98px) {
  :root { --container-max-width: 100%; --base-font-size: 14px; --paragraph-margin-bottom: 1rem; }
  .container { padding-left: 10px; padding-right: 10px; }
  .logo { font-size: 1.3rem; margin-left: 50px;} .logo i { font-size: 1.1rem; }
  .menu-btn span { display: none; } .menu-btn i { margin-right: 0; }
  body.menu-open { margin-left: var(--menu-width-xs); }
  body.menu-open header.new-header { left: var(--menu-width-xs); right: calc(-1 * var(--menu-width-xs)); }
  .main-menu { width: var(--menu-width-xs); left: calc(-1 * var(--menu-width-xs)); }
  h1 { font-size: 1.8rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.15rem; }
  .hero-content p { font-size: 0.95rem; }
  .hero-bullets { margin: 1rem auto 1.5rem auto; } .hero-bullets li { font-size: 0.9rem; padding-left: 1.8em;}
  .btn { padding: 10px 15px; font-size: 0.85rem;} .btn.btn-hero { padding: 12px 20px; font-size: 0.95rem;}
  .exchange-recommendation { flex-direction: column; align-items: stretch; }
  .exchange-recommendation > div:first-child { margin-right: 0; margin-bottom: 1rem; }
  .exchange-recommendation .btn { width: 100%; margin-top: 0.5rem; }
  #market-table { min-width: auto; }
  #market-table th, #market-table td { padding: 8px 6px; font-size: 0.8rem;}
  #market-table td:nth-child(4) { width: auto; }
  #market-table td span.change-value { padding: 3px 5px; font-size: 0.75rem; min-width: 55px; }
  #market-table .coin-logo { width: 18px; height: 18px; margin-right: 6px;}
  #market-table th:nth-child(6), #market-table td:nth-child(6),
  #market-table th:nth-child(5), #market-table td:nth-child(5) { display: none; }
  #market-table td:nth-child(3), #market-table th:nth-child(3) { text-align: left; }
}
/* Style untuk sub-menu */
.sub-menu {
    display: none; /* Sembunyikan secara default */
    background-color: #f8f9fa; /* Warna latar belakang sub-menu */
    padding: 10px 15px;
    margin-top: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-direction: column; /* Atur item sub-menu menjadi kolom */
    gap: 8px; /* Jarak antar item sub-menu */
}

.main-menu.is-open + .sub-menu {
    display: flex; /* Tampilkan sub-menu ketika main-menu memiliki kelas 'is-open' */
}

.sub-menu a {
    display: block; /* Membuat setiap link menjadi blok agar mudah diklik */
    color: #495057; /* Warna teks sub-menu */
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.sub-menu a:hover {
    background-color: #e9ecef; /* Efek hover pada item sub-menu */
}

/* Tambahkan sedikit margin ke bawah menu utama saat terbuka */
.main-menu.is-open {
    margin-bottom: 10px; /* Sesuaikan sesuai kebutuhan */
}
