/* =====================================================
   ROOT VARIABLES
===================================================== */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --primary: #1e3a8a;
  --accent: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 10px 25px rgba(0,0,0,0.05);
  --transition: all 0.2s ease;
}

/* =====================================================
   GLOBAL RESET
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Poppins", sans-serif;
  background: var(--bg);
  color: #111827;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =====================================================
   HEADER
===================================================== */
.site-header {
  width: 100%;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 36px;
}

.nav-menu {
  display: flex;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  font-weight: 500;
  color: #374151;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

/* Mobile Menu */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 24px;
    width: 220px;
    flex-direction: column;
    background: var(--card);
    padding: 20px;
    box-shadow: var(--shadow);
    border-radius: 12px;
  }
  .nav-menu.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .nav-link {
    padding: 10px 0;
  }
}

/* =====================================================
   BLOG SECTION
===================================================== */
.blog-section {
  margin-top: 40px;
}

.blog-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 30px;
  color: var(--primary);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 25px rgba(0,0,0,0.08);
}

.blog-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 18px;
}

.blog-card p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

/* =====================================================
   CONTAINER
===================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--primary);
}

/* =====================================================
   TYPOGRAPHY
===================================================== */
h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
  text-align: center;
}

.intro-text {
  text-align: center;
  width: 90%;
  max-width: 900px;
  margin: 0 auto 32px auto;
  font-size: 16px;
  color: #374151;
}

/* =====================================================
   TOOL SECTION WRAPPER
===================================================== */
.tool-section {
  width: 100%;
  margin: 0 auto;
}

/* =====================================================
   LAYOUT GRID
===================================================== */
.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* =====================================================
   CARD DESIGN
===================================================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card + .card {
  margin-top: 20px;
}

#semesterSection .card {
  margin-bottom: 12px;
}

/* =====================================================
   FORM ELEMENTS
===================================================== */
input,
select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  transition: var(--transition);
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

/* =====================================================
   BUTTONS
===================================================== */
button {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.btn-full {
  width: 100%;
}

/* =====================================================
   TABLE STYLING
===================================================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  text-align: left;
  padding: 8px;
  font-size: 14px;
  white-space: nowrap;
}

th {
  font-weight: 600;
  color: #374151;
}

tr + tr {
  border-top: 1px solid var(--border);
}

tbody tr:hover {
  background: #f9fafb;
}

/* =====================================================
   RESULT SECTION
===================================================== */
.result-value {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0;
}

.status {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 8px;
}

.status.excellent {
  background: #dcfce7;
  color: var(--accent);
}

.status.good {
  background: #dbeafe;
  color: var(--primary);
}

.status.risk {
  background: #fef3c7;
  color: var(--warning);
}

.status.critical {
  background: #fee2e2;
  color: var(--danger);
}

/* =====================================================
   STICKY SIDEBAR
===================================================== */
.sticky {
  position: sticky;
  top: 24px;
}

/* =====================================================
   HOW TO USE SECTION
===================================================== */
.how-to-use {
  margin-top: 40px;
  padding: 30px;
  border-left: 6px solid var(--primary);
  width: 100%;
}

.how-to-use h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--primary);
}

.steps-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps-list li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 18px;
  font-size: 15px;
  color: #374151;
}

.steps-list li:last-child {
  margin-bottom: 0;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: var(--transition);
}

.steps-list li:hover::before {
  background: var(--accent);
  transform: scale(1.05);
}

/* =====================================================
   CGPA FORMULA SECTION
===================================================== */
.formula-section {
  margin-top: 40px;
  text-align: center;
  padding: 20px;
}

.formula-description {
  max-width: 700px;
  margin: 0 auto 20px auto;
  font-size: 16px;
  line-height: 1.6;
  color: #4b5563;
}

.formula-image-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.formula-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.formula-text {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
}
/* =========================
   CGPA GRADING SYSTEM
========================= */

.grading-system {
  margin-top: 40px;
}

.grading-system h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.grading-system p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 14px;
}
/* =========================
   CGPA SYSTEM EXPLANATION
========================= */

.cgpa-system {
  margin-top: 40px;
}

.cgpa-system h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-system p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 14px;
}

.cgpa-steps {
  margin: 10px 0 18px 20px;
  padding-left: 10px;
}

.cgpa-steps li {
  margin-bottom: 8px;
  font-size: 15px;
  color: #374151;
}

.cgpa-formula {
  background: #f9fafb;
  padding: 14px;
  border-radius: 8px;
  font-size: 15px;
}
/* =========================
   CGPA SCALES TABLE
========================= */
.cgpa-scales {
  margin-top: 40px;
}

.cgpa-scales h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-scales h3 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--primary);
}

.cgpa-scales p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 12px;
}

.cgpa-scales .table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}

.cgpa-scales table {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px; /* ensures horizontal scroll on small devices */
}

.cgpa-scales th,
.cgpa-scales td {
  text-align: left;
  padding: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.cgpa-scales th {
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.cgpa-scales tbody tr:hover {
  background: #f9fafb;
}
/* =========================
   CGPA CONVERSION EXAMPLE
========================= */
.cgpa-conversion {
  margin-top: 40px;
}

.cgpa-conversion h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-conversion p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 12px;
}

.cgpa-conversion .table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}

.cgpa-conversion table {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px;
}

.cgpa-conversion th,
.cgpa-conversion td {
  text-align: left;
  padding: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.cgpa-conversion th {
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.cgpa-conversion tbody tr:hover {
  background: #f9fafb;
}
/* =========================
   CGPA ADVANTAGES / WHY UNIVERSITIES
========================= */
.cgpa-advantages {
  margin-top: 40px;
}

.cgpa-advantages h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-advantages p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 12px;
}

.cgpa-advantages ul {
  padding-left: 20px;
  margin: 0;
  list-style-type: disc;
}

.cgpa-advantages li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
}

