  /* Materials Sidebar */
  .materials {
    grid-area: materials;
    background: linear-gradient(180deg, #e3f2fd, #bbdefb);
    border-right: 0.1875rem solid #2196f3; 
    padding: 1.25rem; 
    overflow-y: auto; 
    max-height: 100vh; 
    font-size: 0.875rem; 
    line-height: 1.5;
    display: none; 
    position: fixed; 
    top: 0;
    left: -100%; 
    width: 80%; 
    max-width: 500px; 
    height: 100%;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    box-shadow: 0.25rem 0 1rem rgba(0,0,0,0.2);
	overflow-y: auto !important;
    scroll-behavior: smooth !important; 
    scrollbar-width: thin; 
  }

  .materialsmaterials.open {
    left: 0; 
    display: block; 
  }

  .materials-title {
    background: linear-gradient(135deg, #2196f3, #42a5f5);;
    padding: 0.75rem;
    font-weight: bold;
    font-size: 1rem; 
    color: white;
    text-align: center;
    border-radius: 0.5rem;
    margin-bottom: 1rem; 
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1); 
  }

  .material-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem; 
    background: rgba(255,255,255,0.7);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 0.25rem solid transparent;
    position: relative;
  }

  .material-item:hover {
    background: rgba(255,255,255,0.9);
    border-left-color: #2196f3;
    transform: translateX(0.25rem); 
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1); 
  }

  .material-item.active {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left-color: #4caf50;
    font-weight: bold;
  }

  .material-subtitle {
    margin-left: 1rem; 
    margin-top: 0.5rem; 
    font-size: 0.8125rem; 
    font-style: italic;
  }

  /* Page Content */
  .page {
    grid-area: page;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    padding: 1.25rem; /
    overflow-y: auto;
    position: relative;
    min-height: 30rem; 
    overflow-y: scroll !important; 
	max-height: 100vh !important;  
    height: auto !important;
	scroll-behavior: smooth;
  }
 .page-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1); 
    min-height: 38rem; 
    width: 95% !important;
	max-width: 100%; 
	max-width: none !important;  
    margin: 0 auto; /* Center content */
  }
  .page-content h2 {
    color: #1a73e8;
    font-size: 1.25rem;
    border: 1px solid #94c5ec;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    background: #e6f4ff;
  }
  .page-content h3 {
    color: #388e3c;
    font-size: 1.125rem;
    margin: 0.5rem 0;
	padding-top: 4px;
  }
  .page-content p {
    color: #424242;
    line-height: 1.5;
    text-align: justify;
    margin: 0.5rem 0;
  }
  .page-content ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem; 
  }
  .page-content li {
    margin-bottom: 0.5rem;
    color: #555;
  }

  .references {
    background: #f8f9fa;
    border-left: 0.25rem solid #2196f3; 
    padding: 1rem; 
    margin-top: 1.875rem;
    border-radius: 0 0.5rem 0.5rem 0;
  }
  .references h4 {
    color: #1976d2;
    margin-bottom: 0.75rem; 
  }
  .references ol {
    margin-left: 1.25rem; 
    font-size: 0.8125rem; 
    color: #666;
  }

/* Revisi: Style untuk pemisahan section di sidebar */
.materials-section,
.tools-section {
  margin-bottom: 1.5rem; 
  padding-bottom: 1rem;
  border-bottom: 0.125rem solid #ddd; 
}

.materials-section .materials-title,
.tools-section .tools-title {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: white;
  padding: 0.75rem;  
  height: 2.5rem;    
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
  display: flex;           
  align-items: center;     
  justify-content: center;
}

.tools-section .tools-title {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: white;
  padding: 0.75rem;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
}

/* Tools section: Non-editable, no dashed border di admin mode */
body.admin-active .tools-section .material-item {
  border: none !important; 
}

body.admin-active .tools-section .material-item:hover {
  background: rgba(255,255,255,0.9); 
}

/* Responsif: Section tetap stack di mobile */
@media (max-width: 768px) {
  .materials-section,
  .tools-section {
    border-bottom: 0.0625rem solid #ddd; 
    margin-bottom: 1rem;
  }
}

/* Revisi: Style untuk pemisahan section di sidebar */
.materials-section,
.tools-section {
  margin-bottom: 1.5rem; 
  padding-bottom: 1rem;
  border-bottom: 0.125rem solid #ddd; 
}

.materials-section .materials-title,
.tools-section .tools-title {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: white;
  padding: 0.75rem; 
  height: 2.5rem;    
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
  display: flex;           
  align-items: center;     
  justify-content: center;
}

