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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    display: flex;
    min-height: 100vh;
    font-size: 18px;
}

/* sidebar style */
.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    padding: 18px;
    overflow-y: auto;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.3em;
    color: white;
    margin-bottom: 5px;
}

.sidebar-header p {
    color: rgba(255,255,255,0.7);
    font-size: 0.85em;
}

/* toc style */
#TOC {
    padding-top: 10px;
}

#TOC > ul {
    padding-left: 0;
}

#TOC ul {
    list-style: none;
    padding-left: 15px;
}

#TOC li {
    margin-bottom: 8px;
    position: relative;
}

#TOC a {
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

#TOC a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 20px;
}

#TOC a.active {
    background: #3498db;
    color: white;
    font-weight: 500;
}

#TOC ul ul a {
    font-size: 0.85em;
    padding-left: 20px;
    color: rgba(255,255,255,0.6);
}

/* main content area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px 50px;
    max-width: 1200px;
    background: #f8f9fa;
    min-height: 100vh;
}

.content-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* page navigation buttons */
.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 3px solid #3498db;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(52,152,219,0.2);
    border: none;
    cursor: pointer;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52,152,219,0.3);
    background: linear-gradient(135deg, #2980b9, #3498db);
}

/* headings */
h1, h2 {
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
  margin-bottom: 25px;
}

h3 {
  color: #34495e;
  margin-top: 20px;
  border-left: 4px solid #3498db;
  padding-left: 15px;
  margin-bottom: 15px;
}

/* footer */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  text-align: center;
  color: #6c757d;
  font-size: 0.9em;
}

/* code blocks */
pre,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

pre {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  border-left: 4px solid #007bff;
}

code {
  border: solid 1px;
  border-radius: 5px;
}

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th,
td {
  padding: 12px 15px;
  border: 1px solid #dee2e6;
}

th {
  background: #f8f9fa;
  font-weight: 600;
}

/* blockquotes */
blockquote {
  border-left: 4px solid #007bff;
  padding-left: 20px;
  margin: 20px 0;
  color: #6c757d;
  font-style: italic;
}

/* current section */
.current-section {
  background: #e3f2fd;
  border-left: 3px solid #2196f3;
  padding-left: 20px;
  margin-left: -20px;
}

/* images */
img.center {
  margin: 20px auto;
  display: block;
  text-align: center;
}

img.side-left {
  float: left;
  width: 50%;
  max-width: 50%;
  margin: 1.5rem 3rem 1.5rem 0rem;
  display: block;
}

/* side-layout container images/text */
.side-layout {
  display: flex;
  align-items: flex-start; 
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.side-image {
  flex: 0 0 60%;
  max-width: 60%;
}

.side-image img {
  width: 100%;
  height: auto;
  display: block;
}

.side-text {
  flex: 1; 
  margin-left: 1.5rem;
}

/* responsive design */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .content-container {
        padding: 20px;
    }
    
    .page-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
}