/* =========================================================
   Color Palette
   ========================================================= */
:root {
  --primary-color: #7752aa;
  --primary-light: #9276b9;
  --primary-lighter: #d8c9eb;
  --text-dark: #333;
  --text-muted: #555;
  --text-link: #1a73e8;
  --text-success: #2e7d32;
  --text-warning: #f9a825;
  --text-danger: #c62828;
  --bg-light: #fff;
  --divider: #ddd;

  /* Global typography */
  --font-family: "Nunito", sans-serif;
  --font-size: normal;
  --font-size-small: small;
  --font-style: normal;

  /* Assamese-specific */
  --assamese-font-family: "Noto Serif Bengali", serif;
  --assamese-font-size: 1.1rem;
  --assamese-font-size-small: 1rem;
}

/* =========================================================
   Base Layout
   ========================================================= */
html,
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-style: var(--font-style);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.5;
}

/* =========================================================
   Typography
   ========================================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Calibri Light", "Segoe UI", sans-serif;
  color: var(--primary-color);
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.2rem;
  font-weight: 300;
}

h2 {
  font-size: 1.8rem;
  font-weight: 300;
}

h3 {
  font-size: 1.4rem;
  font-weight: 600;
}

h4 {
  font-size: 1.3rem;
  font-weight: 600;
}

h5 {
  font-size: 1.2rem;
  font-weight: 600;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
}

/* Override for h3-h6 */
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  color: var(--text-dark);
  font-weight: 600;
}

h3::before {
  content: "✦";
  color: var(--primary-color);
  margin-right: 0.5rem;
  font-size: 1.2rem;
  vertical-align: middle;
}

p {
  color: var(--text-dark);
  margin: 0.75rem 0;
}

p,
ul,
ol,
li,
small,
sub,
sup,
blockquote,
a,
i,
b,
strong,
em {
  font-family: inherit;
  font-size: inherit;
}

/* Links */
a {
  color: red;
  text-decoration: none;
}

a:hover {
  color: inherit;
}

/* Strong / Bold */
strong,
b {
  font-family: "Segoe UI", Nunito, sans-serif;
  font-weight: 600;
}

/* Alerts */
.alert {
  color: var(--text-dark);
  padding: 0.5rem;
  margin: 0.75rem 0;
  font-size: var(--font-size-small);
}