.tools-section .tools-title {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: white;
  padding: 0.75rem;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.1);
}


  /* Small Phones (up to 480px) */
  @media (max-width: 480px) {
    body {
      font-size: 14px; 
    }

    .header h1 {
      font-size: 1.25rem; 
	  text-align: center
	  
    }

    .header p {
      font-size: 0.8rem; 
	  text-align: center
    }

    .profile {
      padding: 0.75rem;
    }

    .author-photo {
      width: 4rem;
      height: 4rem;
      font-size: 0.65rem;
    }

    .profile-upload-btn {
      font-size: 0.65rem;
      padding: 0.25rem 0.5rem;
    }

    .materials {
      width: 90%; 
      max-width: 280px;
      padding: 1rem;
    }

    .materials-title {
      font-size: 0.9rem;
      padding: 0.6rem;
    }

    .material-item {
      padding: 0.6rem;
      font-size: 0.8rem;
    }

    .material-subtitle {
      font-size: 0.7rem;
      margin-left: 0.75rem;
    }

    .page {
      padding: 1rem;
    }

    .page-content {
      padding: 1rem;
      border-radius: 0.5rem;
    }

    .page-content h2 {
      font-size: 1.1rem;
    }

    .page-content h3 {
      font-size: 1rem;
    }

    .footer {
      padding: 1rem;
      font-size: 0.75rem;
      text-align: center; 
    }

    .footer-left {
      margin-bottom: 0.25rem;
      align-items: center; 
    }

    .footer-item {
      gap: 0.25rem;
    }

  .help-faq-btn {
    position: fixed;
    bottom: 2.15rem;
    right: 1.15rem;
    background: linear-gradient(135deg, #9735e2, #2c0bc7);
    color: white;
    width: 2.75rem;
    height: 2.6rem;
    border-radius: 1.1rem 1.3rem 1.2rem 0;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0.375rem 1.25rem rgba(63,81,181,0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  
  .help-faq-btn svg {
      width: 1.2rem;
      height: 1.2rem;
    }
  .help-faq-content{
    width: 95%;
    max-width: 335px;
  }
    .chatbot-input input {
      padding: 0.4rem 0.6rem;
      font-size: 0.75rem;
    }

    .chatbot-input button {
      padding: 0.4rem 0.7rem;
      font-size: 0.75rem;
    }

    .admin-mode-toggle {
      bottom: 0.3rem;
      right: 0.3rem;
      font-size: 0.6rem;
      padding: 0.15rem 0.4rem;
    }

    .admin-login-section {
      bottom: 2rem;
      right: 0.3rem;
      max-width: 12rem;
      padding: 0.4rem;
    }

    .admin-login-section label,
    .admin-login-section input[type="password"],
    .admin-login-section button {
      font-size: 0.7rem;
      padding: 0.3rem;
    }

    .chart-container {
      width: 95%;
      height: 300px;
    }
  }

  /* Medium Phones to Small Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "profile"
      "header"
      "page"
      "footer";
    font-size: 15px; 
  }

  .sidebar-toggle-btn {
    display: flex; 
  }

  .materials {
    display: block; 
    max-height: 100vh;
    width: 70%; 
    max-width: 350px; 
  }
  .resizer {
    display: none;
  }

  .header h1 {
    font-size: 1.75rem;
    text-align: center;
  }

  .header p {
    font-size: 1rem; 
    text-align: center;
  }

  .page-content {
    padding: 1.5rem; 
  }

  .footer {
    flex-direction: row; 
    justify-content: space-between;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    text-align: center;
  }

  .footer-left {
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 0;
    align-items: center;
  }

    .help-faq-btn {
      bottom: 1.875rem; 
      right: 1.875rem; 
      width: 3rem; 
      height: 2.5rem;
      font-size: 1.5rem; 
    }

  .help-faq-btn svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  .help-faq-content {
    font-size: 12px;
    line-height: 1.3;
    max-width: 30rem; 
  }

  /* Admin toggle and login section adjustments */
  .admin-mode-toggle {
    bottom: 0.5rem;
    right: 0.5rem;
  }
  .admin-login-section {
    bottom: 0.5rem;
    right: 1.5rem;
    max-width: 15rem;
  }

  .chart-container {
    width: 90%;
    height: 350px;
  }

  /* Toolbar analisis di atas tabel: tombol lebih kecil & rapi */
  .data-analysis-toolbar {
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0.75rem 0.75rem;
  }

  .data-analysis-toolbar .toolbar-main {
    justify-content: center;    
    gap: 0.4rem;                
  }

  .data-analysis-toolbar .toolbar-btn {
    font-size: 0.8rem;          
    padding: 0.4rem 0.8rem;
    border-radius: 0.35rem;
    min-width: auto;
  }

  .toolbar-submenu-dropdown .toolbar-sub-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.8rem;
  }

  /* Toolbar Data (Add Row, Delete Row, dst.) lebih kompak */
  .data-analysis-content .data-toolbar {
    gap: 0.3rem;
    padding: 0.4rem 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .data-analysis-content .data-toolbar button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    min-width: auto;
  }

  /* Teks di bawah "Input Data" diperkecil & dipadatkan */
  #inputDataBlock h2 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }

  #inputDataBlock p {
    font-size: 0.85rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
  }
}