.cgpa-advantages li strong {
  color: var(--primary);
}
/* =========================
   CGPA VS GPA SECTION
========================= */
.cgpa-vs-gpa {
  margin-top: 40px;
}

.cgpa-vs-gpa h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-vs-gpa p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 12px;
}

.cgpa-vs-gpa ul {
  padding-left: 20px;
  margin: 0;
  list-style-type: disc;
}

.cgpa-vs-gpa li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
}

.cgpa-vs-gpa li strong {
  color: var(--primary);
}
/* =========================
   CGPA TO PERCENTAGE SECTION
========================= */
.cgpa-percentage {
  margin-top: 40px;
}

.cgpa-percentage h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 16px;
}

.cgpa-percentage p {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 12px;
}

.cgpa-percentage .table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}

.cgpa-percentage table {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px;
}

.cgpa-percentage th,
.cgpa-percentage td {
  text-align: left;
  padding: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.cgpa-percentage th {
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.cgpa-percentage tbody tr:hover {
  background: #f9fafb;
}
/* FAQ Section */
.faq-section {
  margin-top: 40px;
}

.faq-section h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
}

.faq-item {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.faq-question {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  position: relative;
  color: var(--primary);
  padding-right: 24px;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  content: "-";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding-top: 0;
}

.faq-item.active .faq-answer {
  max-height: 1000px; /* Enough to show content */
  padding-top: 8px;
}
/* =====================================================
   FOOTER
===================================================== */
.footer {
  margin-top: 60px;
  background: var(--primary);
  color: white;
  padding: 30px 24px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-left,
.footer-right {
  font-size: 14px;
  line-height: 1.6;
}

.footer a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS
===================================================== */

/* Tool / CGPA layout */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
}

/* Blog grid responsive */
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Container / typography / cards for small screens */
@media (max-width: 768px) {
  .container {
    padding: 18px;
  }

  .tool-section {
    padding: 0;
  }

  h1 {
    font-size: 22px;
  }

  .section-title {
    font-size: 18px;
  }

  .card {
    padding: 20px;
  }

  .result-value {
    font-size: 20px;
  }

  .how-to-use {
    padding: 22px;
    margin-top: 28px;
  }

  .how-to-use h2 {
    font-size: 18px;
  }

  .steps-list li {
    padding-left: 42px;
    font-size: 14px;
  }

  .steps-list li::before {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .formula-description,
  .formula-text {
    font-size: 14px;
  }
   .grading-system h2{
  font-size:18px;
}

.grading-system p{
  font-size:14px;
}
   .cgpa-system h2{
  font-size:18px;
}

.cgpa-system p{
  font-size:14px;
}

.cgpa-steps li{
  font-size:14px;
}
    .cgpa-scales h2{
    font-size:18px;
  }
  .cgpa-scales h3{
    font-size:16px;
  }
  .cgpa-scales p{
    font-size:14px;
  }
  .cgpa-scales th,
  .cgpa-scales td{
    font-size:13px;
    padding:6px;
  }
    .cgpa-conversion h2{
    font-size:18px;
  }
  .cgpa-conversion p{
    font-size:14px;
  }
  .cgpa-conversion th,
  .cgpa-conversion td{
    font-size:13px;
    padding:6px;
  }
   .cgpa-advantages h2{
    font-size:18px;
  }
  .cgpa-advantages p,
  .cgpa-advantages li{
    font-size:14px;
  }
   .cgpa-vs-gpa h2{
    font-size:18px;
  }
  .cgpa-vs-gpa p,
  .cgpa-vs-gpa li{
    font-size:14px;
  }
   .cgpa-percentage h2{
    font-size:18px;
  }
  .cgpa-percentage p,
  .cgpa-percentage th,
  .cgpa-percentage td{
    font-size:14px;
    padding:6px;
  }

  /* Mobile menu toggle already covered */
}

/* Extra small devices */
@media (max-width: 480px) {
  input,
  select,
  button {
    height: 44px;
    font-size: 15px;
  }
}

/* =====================================================
   ANIMATIONS
===================================================== */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
    #semesterSection input[type="text"],
  #semesterSection input[type="number"],
  #semesterSection select {
    height: 32px;       /* chhoto height */
    font-size: 12px;    /* smaller text */
    padding: 2px 6px;   /* tighter padding */
  }

  #semesterSection table th,
  #semesterSection table td {
    font-size: 13px;    /* smaller table font */
  }

  #semesterSection button {
    font-size: 12px;
    padding: 4px 6px;
  }
}

.highlight {
  animation: highlight 0.4s ease;
}

@keyframes highlight {
  0% { background-color: #e0e7ff; }
  100% { background-color: transparent; }
}

/* =====================================================
   COMPACT TABLE INPUTS
===================================================== */
#semesterSection table td {
  padding: 4px 6px;        /* gap between columns কমাচ্ছে */
}

#semesterSection table input,
#semesterSection table select {
  width: 100%;
  box-sizing: border-box;  /* input properly fit করবে td এর ভিতরে */
}

/* MOBILE VIEW ADJUSTMENT */
@media (max-width: 768px) {
  #semesterSection table input[type="text"],
  #semesterSection table input[type="number"],
  #semesterSection table select {
    font-size: 13px;       /* smaller text */
    height: 36px;          /* compact height */
    padding: 4px 8px;      /* smaller padding */
  }

  #semesterSection table td {
    padding: 3px 4px;      /* compact spacing on mobile */
  }

  #semesterSection table button {
    font-size: 12px;
    padding: 4px 8px;
  }
}