.alert ol {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.alert li {
  margin-bottom: 0.25rem;
}

/* Page Titles */
.name {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.lead {
  font-size: x-large;
}

.page-title {
  text-align: center;
  font-size: 3rem;
  margin: 1rem 0;
}

/* Sections */
.section {
  padding: 8px 2px;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 3px;
  font-variant: small-caps;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.card .section-title {
  font-size: 1.6rem;
}

.section-divider {
  border: 0;
  height: 2px;
  background-color: var(--primary-color);
  margin: 1rem 0 2rem;
}

/* Figures */
.subfigure-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.subfigure {
  flex: 1 1 30%;
  text-align: center;
}

.subfigure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.subfigure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
  text-align: center;
}

/* cover image */
.cover-container {
  width: 100%;
  text-align: center;
  padding: 0;
}

.cover-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none; /* ensures clicks pass through if needed */
}

/* Blog Figures */
.blog-figure {
  float: right;
  width: 35%;
  margin-left: 1rem;
  margin-bottom: 1rem;
}

.blog-figure img {
  width: 100%;
  border-radius: 0.25rem;
}

.blog-figure figcaption {
  font-size: 0.9rem;
  text-align: center;
}

.blog-figure-center {
  max-width: 35%;
  text-align: center;
  margin: 1rem auto;
}

.blog-figure-center img {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

.blog-figure-center figcaption {
  font-size: 0.9rem;
  margin-top: 0.25rem;
  overflow-wrap: break-word;
}

/* Info Boxes */
.info-box {
  background-color: var(--primary-lighter);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  color: var(--text-dark);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.info-box img {
  max-height: 120px;
  width: auto;
  border-radius: 4px;
}

.info-box strong {
  font-weight: 600;
  margin-right: 0.3rem;
  display: inline;
}

/* Inline math */
.inline-math {
  font-family: "Times New Roman", serif;
  font-style: italic;
}

/* Blockquotes */
.blockquote.assamese {
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--primary-lighter);
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.blockquote.assamese p {
  margin: 0;
  display: inline;
  position: relative;
}

.blockquote.assamese p::before {
  content: "“";
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-right: 0.2rem;
}

.blockquote.assamese p::after {
  content: "”";
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-left: 0.2rem;
}

.blockquote.assamese footer {
  font-size: 0.8rem;
  font-style: normal;
  text-align: right;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  background-color: var(--primary-color) !important;
  border-bottom: none;
  box-shadow: none !important;
  padding: 0.2rem 1rem;
}

.navbar .navbar-brand {
  font-size: 1.5rem;
  font-weight: 300;
  color: #fff !important;
  padding: 0.25rem 0;
}

.navbar .nav-link {
  font-size: 1rem;
  font-weight: 400;
  color: #f4f4f4 !important;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.2;
  transition: background-color 0.2s, opacity 0.2s;
}

.navbar .nav-link:hover {
  background-color: var(--primary-light);
  color: #fff !important;
}

.navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%28255,255,255,1%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-brand,
.nav-link {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
}

.navbar,
.navbar .navbar-brand,
.navbar .nav-link {
  font-family: var(--font-family) !important;
}

.navbar .nav-link.assamese-link {
  font-family: var(--assamese-font-family) !important;
  font-size: var(--assamese-font-size) !important;
}

/* =========================================================
   Footer
   ========================================================= */
#footer {
  margin-top: auto;
  width: 100%;
  background-color: var(--bg-light);
  text-align: right;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =========================================================
   Sections & Layout + Mini page
   ========================================================= */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
  position: relative;
}

.split > div {
  background: inherit;
  padding: 0.5rem;
  border-radius: 4px;
}

.split::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: var(--divider);
  transform: translateX(-50%);
}

/* =========================================================
   Navigation (Aside)
   ========================================================= */
aside {
  position: sticky;
  top: 0;
  align-self: flex-start;
}

aside .nav-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

aside .d-grid .nav-btn {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: var(--bg-light);
  color: var(--primary-color);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  text-decoration: none;
  margin-bottom: 4px;
}

aside .d-grid .nav-btn:hover {
  background-color: var(--primary-light);
  color: #fff;
  transform: translateY(-1px);
}

aside .d-grid .sub-btns .nav-sub-btn {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  background: transparent;
  color: var(--primary-color);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  text-decoration: none;
  margin-bottom: 4px;
  position: relative;
  padding-left: 18px;
}

aside .d-grid .sub-btns .nav-sub-btn::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--primary-color);
  font-weight: bold;
}

aside .d-grid .sub-btns .nav-sub-btn:hover {
  background-color: var(--primary-light);
  color: var(--bg-light);
  transform: translateY(-1px);
}

aside .d-grid .nav-btn + .sub-btns {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding-left: 8px;
}

aside .d-grid .nav-btn.active + .sub-btns {
  display: flex;
}

aside .d-grid .nav-section {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  margin: 8px 0;
  color: var(--primary-color);
  background-color: var(--bg-light);
  border: 2px solid var(--divider);
  border-radius: 6px;
}

