/* Replace the entire file with this improved CSS */
:root {
  /* Light theme colors */
  --bg-color: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-color: #1a202c;
  --text-secondary: #4a5568;
  --border-color: #e2e8f0;
  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #e0e7ff;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --method-get: #10b981;
  --method-post: #3b82f6;
  --method-put: #f59e0b;
  --method-delete: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --sidebar-width: 280px;
  --sidebar-width-tablet: 240px;
  --header-height-mobile: 60px;
}

/* Dark theme colors */
body.dark-theme {
  --bg-color: #0f172a;
  --bg-secondary: #1e293b;
  --text-color: #e2e8f0;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #312e81;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    "Helvetica Neue", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

code {
  font-family: "JetBrains Mono", monospace;
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  word-break: break-word;
}

pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  line-height: 1.5;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  word-break: normal;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Mobile Header (only visible on mobile) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height-mobile);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  z-index: 20;
  align-items: center;
  justify-content: space-between;
}

.mobile-header .logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-header .logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.mobile-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.sidebar-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background-color: var(--accent-light);
  color: var(--accent-color);
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
}

.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
}

.api-status {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.api-status h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.status-badge {
  width: 100%;
  border-radius: 6px;
  transition: transform 0.2s;
}

.status-badge:hover {
  transform: scale(1.02);
}

.sidebar-section {
  padding: 1.5rem;
}

.sidebar-section h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 500;
  transition: background-color 0.2s;
}

.sidebar-nav a:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.sidebar-nav a.active {
  background-color: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

.sidebar-nav i {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #5865f2;
  color: white;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  margin-bottom: 1rem;
  transition: background-color 0.2s;
}

.discord-btn:hover {
  background-color: #4752c4;
  color: white;
}

.discord-btn i {
  font-size: 1.1rem;
}

.request-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: var(--accent-light);
  border-radius: 6px;
  font-size: 0.875rem;
}

.counter {
  font-weight: 600;
  color: var(--accent-color);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-content h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.header-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  color: var(--text-color);
  font-size: 1.2rem;
  transition: background-color 0.3s, transform 0.3s;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  background-color: var(--accent-light);
  transform: scale(1.1);
}

/* Intro Section */
.intro-section {
  margin-bottom: 3rem;
}

.intro-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.intro-card h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.intro-card p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.base-url {
  background-color: var(--accent-light);
  padding: 1rem;
  border-radius: 6px;
}

.base-url h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.base-url code {
  display: block;
  padding: 0.75rem;
  background-color: var(--code-bg);
  border-radius: 4px;
  font-size: 0.95rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* API Sections */
.api-section {
  margin-bottom: 3rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.api-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.api-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.api-name h3 {
  font-size: 1.25rem;
  margin: 0;
}

.method {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.method.get {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--method-get);
}

.method.post {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--method-post);
}

.method.put {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--method-put);
}

.method.delete {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--method-delete);
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.key-badge {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color 0.2s;
}

.toggle-btn:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.api-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.api-content.active {
  max-height: 2000px;
  transition: max-height 0.5s ease-in-out;
}

.api-description {
  padding: 1.5rem 1.5rem 0;
  font-size: 1.05rem;
}

.endpoint {
  padding: 1.5rem 1.5rem 0;
}

.endpoint h4,
.parameters h4,
.examples h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.parameters {
  padding: 1.5rem 1.5rem 0;
}

.params-table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

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

.params-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.examples {
  padding: 1.5rem;
}

.example-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.example-tabs::-webkit-scrollbar {
  height: 4px;
}

.example-tabs::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.example-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.tab-btn.active {
  background-color: var(--accent-color);
  color: white;
}

.example-content {
  margin-bottom: 1.5rem;
}

.tab-content {
  display: none;
}

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

.response-example h4 {
  margin-top: 1.5rem;
}

/* Loading and Error States */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent-light);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--error-color);
}

.error-container i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.skeleton-loader {
  height: 200px;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--accent-light) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Footer */
.main-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .main-content {
    max-width: 100%;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: var(--sidebar-width-tablet);
  }

  .sidebar {
    width: var(--sidebar-width);
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  .header-content h1 {
    font-size: 1.75rem;
  }

  .header-content p {
    font-size: 1rem;
  }

  .intro-card h2 {
    font-size: 1.35rem;
  }

  .intro-card p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .api-name h3 {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile);
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    z-index: 30;
    top: var(--header-height-mobile);
    height: calc(100vh - var(--header-height-mobile));
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header {
    display: none;
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .header-actions {
    align-self: flex-end;
  }

  .main-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .api-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .api-actions {
    align-self: flex-end;
    margin-top: -2.5rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
  }

  .header-content h1 {
    font-size: 1.5rem;
  }

  .intro-card,
  .api-card {
    padding: 1rem;
  }

  .intro-card h2 {
    font-size: 1.25rem;
  }

  .api-description,
  .endpoint,
  .parameters,
  .examples {
    padding: 1rem 1rem 0;
  }

  .examples {
    padding: 1rem;
  }

  .api-name {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .api-actions {
    margin-top: 0.5rem;
    align-self: flex-start;
  }

  .api-header {
    padding: 1rem;
  }

  .section-title {
    font-size: 1.25rem;
  }
}

/* Add this to your HTML to support mobile navigation */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 25;
}

.overlay.active {
  display: block;
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.word-break {
  word-break: break-word;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
