/* --- Variables & Clean Global Reset --- */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --accent: #34a853;
  --dark: #202124;
  --gray-dark: #4a4d51;
  --gray-medium: #70757a;
  --gray-light: #f8f9fa;
  --border: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-code: 'Fira Code', monospace;
}

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

html, body {
  width: 100%;
  overflow-x: hidden; /* Prevents unwanted horizontal scrolling */
}

body {
  font-family: var(--font-main);
  color: var(--dark);
  background-color: #fbfbfb;
  line-height: 1.65;
  padding-bottom: 100px; /* Clearance for Mobile Bottom Sticky Bar */
}

@media (min-width: 901px) {
  body {
    padding-bottom: 0; /* Remove clearance on desktop */
  }
}

/* --- Container with Standardized Padding --- */
.container { 
  width: 100%;
  max-width: 1240px; 
  margin: 0 auto; 
  padding: 0 20px; 
}

/* Policy Pages Layout */
.policy-container {
  max-width: 850px;
  margin: 40px auto;
  background: #ffffff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.policy-container h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.policy-container h2 {
  font-size: 1.3rem;
  margin: 24px 0 10px;
  color: var(--dark);
}

.policy-container p {
  color: var(--gray-dark);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* --- Navbar --- */
.navbar { 
  position: sticky; 
  top: 0; 
  background: #ffffff; 
  border-bottom: 1px solid var(--border); 
  z-index: 1000; 
  box-shadow: var(--shadow-sm);
}

.nav-container { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  height: 72px; 
}

.brand-logo { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  font-weight: 700; 
  font-size: 1.4rem; 
  color: var(--dark); 
  text-decoration: none; 
}

.cloud-icon { 
  color: var(--primary); 
  font-size: 1.9rem; 
}

.nav-links { 
  display: flex; 
  list-style: none; 
  gap: 28px; 
  align-items: center; 
}

.nav-links a { 
  text-decoration: none; 
  color: var(--gray-dark); 
  font-weight: 500; 
  font-size: 0.95rem; 
  transition: color 0.2s;
}

.nav-links a.active, .nav-links a:hover { 
  color: var(--primary); 
}

.yt-btn { 
  background: #ff0000; 
  color: #fff !important; 
  padding: 9px 18px; 
  border-radius: 20px; 
  font-size: 0.9rem;
  font-weight: 600 !important;
}

.hamburger { 
  display: none; 
  font-size: 1.5rem; 
  cursor: pointer; 
}

/* --- Hero & Headers --- */
.hero { 
  background: linear-gradient(135deg, #e8f0fe 0%, #ffffff 100%); 
  padding: 60px 0; 
  text-align: center; 
}

.hero h1 { 
  font-size: 2.8rem; 
  margin: 20px 0 16px; 
  line-height: 1.25;
}

.hero h1 span { 
  color: var(--primary); 
}

.hero p { 
  color: var(--gray-dark); 
  max-width: 680px; 
  margin: 0 auto 32px; 
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge { 
  background: var(--primary-light); 
  color: var(--primary); 
  padding: 8px 18px; 
  border-radius: 20px; 
  font-weight: 600; 
  font-size: 0.88rem; 
  border: 1px solid #aecbfa;
}

.section {
  padding: 40px 0;
}

.section-title {
  text-align: left;
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--dark);
}

.section-title p {
  color: var(--gray-medium);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* --- Banner Box --- */
.banner-box {
  background: var(--primary-light);
  border: 1px solid #aecbfa;
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.banner-text h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.banner-text p {
  color: var(--gray-dark);
  font-size: 1rem;
}

/* --- Cards & Grid Layout --- */
.cards-grid, .notes-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 24px; 
  margin-bottom: 20px;
}

.course-card, .note-card { 
  background: #ffffff; 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 32px 28px; 
  box-shadow: var(--shadow); 
  position: relative; 
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover, .note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.course-card.featured, .note-card.featured { 
  border: 2px solid var(--primary); 
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-icon { 
  font-size: 2.2rem; 
  color: var(--primary); 
}

.card-tag { 
  display: inline-block; 
  padding: 6px 12px; 
  border-radius: 20px; 
  font-size: 0.8rem; 
  font-weight: 600; 
  width: fit-content;
}

.free { background: #e6f4ea; color: #137333; }
.active-tag { background: #fef7e0; color: #b06000; }
.upcoming { background: #f1f3f4; color: #5f6368; }

.card-content h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--dark);
}

.card-content p {
  color: var(--gray-dark);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.card-features { 
  list-style: none; 
  margin-bottom: 28px; 
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-features li { 
  font-size: 0.95rem; 
  color: var(--gray-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-features li i { 
  color: var(--accent); 
  font-size: 0.9rem;
}

.price-tag {
  margin: 18px 0 20px 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-tag .currency {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.price-tag .amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

/* Buttons */
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 10px; 
  padding: 12px 22px; 
  border-radius: 8px; 
  font-weight: 600; 
  font-size: 0.95rem;
  text-decoration: none; 
  border: none; 
  cursor: pointer; 
  transition: all 0.2s; 
}

.btn-primary { 
  background: var(--primary); 
  color: #ffffff; 
}

.btn-primary:hover { 
  background: var(--primary-dark); 
}

.btn-secondary { 
  background: #ffffff; 
  color: var(--dark); 
  border: 1px solid var(--border); 
}

.btn-secondary:hover {
  background: var(--gray-light);
}

.btn-download { 
  background: #e6f4ea; 
  color: #137333; 
  font-size: 0.9rem; 
}

.btn-download:hover { 
  background: #ceebd6; 
}

.btn-purchase {
  background: var(--dark);
  color: #ffffff;
}

.btn-purchase:hover {
  background: #333;
}

.btn-purchase-featured {
  background: var(--primary);
  color: #ffffff;
}

.btn-purchase-featured:hover {
  background: var(--primary-dark);
}

.btn-disabled { 
  background: #e0e0e0; 
  color: #757575; 
  cursor: not-allowed; 
}

.btn-block { 
  width: 100%; 
  margin-top: auto; 
}

/* --- Level Pages Video & Layout --- */
.page-header { 
  padding: 30px 20px 20px 20px; 
}

.page-header h1 { 
  margin-top: 12px; 
  font-size: 2.4rem; 
}

.page-header p {
  color: var(--gray-dark);
  font-size: 1.05rem;
  margin-top: 8px;
}

.course-layout { 
  display: grid; 
  grid-template-columns: 2.3fr 1fr; 
  gap: 30px; 
  padding-bottom: 60px; 
}

.video-container { 
  position: relative; 
  padding-top: 56.25%; 
  background: #000; 
  border-radius: var(--radius); 
  overflow: hidden; 
  box-shadow: var(--shadow); 
}

.video-container iframe { 
  position: absolute; 
  top:0; 
  left:0; 
  width:100%; 
  height:100%; 
  border:none; 
}

.video-details-box { 
  background: #ffffff; 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 28px; 
  margin-top: 24px; 
  box-shadow: var(--shadow); 
}

.details-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap; 
  gap: 16px; 
  border-bottom: 1px solid var(--border); 
  padding-bottom: 18px; 
  margin-bottom: 24px; 
}

.content-block { 
  margin-bottom: 28px; 
}

.content-block h3 { 
  font-size: 1.15rem; 
  margin-bottom: 12px; 
  color: var(--dark); 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

.content-block p {
  color: var(--gray-dark);
  font-size: 1rem;
  line-height: 1.7;
}

/* Commands Box */
.command-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 12px; 
}

.btn-copy { 
  background: #f1f3f4; 
  border: 1px solid var(--border); 
  padding: 6px 14px; 
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 0.85rem; 
  font-weight: 600; 
}

.btn-copy:hover { 
  background: #e8eaed; 
}

.code-box { 
  background: #1e1e1e; 
  color: #00ff66; 
  padding: 20px; 
  border-radius: 8px; 
  font-family: var(--font-code); 
  font-size: 0.9rem; 
  overflow-x: auto; 
  white-space: pre-wrap; 
  line-height: 1.6;
}

/* --- Compact Scrollable Sidebar Playlist --- */
.playlist-sidebar { 
  background: #ffffff; 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 20px; 
  height: 600px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow); 
  position: sticky;
  top: 90px;
}

.playlist-sidebar h3 { 
  font-size: 1.15rem; 
  margin-bottom: 14px; 
  border-bottom: 1px solid var(--border); 
  padding-bottom: 12px; 
  color: var(--dark);
  flex-shrink: 0;
}

.playlist-items { 
  list-style: none; 
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
  flex-grow: 1;
}

.playlist-items::-webkit-scrollbar {
  width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 4px;
}

.playlist-items::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.video-item { 
  padding: 12px 14px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 0.9rem; 
  transition: all 0.2s; 
  display: flex; 
  align-items: flex-start; 
  gap: 10px; 
  color: var(--gray-dark);
  background: #ffffff;
}

.video-item i {
  font-size: 1.1rem;
  margin-top: 2px;
  color: var(--gray-medium);
  flex-shrink: 0;
}

.video-item:hover { 
  background: var(--gray-light); 
  border-color: var(--primary); 
  color: var(--primary); 
}

.video-item.active { 
  background: var(--primary-light); 
  border-color: var(--primary); 
  color: var(--primary); 
  font-weight: 600;
}

.video-item.active i {
  color: var(--primary);
}

/* --- Google AdSense Container --- */
.ad-banner-container {
  width: 100%;
  margin: 20px 0;
  padding: 10px;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Main Desktop Footer --- */
.main-footer {
  background: #18191c;
  color: #e8eaed;
  padding: 60px 0 32px;
  margin-top: 60px;
  border-top: 1px solid #2d3135;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr 1.2fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand .brand-logo {
  color: #ffffff;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.footer-brand p {
  color: #9aa0a6;
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.6;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col ul a {
  color: #9aa0a6;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-col ul a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom-bar {
  border-top: 1px solid #2d3135;
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: #9aa0a6;
  font-size: 0.9rem;
}

/* --- Sticky Mobile Bottom Navigation Bar --- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
  z-index: 2000;
  padding: 8px 12px;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
}

.mobile-nav-items a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--gray-medium);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.mobile-nav-items a i {
  font-size: 1.25rem;
}

.mobile-nav-items a.active, .mobile-nav-items a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* --- Modal Overlay --- */
.modal-overlay { 
  position: fixed; 
  top:0; 
  left:0; 
  width:100%; 
  height:100%; 
  background: rgba(0,0,0,0.6); 
  display: none; 
  justify-content: center; 
  align-items: center; 
  z-index: 3000; 
  padding: 20px;
}

.modal-overlay.active { 
  display: flex; 
}

.modal-card { 
  background: #ffffff; 
  padding: 32px; 
  border-radius: var(--radius); 
  max-width: 480px; 
  width: 100%; 
  position: relative; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-close { 
  position: absolute; 
  top: 16px; 
  right: 20px; 
  border: none; 
  background: none; 
  font-size: 1.6rem; 
  cursor: pointer; 
  color: var(--gray-medium);
}

.form-group { 
  margin: 18px 0; 
}

.form-group label { 
  display: block; 
  font-weight: 600; 
  margin-bottom: 6px; 
  font-size: 0.95rem;
}

.form-group small { 
  display: block; 
  color: var(--gray-medium); 
  font-size: 0.82rem; 
  margin-bottom: 8px; 
}

.form-group input { 
  width: 100%; 
  padding: 12px 14px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  font-size: 0.95rem;
}

/* --- Mobile & Tablet Specific Responsive Styles --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .container {
    padding: 0 16px; /* Slightly tighter padding for small screens */
  }

  .hero {
    padding: 40px 0;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .course-layout { 
    grid-template-columns: 1fr; 
  }

  .playlist-sidebar {
    height: 450px; /* Reduced height on mobile */
    position: static;
  }
  
  .hamburger { 
    display: block; 
  } 
  
  .nav-links { 
    display: none; 
    flex-direction: column; 
    position: absolute; 
    top: 72px; 
    left: 0; 
    width: 100%; 
    background: #ffffff; 
    padding: 20px; 
    box-shadow: var(--shadow); 
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links.active { 
    display: flex; 
  }
  
  .mobile-bottom-bar {
    display: block; /* Activate bottom sticky nav bar on mobile */
  }

  .course-card, .note-card {
    padding: 24px 20px;
  }

  .policy-container {
    padding: 24px 20px;
    margin: 20px auto;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cards-grid, .notes-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .banner-box {
    padding: 24px 20px;
  }
}

/* --- Corrected Course Index Sidebar --- */
.playlist-sidebar { 
  background: #ffffff; 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 20px; 
  height: 580px;            /* Fixed height for the card */
  max-height: 80vh;
  display: flex;
  flex-direction: column;   /* Vertical layout structure */
  box-shadow: var(--shadow); 
  position: sticky;
  top: 90px;
  overflow: hidden;         /* STOPS items from escaping the card container */
}

.playlist-sidebar h3 { 
  font-size: 1.15rem; 
  margin-bottom: 14px; 
  border-bottom: 1px solid var(--border); 
  padding-bottom: 12px; 
  color: var(--dark);
  flex-shrink: 0;          /* Keeps header fixed at top */
}

/* Scrollable Video List Container */
.playlist-sidebar #l1Playlist,
.playlist-sidebar #l2Playlist {
  overflow-y: auto;        /* Adds smooth vertical scrollbar inside the card */
  flex-grow: 1;
  padding-right: 4px;
}

.playlist-items { 
  list-style: none; 
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Custom Scrollbar for Course Index */
.playlist-sidebar #l1Playlist::-webkit-scrollbar,
.playlist-sidebar #l2Playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist-sidebar #l1Playlist::-webkit-scrollbar-track,
.playlist-sidebar #l2Playlist::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 4px;
}

.playlist-sidebar #l1Playlist::-webkit-scrollbar-thumb,
.playlist-sidebar #l2Playlist::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.playlist-sidebar #l1Playlist::-webkit-scrollbar-thumb:hover,
.playlist-sidebar #l2Playlist::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Video Items inside Index */
.video-item { 
  padding: 12px 14px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 0.9rem; 
  transition: all 0.2s; 
  display: flex; 
  align-items: flex-start; 
  gap: 10px; 
  color: var(--gray-dark);
  background: #ffffff;
}

.video-item i {
  font-size: 1.1rem;
  margin-top: 2px;
  color: var(--gray-medium);
  flex-shrink: 0;
}

.video-item:hover { 
  background: var(--gray-light); 
  border-color: var(--primary); 
  color: var(--primary); 
}

.video-item.active { 
  background: var(--primary-light); 
  border-color: var(--primary); 
  color: var(--primary); 
  font-weight: 600;
}

.video-item.active i {
  color: var(--primary);
}

/* Mobile Sidebar Height */
@media (max-width: 900px) {
  .playlist-sidebar {
    height: 420px;
    position: static;
  }
}

price-tag .gst-text {
  font-size: 0.85rem;      /* Small font size */
  font-weight: 500;       /* Lighter text weight */
  color: var(--gray-medium); /* Secondary grey color (#70757a) */
  margin-left: 4px;
}

.brand-logo { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  font-weight: 700; 
  font-size: 1.4rem; 
  color: var(--dark); 
  text-decoration: none; 
}

/* Logo Image Sizing */
.logo-img {
  height: 50px;       /* Set a neat, fixed height matching navbar text */
  width: auto;        /* Preserves image aspect ratio */
  object-fit: contain;
}