:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #ccfbf1;

  --border-color: #e2e8f0;
  --code-bg: #f1f5f9;
  --code-text: #0f172a;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --sidebar-width: 320px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout structure */
.container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
aside {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem;
  overflow-y: auto;
}

.university-logo-container {
  margin-bottom: 2rem;
  text-align: center;
}

.university-logo {
  max-width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

.thesis-meta {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.thesis-meta h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.thesis-meta-item {
  margin-bottom: 0.75rem;
}

.thesis-meta-item:last-child {
  margin-bottom: 0;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 0.15rem;
}

.meta-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-value a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.meta-value a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Navigation Links */
nav {
  flex-grow: 1;
}

nav h5 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  margin-top: 1rem;
}

nav ul {
  list-style-type: none;
}

nav li {
  margin-bottom: 0.5rem;
}

nav a {
  display: block;
  padding: 0.6rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Main content container */
main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 3rem 4rem;
  max-width: 1200px;
}

/* Document header inside main content */
header {
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.lead-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 85ch;
  font-weight: 400;
}

/* Badges */
.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge-pill {
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.badge-pill:hover {
  opacity: 0.9;
}

.badge-blue {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-teal {
  background-color: var(--accent-light);
  color: var(--accent);
  border: 1px solid #99f6e4;
}

.badge-gray {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-orange {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

/* Sections styling */
section {
  margin-bottom: 4.5rem;
  scroll-margin-top: 2rem;
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.5rem;
  background-color: var(--primary);
  border-radius: 2px;
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 80ch;
}

strong {
  color: var(--text-primary);
}

ul,
ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.card h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h4 code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--primary);
  background: none;
  padding: 0;
}

.card p {
  font-size: 0.875rem;
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* Figures and Images */
figure {
  margin: 2rem 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}

figure:hover {
  box-shadow: var(--shadow-lg);
}

figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

/* Inline elements */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-weight: 500;
}

pre {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  background-color: var(--bg-secondary);
}

th {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--bg-primary);
}

/* Timeline styling */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2.5rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.5rem;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 4px solid var(--bg-secondary);
  box-shadow: 0 0 0 1px var(--primary-border);
  z-index: 2;
}

.timeline-date {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-date .tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background-color: var(--primary-light);
  color: var(--primary);
}

.timeline-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.timeline-content h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-content ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
  font-size: 0.925rem;
}

.timeline-content figure {
  margin: 1rem 0 0 0;
  max-width: 600px;
}

.timeline-content figure img {
  /* max-height: 250px; */
}

/* Custom alert box */
.alert-box {
  border-left: 4px solid var(--primary);
  background-color: var(--primary-light);
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}

.alert-box p {
  margin-bottom: 0;
  color: #1e40af;
  font-size: 0.95rem;
}

/* Footer */
footer {
  margin-top: 6rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive designs */
@media (max-width: 1024px) {
  aside {
    width: 100%;
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 2rem;
  }

  main {
    margin-left: 0;
    padding: 2rem;
  }

  .container {
    flex-direction: column;
  }
}