aside .nav-section a {
  all: unset;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  background: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

/* =========================================================
   Logos
   ========================================================= */
img.logo {
  width: 18px;
  height: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

/* =========================================================
   Google map
   ========================================================= */
.map-container {
  width: 80%;
  height: 25vh;
  margin: 5% auto;
  position: relative;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

/* =========================================================
   Skills / Progress Bars
   ========================================================= */
.skill {
  margin: 8px 0;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.progress {
  height: 26px;
  border-radius: 4px;
  overflow: hidden;
}

.progress .progress-bar {
  line-height: 26px;
  padding-left: 8px;
  background: var(--primary-color);
  color: #fff;
  text-align: left;
  font-weight: 600;
}

/* =========================================================
   Cards
   ========================================================= */
section .card {
  background-color: #f5f5f5;
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

section .card .card-img-top {
  object-fit: cover;
  width: 100%;
  height: 180px;
  border-radius: 6px 6px 0 0;
}

section .card .card-body {
  padding: 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

section .card .card-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

section .card .btn {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
}

section .card .btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

section .card .card-text {
  text-align: left;
}

/* =========================================================
   Tables
   ========================================================= */
.table,
.table th,
.table td {
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--text-dark);
}

.table {
  width: auto;
  border-collapse: collapse;
  margin: 2rem auto;
  background-color: var(--bg-light);
}

.table th,
.table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--divider);
  text-align: center;
}

.table thead th {
  background-color: var(--primary-lighter);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  color: var(--text-dark);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: #f1f1f1;
}

.assamese .table th {
  font-family: inherit;
}

/* =========================================================
   Code Blocks
   ========================================================= */
pre {
  display: block;
  margin: 0;
  margin-bottom: 0.25rem;
  padding: 0.25rem;
}

pre code.hljs,
pre code[class*="language-"] {
  display: block;
  margin: 0;
  padding: 0.4rem;
  font-size: 0.8rem;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--divider);
  line-height: 1.3;
  color: #444;
  overflow-x: auto;
  white-space: pre;
}

pre code.hljs.language-python {
  border-left: 5px solid #3572a5;
}

pre code.hljs.language-cpp {
  border-left: 5px solid #f34b7d;
}

pre code.hljs.language-bash {
  border-left: 5px solid #89e051;
}

pre code.hljs.language-json {
  border-left: 5px solid #cbcb41;
}

pre code.hljs.language-html {
  border-left: 5px solid #e34c26;
}

pre code.hljs.language-javascript {
  border-left: 5px solid #f1e05a;
}

pre code.hljs.language-css {
  border-left: 5px solid #563d7c;
}

pre code.hljs.language-latex {
  border-left: 5px solid #008080;
}

.hljs-ln td.hljs-ln-numbers {
  border-right: 2px solid var(--divider);
  padding: 0 0.4rem 0 0 !important;
  font-size: 0.8em;
  color: #666;
  user-select: none;
  white-space: nowrap;
  text-align: right;
}

.hljs-ln td.hljs-ln-code {
  padding-left: 0.8rem !important;
}

.hljs-comment {
  color: #008000;
  font-style: italic;
}

/* =========================================================
   Figures & Images
   ========================================================= */
figure.figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem auto;
  max-width: 800px;
  padding: 0 1rem;
}

figure.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

figure.figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
}

/* =========================================================
   Forms & Inputs
   ========================================================= */
section form input,
section form select,
section form textarea {
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 1rem;
  width: 100%;
  margin-bottom: 8px;
}

/* =========================================================
   Accordion
   ========================================================= */
.accordion-button {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
}

.accordion-button:not(.collapsed) {
  background-color: var(--primary-color);
  color: #fff;
}

.accordion-body {
  background-color: #f9f9f9;
}

/* =========================================================
   Modal
   ========================================================= */
.modal-content {
  border-radius: 6px;
  border: 1px solid var(--divider);
}

.modal-header {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.modal-footer {
  justify-content: flex-end;
}

/* =========================================================
   Tabs
   ========================================================= */
.nav-tabs {
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 1rem;
}

.nav-tabs .nav-link {
  color: var(--primary-color);
  font-weight: 600;
  background-color: var(--bg-light);
  border: 1px solid var(--divider);
  border-bottom: none;
  margin-right: 2px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.nav-tabs .nav-link:hover {
  background-color: var(--primary-light);
  color: #fff;
}

.nav-tabs .nav-link.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--divider) var(--divider) var(--primary-color);
  z-index: 1;
}

.tab-content {
  border: 1px solid var(--divider);
  border-top: none;
  padding: 1rem;
  border-radius: 0 0 6px 6px;
  background-color: var(--bg-light);
}

.tab-pane {
  display: none;
}

.tab-pane.show {
  display: block;
}

/* =========================================================
   Buttons
   ========================================================= */
button.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}

button.btn-primary:hover,
button.btn-primary:focus {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

button.btn-secondary {
  background-color: var(--text-muted);
  border-color: var(--text-muted);
  color: #fff;
}

button.btn-secondary:hover,
button.btn-secondary:focus {
  background-color: #777;
  border-color: #777;
}

button.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

button.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
}

/* =========================================================
   Go Top Button
   ========================================================= */
#goTopBtn {
  float: right;
  margin: 20px 0;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  transition: background 0.2s;
}

#goTopBtn:hover {
  background-color: var(--primary-light);
}

/* =========================================================
   LaTeX (MathJax)
   ========================================================= */
mjx-container {
  font-family: var(--font-family) !important;
}

/* ===============================
   Mermaid Diagrams
   =============================== */
.mermaid {
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  color: var(--text-dark);
}

/* Node styling */
.mermaid .node rect,
.mermaid .node polygon {
  fill: var(--primary-lighter);
  stroke: var(--primary-color);
  stroke-width: 1.5px;
  rx: 6; /* rounded corners */
  ry: 6;
}

.mermaid .node text {
  fill: var(--text-dark);
  font-family: var(--font-family);
  font-size: var(--font-size);
}

