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

:root {
  --primary-color: #4f46e5;
  --primary-dark: #4338ca;
  --secondary-color: #10b981;
  --background: #f9fafb;
  --surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header - Top of Content Area */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 48px 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1rem;
  opacity: 0.95;
  font-weight: 400;
}

.base-url {
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
}

.base-url .label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  opacity: 0.9;
  font-weight: 500;
}

.base-url code {
  font-size: 0.95rem;
  color: white;
  font-weight: 600;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Navigation - Left Sidebar */
.navigation {
  width: 280px;
  background: var(--surface);
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-header {
  padding: 24px;
  border-bottom: 2px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.nav-logo {
  max-width: 160px;
  height: auto;
  margin-bottom: 12px;
  display: block;
}

.nav-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.nav-header p {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.9;
}

.nav-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-content::-webkit-scrollbar {
  width: 6px;
}

.nav-content::-webkit-scrollbar-track {
  background: transparent;
}

.nav-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.nav-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  display: block;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--background);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  height: 100vh;
  overflow-y: auto;
  background: var(--background);
}

.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: var(--background);
}

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

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.content-wrapper {
  padding: 48px 0;
}

.content-section {
  margin-bottom: 64px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 12px;
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Auth Section */
.auth-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.info-card {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.info-card.full-width {
  grid-column: 1 / -1;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.large-code {
  display: inline-block;
  background: var(--background);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

/* Endpoints */
.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Endpoint Groups */
.endpoint-group {
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.endpoint-group-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.endpoint-group-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.endpoint-group-path {
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 500;
}

.endpoint-group-methods {
  display: flex;
  flex-direction: column;
}

.endpoint-group-methods .endpoint-card {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
}

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

.endpoint-group-methods .endpoint-card:hover {
  box-shadow: none;
  border-color: var(--border-color);
  background: var(--background);
}

.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.endpoint-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.endpoint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.endpoint-header:hover {
  background: var(--background);
}

.endpoint-title-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.endpoint-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.endpoint-path {
  font-size: 0.95rem;
  color: var(--text-secondary);
  background: var(--background);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.method-badge {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  min-width: 80px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.expand-button {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  box-shadow: var(--shadow-sm);
}

.expand-button:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.endpoint-body {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.endpoint-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.section {
  margin-bottom: 32px;
}

.section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section h4::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* Tables */
.params-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.params-table thead {
  background: var(--primary-color);
  color: white;
}

.params-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.params-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.params-table tbody tr:hover {
  background: white;
}

.params-table code {
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.type-badge {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Code Block */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
  border: 1px solid #334155;
}

.code-block code {
  color: inherit;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .navigation {
    width: 250px;
  }

  .main-content {
    margin-left: 250px;
  }

  .nav-header h1 {
    font-size: 1.25rem;
  }

  .nav-header p {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .navigation {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }

  .main-content {
    margin-left: 0;
  }

  .app {
    flex-direction: column;
  }

  .nav-content {
    max-height: 300px;
  }

  .title {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

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

  .base-url {
    width: 100%;
  }

  .endpoint-title-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .method-badge {
    min-width: auto;
  }

  .params-table {
    font-size: 0.875rem;
  }

  .params-table th,
  .params-table td {
    padding: 10px 12px;
  }

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

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

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 32px 0;
  }

  .main-content {
    padding: 32px 0;
  }

  .endpoint-header {
    padding: 16px;
  }

  .endpoint-body {
    padding: 16px;
  }

  .params-table {
    display: block;
    overflow-x: auto;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--primary-color);
  color: white;
}
