/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-bg: #f8f9fa;
  --main-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #34495e;
  --text-muted: #6c757d;
  --accent: #0066cc;
  --hover-bg: #e9ecef;
  --border: #e9ecef;
  --shadow: rgba(0, 0, 0, 0.1);
  --note-bg: #f8f9fa;
  --warning-bg: #fff3e0;
  --success-bg: #e8f5e8;
  --font-main: "Inter", sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

/* Topbar */
.topbar {
  background-color: var(--main-bg);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow);
}

.logo img {
  max-height: 40px;
  width: auto;
}

/* Layout */
.container {
  display: flex;
  min-height: calc(100vh - 64px);
  gap: 40px;
  margin: 0;
  padding: 20px 40px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 20px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar h4 {
  color: var(--accent);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  margin-top: 25px;
  font-weight: 600;
}

.sidebar h4:first-child {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin-bottom: 2px;
  border-radius: 6px;
}

.sidebar ul li a {
  color: #666;
  text-decoration: none;
  font-size: 15px;
  display: block;
  padding: 8px 12px;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.sidebar ul li a:hover {
  color: var(--accent);
  background-color: var(--hover-bg);
}

.sidebar ul li a.active {
  color: var(--accent);
  font-weight: 500;
  background-color: #e7f1ff;
}

/* Submenu styling */
.submenu {
  display: none;
  margin-left: 20px;
  margin-top: 5px;
  border-left: 2px solid var(--border);
  padding-left: 15px;
}

.submenu.active {
  display: block;
}

.submenu li {
  margin-bottom: 2px;
  margin-left: 20px;
}

.submenu li a {
  font-size: 14px;
  padding: 6px 12px;
  color: #777;
}

.submenu li a:hover {
  color: var(--accent);
  background-color: #f8f9fa;
}

.submenu li a.active {
  color: var(--accent);
  font-weight: 500;
  background-color: #e7f1ff;
}

.submenu-toggle {
  position: relative;
}

.submenu-toggle::after {
  content: '▼';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  transition: transform 0.2s ease;
}

.submenu-toggle.active::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Main Content */
.content {
  flex: 1;
  max-width: 900px;
  padding-right: 20px;
}

/* Page content */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* Typography Hierarchy */
.content h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.2;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 12px;
}

.content h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 20px;
  line-height: 1.3;
}

.content h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 32px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.content h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Paragraph and text */
.content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.content > p:first-of-type {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Lists */
.content ul {
  margin-bottom: 20px;
  padding-left: 0;
}

.content ul li {
  margin-bottom: 15px;
  list-style: none;
  position: relative;
  padding-left: 24px;
}

.content ul li:before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 18px;
}

.content ul li:last-child {
  margin-bottom: 0;
}

/* Nested lists */
.content ul li ul {
  margin-top: 8px;
  margin-left: 20px;
  margin-bottom: 0;
}

.content ul li ul li {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 15px;
  padding-left: 20px;
}

.content ul li ul li:before {
  content: "→";
  color: var(--text-muted);
  font-size: 14px;
}

/* Strong emphasis */
.content strong {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.05em;
}

.content > ul > li > strong {
  color: var(--accent);
  font-size: 1.1em;
  font-weight: 600;
}

/* Note and Warning Boxes */
.note-box {
  background-color: var(--note-bg);
  border-left: 4px solid var(--accent);
  padding: 20px;
  margin: 24px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.note-box p {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 500;
}

.warning-box {
  background-color: var(--warning-bg);
  border-left: 4px solid #ff9800;
  padding: 20px;
  margin: 24px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.1);
}

.warning-box p {
  margin: 0;
  color: #e65100;
  font-weight: 500;
}

/* Add spacing between boxes */
.note-box + .warning-box {
  margin-top: 20px;
}

/* Images */
.myimage {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  margin: 20px 0;
  border: 1px solid var(--border);
}

/* Financial Examples and Code */
.financial-example {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* Inline code and values */
code, .value {
  background-color: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  color: #d73a49;
}

/* Special emphasis for important concepts */
.concept {
  background-color: #e7f1ff;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 20px;
    gap: 20px;
  }
  
  .sidebar {
    width: 240px;
  }
  
  .content {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    gap: 0;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .content h1 {
    font-size: 28px;
  }
  
  .content h2 {
    font-size: 24px;
  }
}