/* Edge styling */
.mermaid .edgePath path {
  stroke: var(--primary-light);
  stroke-width: 1.5px;
}

.mermaid .edgeLabel text {
  fill: var(--text-muted);
  font-size: var(--font-size-small);
  background: #fff;
}

/* Strong text inside nodes */
.mermaid strong {
  font-weight: bold;
  color: var(--text-dark);
}

/* =========================================================
   Assamese text block
   ========================================================= */
.assamese,
.assamese h1,
.assamese h2,
.assamese h3,
.assamese h4,
.assamese h5,
.assamese h6,
.assamese p,
.assamese a {
  font-family: var(--assamese-font-family);
}

.assamese a {
  text-decoration: none;
  color: red;
}

.assamese p {
  font-size: var(--assamese-font-size);
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
}

.assamese strong {
  font-family: var(--assamese-font-family);
  font-size: var(--assamese-font-size);
}

.assamese .table,
.assamese .table th,
.assamese .table td {
  font-family: var(--assamese-font-family);
  font-size: var(--assamese-font-size-small);
  color: var(--text-dark);
}

/* =========================================================
   Responsive / Mobile
   ========================================================= */
@media (width <= 768px) {
  /* headers */
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: x-large;
  }

  h3 {
    font-size: 1.1rem;
  }

  h4 {
    font-size: 1.05rem;
  }

  h5,
  h6 {
    font-size: 0.95rem;
  }

  .name {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: x-large;
  }

  .page-title {
    text-align: center;
    font-size: 2rem;
    margin: 1rem 0;
  }

  /* Sidebar */
  aside.col-md-3 {
    width: 100% !important;
    padding: 0;
    position: static;
  }

  aside .d-grid {
    gap: 0.5rem;
  }

  aside .d-grid .nav-btn,
  aside .d-grid .sub-btns .nav-sub-btn,
  aside .d-grid .nav-section {
    width: 100%;
    text-align: left !important;
  }

  aside .d-grid .sub-btns {
    padding-left: 0;
  }

  aside .d-grid .nav-btn {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  aside .d-grid .sub-btns .nav-sub-btn {
    font-size: 0.95rem;
    padding: 8px 12px 8px 22px; /* extra left padding for dot */
  }

  aside .d-grid .sub-btns .nav-sub-btn::before {
    left: 8px;
  }

  /* Grid and columns */
  .container {
    padding: 10px;
  }

  .col-md-4,
  .col-md-8 {
    margin-bottom: 15px;
  }

  /* Sections */
  .section {
    padding: 6px 8px;
    margin: 8px 0;
  }

  /* Figures */
  .subfigure-container {
    flex-direction: column;
    align-items: center;
  }

  .subfigure {
    width: 100%;
  }

  .blog-figure {
    min-width: 50% !important;
    max-width: 100% !important;
    margin-left: 0.5rem;
    margin-bottom: 1rem;
  }

  .blog-figure-center {
    width: 100% !important;
    max-width: 100% !important;
  }

  .blog-figure-center figcaption {
    font-size: 0.85rem;
  }

  /* Text */
  p,
  b,
  strong,
  li,
  small,
  sub,
  sup,
  blockquote,
  blockquote p {
    font-size: var(--font-size-small);
  }

  /* Links in normal text are small */
  p a,
  li a,
  small a,
  sub a,
  sup a,
  blockquote a,
  blockquote p a {
    font-size: var(--font-size-small);
  }

  /* Links inside headers or italics inherit parent size */
  h1 a,
  h2 a,
  h3 a,
  h4 a,
  h5 a,
  h6 a,
  i a,
  em a {
    font-size: inherit;
  }

  /* Assamese text */
  .assamese p {
    font-size: var(--assamese-font-size-small);
  }

  .assamese a {
    font-size: inherit;
  }

  /* Figures */
  figure.figure {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  figure.figure figcaption {
    font-size: 0.75rem;
  }

  .media iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  /* Progress bars */
  .progress {
    width: 100%;
    height: 20px;
    margin-bottom: 0.5rem;
  }

  .progress-bar {
    font-size: 0.85rem;
    line-height: 20px;
    padding: 0 4px;
  }

  /* Sections */
  .section {
    padding: 4px 6px;
    margin: 6px 0;
  }

  /*code*/
  pre code.hljs,
  pre code[class*="language-"] {
    font-size: 0.65rem; /* smaller font for mobile */
  }
}
