:root {
  --primary: #b30000;
  --primary-light: #ff4d4d;
  --primary-dark: #8b0000;
  --secondary: #0066cc;
  --secondary-light: #4d94ff;
  --dark: #222;
  --gray: #666;
  --light-gray: #f5f5f5;
  --white: #fff;
  --border: #e0e0e0;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Roboto", sans-serif;
  color: var(--dark);
  line-height: 1.6;
  background-color: var(--light-gray);
  scroll-behavior: smooth;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 300px;
  background: linear-gradient(135deg, var(--dark) 0%, #2c2c2c 100%);
  color: var(--white);
  padding: 2rem 1rem;
  position: fixed;
  height: 100%;
  overflow-y: auto;
  box-shadow: 4px 0 15px var(--shadow);
  z-index: 100;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.logo:hover {
  background: rgba(255, 255, 255, 0.1);
}

.logo h1 {
  font-size: 1.4rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

.logo-icon {
  font-size: 2rem;
  color: var(--primary-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary-light);
  margin-bottom: 1rem;
  padding-left: 1rem;
  font-weight: 600;
  position: relative;
}

.nav-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 30px;
  height: 2px;
  background: var(--primary-light);
  border-radius: 1px;
}

.nav-link {
  display: block;
  padding: 0.8rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  margin-bottom: 0.3rem;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.3s ease;
  z-index: -1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 4px;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-left: 300px;
  padding: 3rem 4rem;
  max-width: calc(100% - 300px);
}

.header {
  margin-bottom: 4rem;
  text-align: center;
  padding: 2rem 0;
}

.header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
  color: var(--gray);
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* API Section Styles */
.api-section {
  margin-bottom: 4rem;
}

.api-section:last-child {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: var(--primary);
  padding-bottom: 0.8rem;
  border-bottom: 3px solid var(--primary-light);
  position: relative;
  font-weight: 600;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 60px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* Endpoint Card Styles */
.endpoint-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.endpoint-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

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

.method {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.method.get {
  background: rgba(82, 196, 26, 0.2);
  color: #52c41a;
}

.method.post {
  background: rgba(250, 173, 20, 0.2);
  color: #faad14;
}

.endpoint-path {
  font-family: "Source Code Pro", monospace;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
  min-width: 200px;
}

.endpoint-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-left: auto;
  color: var(--white);
}

.endpoint-body {
  padding: 2rem;
}

.endpoint-description {
  margin-bottom: 2rem;
  color: var(--gray);
  line-height: 1.7;
}

.subsection-title {
  font-size: 1.3rem;
  margin: 2rem 0 1rem 0;
  color: var(--primary);
  font-weight: 600;
  position: relative;
  padding-left: 1.5rem;
}

.subsection-title::before {
  content: "▶";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-light);
  font-size: 0.8rem;
}

/* Code Block Styles */
.code-block {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: "Source Code Pro", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1rem 0;
  position: relative;
  white-space: pre-wrap;
}

.code-block::before {
  content: "Code";
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.7rem;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-block::-webkit-scrollbar {
  height: 6px;
}

.code-block::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.code-block::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 3px;
}

/* Table Styles */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
}

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

.params-table th {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.params-table tr:hover {
  background: rgba(179, 0, 0, 0.02);
}

.params-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: "Source Code Pro", monospace;
  color: var(--primary);
  font-weight: 600;
  background: rgba(179, 0, 0, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.param-type {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: "Source Code Pro", monospace;
}

.param-required {
  color: var(--error);
  font-weight: 600;
}

/* Enhanced spacing for authentication endpoints */
.api-section[id^="auth"] .endpoint-card {
  margin-bottom: 3rem;
}

.api-section[id^="auth"] .endpoint-card:last-child {
  margin-bottom: 2rem;
}

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

  .main-content {
    margin-left: 250px;
    padding: 2rem 3rem;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    padding: 1.5rem;
  }

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

  .header h1 {
    font-size: 2.2rem;
  }

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

  .endpoint-title {
    margin-left: 0;
  }

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

  .params-table th,
  .params-table td {
    padding: 0.8rem;
  }
}

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

  .header h1 {
    font-size: 1.8rem;
  }

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

  .endpoint-body {
    padding: 1rem;
  }

  .code-block {
    font-size: 0.8rem;
    padding: 1rem;
  }

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

/* Animation and Transition Effects */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.endpoint-card {
  animation: fadeIn 0.5s ease-out;
}

.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--primary-light);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-link:hover::after {
  opacity: 1;
}

/* Focus States for Accessibility */
.nav-link:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .sidebar {
    display: none;
  }

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

  .endpoint-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

/* Mission Details Styles */
.mission-details {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
  }
  
  .mission-details li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2rem;
  }
  
  .mission-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
  }
  
  .permission-note {
    background-color: rgba(179, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
  }
  
  .permission-note h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
  }
  
  .permission-note ul {
    padding-left: 1.2rem;
  }
  
  .permission-note li {
    margin-bottom: 0.3rem;
  }

  .method.delete {
    background: rgba(255, 77, 79, 0.2); /* Using your error color */
    color: var(--error);
  }

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
  :root {
    --dark: #f5f5f5;
    --gray: #a0a0a0;
    --light-gray: #1a1a1a;
    --white: #2d2d2d;
    --border: #404040;
  }

  body {
    background-color: var(--light-gray);
    color: var(--dark);
  }

  .endpoint-card {
    background: var(--white);
    border-color: var(--border);
  }

  .endpoint-header {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
  }

  .code-block {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-color: var(--border);
    color: #e0e0e0;
  }

  .params-table th {
    background: linear-gradient(
      135deg,
      var(--primary) 0%,
      var(--primary-dark) 100%
    );
  }
}
