/* Main Styles for Solidity Course */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --code-bg: #f1f1f1;
  --border-color: #dee2e6;
}

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

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background-color: var(--secondary-color);
  color: white;
  padding: 20px 0;
  height: 100vh;
  position: fixed;
  overflow-y: auto;
}

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

.sidebar-header h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.sidebar-header p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.nav-menu {
  list-style: none;
  padding: 20px 0;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: block;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-section {
  font-weight: bold;
  padding: 15px 20px 5px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.submenu {
  list-style: none;
  padding-left: 20px;
}

.submenu .nav-link {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 30px;
  margin-left: 280px;
  max-width: calc(100% - 280px);
}

.content-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.content-header h1 {
  font-size: 2.2rem;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.content-header .breadcrumb {
  display: flex;
  list-style: none;
  font-size: 0.9rem;
  color: #6c757d;
}

.content-header .breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
}

.content-header .breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.content-header .breadcrumb a:hover {
  text-decoration: underline;
}

/* Article Content */
.article {
  line-height: 1.8;
}

.article h2 {
  font-size: 1.8rem;
  margin: 30px 0 15px;
  color: var(--secondary-color);
}

.article h3 {
  font-size: 1.4rem;
  margin: 25px 0 15px;
  color: var(--secondary-color);
}

.article p {
  margin-bottom: 20px;
}

.article ul, .article ol {
  margin-bottom: 20px;
  padding-left: 25px;
}

.article li {
  margin-bottom: 8px;
}

.article a {
  color: var(--primary-color);
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
}

.article img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
}

code {
  font-family: 'Courier New', monospace;
  background-color: var(--code-bg);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

pre code {
  padding: 0;
  background-color: transparent;
}

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

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--light-bg);
  font-weight: bold;
}

tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Buttons and Links */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background-color: #2980b9;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #1a252f;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 992px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
    max-width: 100%;
  }
  
  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
  }
  
  .nav-item {
    margin-right: 10px;
  }
}

/* Print Styles */
@media print {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    max-width: 100%;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
}

/* Highlight.js Theme */
.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  background: #f0f0f0;
}

.hljs,
.hljs-subst {
  color: #444;
}

.hljs-comment {
  color: #888888;
}

.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
  color: #008;
}

.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
  color: #800;
}

.hljs-title,
.hljs-section {
  color: #800;
  font-weight: bold;
}

.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #bc6060;
}

.hljs-literal {
  color: #78a960;
}

.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
  color: #397300;
}

.hljs-meta {
  color: #1f7199;
}

.hljs-meta-string {
  color: #4d99bf;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}
