/* Base Layout Setup */
body {
    box-sizing: border-box;
    font-family: 'Pyidaungsu', Arial, sans-serif;
    width: 100%;
    max-width: 440px;
    margin: 20px auto 0;
    min-height: calc(100vh - 20px);
    padding: 16px 16px 100px 16px;
    background-color: #ffffff;
    color: #1e293b;
    line-height: 1.5;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
}

.app-container {
    position: relative;
    min-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    overflow: hidden;
}

/* Background တစ်ခုလုံးကို မီးခိုးရောင်နု ပေးခြင်း (Desktop မှာ ကြည့်လျှင် App ပိုပေါ်လွင်စေသည်) */
html {
    background-color: #0f172a; /* Fallback Color */
    background-image: url('images/physics-bg.jpg'); /* သင့် Background Image လမ်းကြောင်း */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Scroll ဆွဲရင် Background ငြိမ်နေစေရန် */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
}

/* Global SVG Safety Fix (SVG ကြီး ထွက်မလာစေရန်) */
svg {
    max-width: 100%;
    height: auto;
}

/* Header UI */
.hero-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.greeting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.greeting-text { font-size: 12px; color: #94a3b8; }
.status-badge {
    font-size: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.hero-text h1 { font-size: 18px; margin: 0; font-weight: 700; color: #fff; }
.hero-text p { font-size: 12px; margin: 2px 0 0 0; color: #cbd5e1; }

/* Hero Icon Box - ပိုမိုကျယ်ဝန်းပြီး Glow Effect ထည့်ထားသည် */
.hero-icon-container {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* Atom SVG - လိုင်း အမျှင်လေးများကို သိမ်သိမ်မွေ့မွေ့ ပြုလုပ်ထားသည် */
.physics-atom-icon {
    width: 32px !important;
    height: 32px !important;
}

.physics-brand-logo {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 12px;
}

.atom-core {
    fill: #ef4444;
    filter: drop-shadow(0 0 4px #ef4444);
}

.atom-orbit {
    fill: none;
    stroke: #f87171;
    stroke-width: 1.2;
    opacity: 0.85;
}

/* 1. Category Section */
.category-section { margin-bottom: 24px; }
.category-section h3, .chapter-test-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}
.category-boxes { display: flex; gap: 8px; }

/* Grade Box Active/Hover Color Change */
.category-box {
    flex: 1;
    text-align: center;
    background-color: #ffffff;
    color: #334155;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-box:hover,
.category-box:active {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

/* 2. Services Grid (6 Clickable Items) */
.services-section { margin-bottom: 24px; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 12px;
}
.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #334155;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.service-item:hover,
.service-item:active {
    transform: translateY(-3px);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-item:hover .icon-box {
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.icon-box svg { 
    width: 24px !important; 
    height: 24px !important; 
    fill: #ffffff; 
}

/* Icon Colors */
.red-bg { background-color: #ef4444; }
.blue-bg { background-color: #3b82f6; }
.green-bg { background-color: #10b981; }
.orange-bg { background-color: #f97316; }
.purple-bg { background-color: #8b5cf6; }
.teal-bg { background-color: #14b8a6; }

.service-item span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

/* 3. Banner Frame & Dots */
.banner-section { margin-bottom: 24px; }
.banner-frame {
    width: 100%;
    height: 180px;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
}
.banner-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}
.banner-slide {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
}
.banner-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}
.dot {
    display: block;
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    background-color: #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: width 0.2s ease, background-color 0.2s ease;
}
.dot.active {
    width: 16px;
    background-color: #ef4444;
    border-radius: 10px;
}

.knowledge-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.14);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.knowledge-card:hover,
.knowledge-card:active {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.2),
        0 10px 22px rgba(15, 23, 42, 0.18);
}

.knowledge-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 19px;
}

.knowledge-info {
    min-width: 0;
    flex: 1;
}

.knowledge-info h3 {
    margin: 0 0 3px;
    color: #0f172a;
    font-size: 15px;
}

.knowledge-info p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.knowledge-arrow {
    color: #94a3b8;
    font-size: 24px;
    line-height: 1;
}

/* 4. Chapter End Test Horizontal Bars */
.chapter-test-section { margin-bottom: 20px; }
.test-card {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.14);
    transition: all 0.2s ease;
}
.test-card:hover,
.test-card:active {
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}
.test-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #0f172a;
    font-weight: 600;
}
.grade-tag {
    font-size: 11px;
    color: #ef4444;
    background-color: #fef2f2;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.arrow-icon {
    font-size: 20px;
    color: #94a3b8;
    font-weight: 300;
}

/* Floating Bottom Nav Bar */
.bottom-nav {
    box-sizing: border-box;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(75% - 30px);
    max-width: 330px;
    background: rgba(19, 32, 49, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 12px 8px;
    border-radius: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.18), 0 10px 24px rgba(15, 23, 42, 0.2);
    z-index: 9999;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 11px;
    gap: 4px;
    flex: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.nav-icon { 
    width: 20px !important; 
    height: 20px !important; 
    fill: #cbd5e1;
    transition: fill 0.2s ease;
}
.nav-item.active,
.nav-item.active .nav-icon {
    color: #ef4444;
    fill: #ef4444;
}
.nav-item:hover, .nav-item:active {
    color: #cbd5e1;
}
.nav-item:hover .nav-icon, .nav-item:active .nav-icon {
    fill: #cbd5e1;
}
/* --- Grade Page Layout & Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: #ffffff;
}

.back-btn {
  font-size: 18px;
  color: #1a1d29;
  text-decoration: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f5;
  border-radius: 50%;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1d29;
  margin: 0;
}

.header-placeholder {
  width: 36px;
}

.grade-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 20px;
  margin: 15px 20px;
  border-radius: 16px;
}

.grade-banner h2 {
  margin: 0 0 5px 0;
  font-size: 18px;
}

.grade-banner p {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

/* --- 3x2 Grid Style --- */
.category-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 10px 20px 80px 20px; /* အောက်ခြေ Nav အတွက် Space ချန်ထားခြင်း */
}

#grade-12-categories .grid-card:last-child {
  grid-column: 2;
}

.grid-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:active {
  transform: scale(0.96);
}

.grid-card span {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-align: center;
  margin-top: 8px;
  line-height: 1.2;
}

/* --- Icon Background Colors --- */
.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
}

.bg-red { background-color: #ff4757; }
.bg-blue { background-color: #2ed573; }
.bg-green { background-color: #1e90ff; }
.bg-orange { background-color: #ffa502; }
.bg-purple { background-color: #9b59b6; }
.bg-teal { background-color: #00cec9; }

/* --- Bottom Nav Fix --- */
.bottom-nav {
  box-sizing: border-box;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(75% - 30px);
  max-width: 330px;
  background: rgba(19, 32, 49, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 12px 8px;
  border-radius: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.18), 0 10px 24px rgba(15, 23, 42, 0.2);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 11px;
  gap: 4px;
}

.nav-item i {
  font-size: 18px;
  color: #cbd5e1;
}

.nav-item.active,
.nav-item.active i {
  color: #ef4444;
}
/* --- 5-6 Items Grid Layout (For G10 & G11) --- */
.category-grid-5 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  padding: 10px 20px 80px 20px;
}

/* ပထမ 3 ခုကို Row 1 တွင် အညီအမျှထားခြင်း */
.category-grid-5 .grid-card:nth-child(1),
.category-grid-5 .grid-card:nth-child(2),
.category-grid-5 .grid-card:nth-child(3),
.category-grid-5 .grid-card:nth-child(4),
.category-grid-5 .grid-card:nth-child(5),
.category-grid-5 .grid-card:nth-child(6) {
  grid-column: span 2;
}
/* --- Chapter List Card Design --- */
.chapter-list-container {
  padding: 10px 20px 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s ease;
}

.chapter-card:active {
  transform: scale(0.98);
}

.chapter-num {
  width: 40px;
  height: 40px;
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.chapter-info {
  flex-grow: 1;
}

.chapter-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.chapter-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #64748b;
}

.arrow-icon {
  color: #cbd5e1;
  font-size: 14px;
}