/* Tablets to Laptops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
body {
  grid-template-columns: var(--sidebar-width) 0.5rem 1fr; 
  grid-template-rows: 7.5rem 1fr 3.75rem; 
  grid-template-areas:
	"profile header header"
	"materials resizer page"
	"footer footer footer";
  font-size: 16px; 
}

.sidebar-toggle-btn {
  display: none; 
}

@media (min-width: 769px) {
  .materials {
    position: relative;
    left: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: calc(100vh - 7.5rem - 3.75rem);
    max-height: 100vh !important;
    box-shadow: none;
  }
  .materials.open {
    left: 0; 
  }
}

.resizer {
  display: block; 
}

.profile {
  padding: 1rem;
}

.author-photo {
  width: 4rem;
  height: 4rem;
}

.header {
  padding: 1.5rem; 
}

.header h1 {
  font-size: 22px;
}

.header p {
  font-size: 1rem;
  margin: 0;	
}

.page {
  padding: 1.5rem;
}

.page-content {
  padding: 1.5rem;
}

.footer {
  flex-direction: row;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
}

.footer-left {
  flex-direction: row;
  gap: 1.5rem; 
  margin-bottom: 0;
}

.admin-mode-toggle {
  bottom: 0.5rem;
  right: 0.5rem;
}

.admin-login-section {
  bottom: 2.5rem;
  right: 0.5rem;
  max-width: 15rem;
}

.help-faq-btn {
  bottom: 1.875rem; 
  right: 1.875rem; 
  width: 3rem; 
  height: 2.5rem; 
  font-size: 1.5rem;
}

.help-faq-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

.help-faq-content {
  max-width: 37.5rem; 
}

.chart-container {
  width: 85%;
  height: 380px;
}
}

/* Large Laptops and Desktops (1025px and up) */
@media (min-width: 1025px) {
body {
  grid-template-columns: var(--sidebar-width) 0.5rem 1fr; 
  grid-template-rows: 7.5rem 1fr 3.75rem; 
  grid-template-areas:
	"profile header header"
	"materials resizer page"
	"footer footer footer";
  font-size: 16px;
}

.sidebar-toggle-btn {
  display: none;
}

.materials {
  display: block; 
  position: relative; 
  left: 0; 
  width: auto; 
  height: auto; 
  max-height: calc(108vh - 7.5rem - 3.75rem);
  max-height: 100vh !important;
  box-shadow: none; 
  overflow-x: hidden; 
  white-space: normal; 
  border-right: none; 
}

.resizer {
  display: block;
}

.header h1 {
  font-size: 1.75rem; 
  margin: 6px 24px;
}

.header p {
  font-size: 1rem; 
}

.page {
  padding: 1.875rem; 
}

.page-content {
  padding: 1.875rem; 
  max-width: 60rem;
}

.footer {
  flex-direction: row;
  justify-content: space-between;
  padding: 1.25rem 1.875rem; 
  font-size: 0.875rem;
}

.footer-left {
  flex-direction: row;
  gap: 1.875rem; 
  margin-bottom: 0;
}

.admin-mode-toggle {
  bottom: 0.5rem;
  right: 0.5rem;
}

.admin-login-section {
  bottom: 0.6rem;
  right: 1rem;
  max-width: 15rem;
}

.help-faq-btn {
  right: 3.75rem;
  bottom: 4.25rem;
  width: 3rem;
  height: 2.5rem;
  font-size: 1.5rem;
}

.chart-container {
  width: 80%;
  height: 400px;
}
}
 
/* Modal Tambah Materi */
.modal-overlay {
  display: none;             
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Form di dalam modal */
.form-group {
  margin-bottom: 10px;
}

.form-control {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-code {
  font-family: monospace;
}

/* Tombol di modal */
.modal-submit {
  margin-right: 10px;
}

.btn-danger {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* Area konten materi */
#pageContent ul,
#pageContent ol {
  padding-left: 1rem;           
  margin: 0 0 0.75rem 0;              
  list-style-position: outside;   
}

#pageContent li {
  margin: 0.25em 0px;               
  text-indent: 0 !important;      
  padding-left: 0;                
}

@media (max-width: 640px) {
  #pageContent ul,
  #pageContent ol {
    padding-left: 1rem;
  }
}

body {
  min-height: 100vh;    
  height: auto !important; 
  overflow-y: auto !important;  
}
.material-section {
  padding-bottom: 40px !important;
  min-height: 40vh !important; 
  scroll-snap-align: start;
}
.materials::-webkit-scrollbar {
  width: 6px;
}
.materials::-webkit-scrollbar-track {
  background: rgba(33,150,243,0.1);
}
.materials::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2196f3, #42a5f5);
  border-radius: 3px;
}
