/* 
  Sleek & Minimal Theme
  - Primarily grayscale palette
  - Subtle accent color
  - Minimal radii and shadows
*/

/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* Root Variables */
:root {
  --primary: #9300d7;              /* Primary accent color */
  --primary-light: #b144e5;        /* Lighter primary for hover */
  --primary-dark: #2ea5a355;       /* Darker accent */
  --secondary: #36cfc9;            /* Secondary accent color */
  --background: #0d0d16;           /* Dark background */
  --background-light: #1a1a1a;     /* Slightly lighter for containers */
  --background-secondary: #161622; /* Slightly lighter background */
  --background-card: #181818;      /* Card background */
  --card-bg: #1a1a24;              /* Background for cards */
  --code-bg: #1d1d2b;              /* Background for code blocks */
  --text: #e6e6e6;                 /* Light text color */
  --text-muted: #b3b3b3;           /* Lighter gray text for placeholders */
  --text-dimmed: #8c8c8c;          /* More subdued text */
  --border: #2a2a2a;               /* Dark border */
  --border-medium: #333;           /* Medium border shade */
  --accent: #36cfc9;               /* Same as primary for naming consistency */
  --success: #47bb5f;
  --warning: #ffc107;
  --error: #ff5252;
}

/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Links & Code */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--primary-light);
  opacity: 0.85;
}

code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 5px;
  border-radius: 4px;
}

/* Header */
header {
  background-color: var(--background-light);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: fixed;
  top: 0;
  width: calc(100%);
  box-sizing: border-box;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

header h1 {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1 i {
  opacity: 0.6;
  font-size: 1.2rem;
}

header p {
  color: var(--text-dimmed);
  font-size: 1rem;
}

/* Nav (Commented out in original, but leaving for reference) */
header nav {
  display: flex;
  gap: 20px;
}

header nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

header nav a:hover,
header nav a.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

/* Layout Container & Sidebar */
.container {
  display: flex;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  padding-top: 50px;
  width: 100%;
}

.sidebar {
  width: 260px;
  padding: 1rem;
  /* margin: 10px; */
  margin-top: 0;
  background-color: var(--background-light);
  /* border: 1px solid var(--border); */
  border-right: 1px solid var(--border);
  /* border-radius: 6px; */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  scrollbar-width: thin;
  overflow-y: auto;
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
}

.sidebar-content {
  padding-right: 1rem;
}

.sidebar h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  padding-left: 0.25rem;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.sidebar a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background-color: var(--primary-dark);
  color: #fff;
}

.sidebar ul ul {
  padding-left: 1rem;
  margin-top: 0.5rem;
}

main {
  flex: 1;
  padding: 2rem;
}

/* Section Titles */
section {
  margin-bottom: 2.5rem;
}

section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

/* Content Cards */
.content-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.content-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.content-card h4 {
  font-size: 1.1rem;
  margin: 1rem 0 0.8rem;
  color: var(--text);
}

.content-card p,
.content-card li {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.content-card ul,
.content-card ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.content-card li {
  margin-bottom: 0.5rem;
}

/* Code Blocks */
.code-block {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border-medium);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background-light);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.code-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.code-block code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text);
}

/* Endpoint Display Boxes */
.endpoint {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.endpoint:last-child {
  border-bottom: none;
}

.endpoint .method {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  min-width: 60px;
  text-align: center;
  color: #fff;
}

.endpoint .method.get {
  background-color: #4caf50;
}

.endpoint .method.post {
  background-color: #2196f3;
}

.endpoint .method.put {
  background-color: #ff9800;
}

.endpoint .method.patch {
  background-color: rgba(156, 39, 176, 0.15);
  border: 1px solid rgba(156, 39, 176, 0.3);
  color: rgba(156, 39, 176, 0.9);
}

.endpoint .method.delete {
  background-color: #f44336;
}

.endpoint .path {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--code-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.endpoint p {
  margin: 0.5rem 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.endpoint details {
  margin-top: 0.8rem;
}

.endpoint summary {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0;
}

/* Diff Display Styling */
.diff-container {
  margin: 2rem 0;
}

.diff-summary {
  background: rgba(54, 207, 201, 0.1);
  border-left: 4px solid var(--accent);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.diff-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
}

.diff-added {
  background: rgba(71, 187, 95, 0.1);
  border-left: 3px solid var(--success);
}

.diff-removed {
  background: rgba(255, 82, 82, 0.1);
  border-left: 3px solid var(--error);
}

.diff-changed {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid var(--warning);
}

/* Architecture Diagram */
.architecture-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.arch-row {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

.arch-component {
  background: var(--card-bg);
  border: 1px solid var(--border-medium);
  padding: 1rem;
  border-radius: 6px;
  margin: 0.5rem 0;
  text-align: center;
  transition: background 0.2s ease;
}

.arch-component:hover {
  background: #222;
}

.arch-component.half {
  flex: 1;
}

.arch-component h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  margin-top: 0px;
  color: var(--text);
}

.arch-component p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
}

.arch-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-dimmed);
  margin: 0.5rem 0;
}

/* Table Styling */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead {
  background: #1f1f1f;
}

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

th {
  background-color: var(--background-secondary);
  font-weight: 600;
  color: var(--text);
}

td {
  color: var(--text-muted);
  font-size: 0.95rem;
}

tr:nth-child(even) {
  background: #161616;
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Callout Boxes */
.callout {
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

.callout.warning {
  border-left-color: var(--warning);
}

.callout.error {
  border-left-color: var(--error);
}

.callout.success {
  border-left-color: var(--success);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Environment Table (Example) */
.env-table {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.env-table .env-name {
  font-weight: 500;
}

.env-table .env-required {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 6px;
  background: rgba(54, 207, 201, 0.1);
  color: var(--primary);
  border: 1px solid rgba(54, 207, 201, 0.2);
}

.env-table .env-optional {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Footer */
footer {
  background-color: var(--background-light);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-align: center;
  padding: 1rem;
  color: var(--text-dimmed);
  border-top: 1px solid var(--border);
}

.footer-links {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-decoration: none;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    padding-top: 60px;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    margin-bottom: 1rem;
    top: 0;
  }
  
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
  }
  
  main {
    padding: 1rem;
  }
  
  .content-card {
    padding: 1.2rem;
  }
  
  .arch-row {
    flex-direction: column;
  }
  
  .arch-component.half {
    width: 100%;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  header nav {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .endpoint .path {
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
  }
  
  .endpoint .method {
    margin-bottom: 0.3rem;
  }
  
  .table-container {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
    max-width: none;
  }
}