/* Solar Punk Theme Colors */
:root {
  --color-background: #152020; /* Deeper dark teal-green */
  --color-foreground: #e0e7e9; /* Light off-white */
  --color-primary: #ffc107; /* Amber */
  --color-secondary: #00bcd4; /* Sky blue */
  --color-accent: #8bc34a; /* Lime green */
  --color-card-background: #1e2e2e; /* Slightly lighter dark teal-green for cards */
  --color-border: #3f5151; /* Muted border color */
  --color-text-muted: #a7b9be; /* Muted text */
  --color-hover-bg: #2a3d3d; /* Hover background for interactive elements */
  --color-active-bg: #3a4e4e; /* Active background for selected elements */
  --color-code-bg: #1a1a1a; /* Dark background for code blocks */
  --color-code-text: #d4d4d4; /* Light text for code blocks */
  --border-radius-lg: 0.75rem;
  --border-radius-md: 0.5rem;
  --border-radius-sm: 0.25rem;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Added Inter for a modern feel */
  background-color: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.7; /* Increased line height for better readability */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: radial-gradient(circle at top left, rgba(139, 195, 74, 0.05) 0%, transparent 30%),
                    radial-gradient(circle at bottom right, rgba(0, 188, 212, 0.05) 0%, transparent 30%); /* Subtle background texture */
}

.app-header {
  background-color: var(--color-card-background);
  border-bottom: 1px solid var(--color-border);
  padding: 1.2rem 1.5rem; /* Slightly more padding */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 193, 7, 0.2); /* Enhanced shadow with primary color glow */
  border-bottom-left-radius: var(--border-radius-lg);
  border-bottom-right-radius: var(--border-radius-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.app-title {
  font-size: 2rem; /* Larger title */
  font-weight: 700; /* Bolder */
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  letter-spacing: 0.05em; /* Slightly spaced out letters */
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.5); /* Subtle glow for title */
}

.app-title:hover {
  color: var(--color-foreground);
  text-shadow: 0 0 12px rgba(255, 193, 7, 0.8);
}

.menu-button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 2rem; /* Larger menu icon */
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 1rem;
  display: none; /* Hidden by default, shown on mobile */
  transition: color 0.3s ease, transform 0.3s ease;
}

.menu-button:hover {
  color: var(--color-foreground);
  transform: scale(1.1);
}

.main-wrapper {
  display: flex;
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto; /* More vertical margin */
  width: 100%;
  gap: 2rem; /* Increased gap */
}

.app-sidebar {
  width: 300px; /* Slightly wider sidebar */
  background-color: var(--color-card-background);
  border: 1px solid var(--color-border); /* Border on all sides */
  padding: 1.5rem 1rem;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
  border-radius: var(--border-radius-lg); /* Rounded corners for the whole sidebar */
  flex-shrink: 0;
  overflow-y: auto;
  max-height: calc(100vh - 180px); /* Adjust based on header/footer height */
}

.sidebar-nav h3 {
  font-size: 1.2rem; /* Larger group titles */
  font-weight: 700; /* Bolder */
  color: var(--color-primary);
  margin-top: 1.8rem; /* More margin */
  margin-bottom: 1rem;
  padding: 0.7rem 1rem; /* More padding */
  background-color: rgba(255, 193, 7, 0.15); /* Primary with more transparency */
  border-radius: var(--border-radius-md);
  border-left: 3px solid var(--color-primary); /* Accent border */
}

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

.sidebar-nav li a {
  display: block;
  padding: 0.85rem 1.2rem; /* More padding */
  color: var(--color-foreground);
  text-decoration: none;
  font-size: 1rem; /* Slightly larger font */
  border-radius: var(--border-radius-md);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.sidebar-nav li a:hover {
  background-color: var(--color-hover-bg);
  color: var(--color-accent);
  transform: translateX(5px); /* Subtle slide effect on hover */
}

.sidebar-nav li a.active {
  background-color: var(--color-active-bg);
  color: var(--color-accent);
  font-weight: 600;
  border-left: 3px solid var(--color-accent); /* Active indicator */
  padding-left: 0.9rem; /* Adjust padding due to border */
}

.main-content {
  flex: 1;
  background-color: var(--color-card-background);
  padding: 2.5rem; /* More padding */
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
  overflow-y: auto;
  max-height: calc(100vh - 180px); /* Adjust based on header/footer height */
}

.main-content h1 {
  font-size: 2.8rem; /* Larger H1 */
  color: var(--color-primary);
  margin-bottom: 1.8rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 1rem;
  letter-spacing: 0.03em;
  text-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

.main-content h2 {
  font-size: 2.2rem; /* Larger H2 */
  color: var(--color-secondary);
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px dashed var(--color-border); /* Dashed border for H2 */
  padding-bottom: 0.5rem;
}

.main-content h3 {
  font-size: 1.7rem; /* Larger H3 */
  color: var(--color-accent);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.main-content p {
  margin-bottom: 1.2rem;
  color: var(--color-foreground);
}

.main-content ul, .main-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.8rem; /* More padding */
  color: var(--color-foreground);
}

.main-content ul li, .main-content ol li {
  margin-bottom: 0.6rem;
}

.main-content table {
  width: 100%;
  border-collapse: separate; /* Use separate for rounded corners */
  border-spacing: 0;
  margin-bottom: 1.8rem;
  border-radius: var(--border-radius-md);
  overflow: hidden; /* Ensures rounded corners are visible */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-content th, .main-content td {
  border: 1px solid var(--color-border);
  padding: 1rem; /* More padding */
  text-align: left;
}

.main-content th {
  background-color: var(--color-hover-bg);
  color: var(--color-primary);
  font-weight: 700; /* Bolder */
  text-transform: uppercase; /* Uppercase for table headers */
  letter-spacing: 0.05em;
}

.main-content tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.15); /* Slightly darker even rows */
}

.main-content pre {
  background-color: var(--color-code-bg); /* Darker background for code */
  color: var(--color-code-text); /* Light gray for code text */
  padding: 1.5rem; /* More padding */
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin-bottom: 1.8rem;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.95rem; /* Slightly larger font */
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3); /* Inner shadow for depth */
}

.main-content code {
  background-color: rgba(0, 0, 0, 0.3); /* Darker inline code background */
  padding: 0.3em 0.5em;
  border-radius: var(--border-radius-sm);
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  color: var(--color-accent);
}

.app-footer {
  background-color: var(--color-card-background);
  border-top: 1px solid var(--color-border);
  padding: 1.2rem; /* More padding */
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4); /* Enhanced shadow */
  margin-top: auto; /* Pushes footer to the bottom */
}

.app-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 50px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-content {
    justify-content: space-between;
  }

  .menu-button {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: -300px; /* Hidden by default, matches new width */
    height: 100%;
    width: 300px; /* Ensure width is consistent */
    z-index: 1001;
    transition: left 0.3s ease-in-out;
    border-right: none;
    border-radius: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
    max-height: 100vh; /* Full height on mobile */
  }

  .app-sidebar.open {
    left: 0;
  }

  .main-wrapper {
    flex-direction: column;
    margin: 1.5rem auto; /* Adjusted margin */
    gap: 1.5rem;
  }

  .main-content {
    padding: 1.8rem; /* Adjusted padding */
    max-height: calc(100vh - 150px); /* Adjust for smaller header/footer */
  }

  .app-title {
    font-size: 1.8rem;
  }

  .sidebar-nav h3 {
    font-size: 1.1rem;
  }

  .sidebar-nav li a {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }
}