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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, #ec0000 0%, #d40000 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(236, 0, 0, 0.15);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  display: flex;
  justify-content: flex-start;
  margin-left: 100px;
  flex: 1;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.nav-menu a:hover {
  opacity: 0.8;
}

/* Main Content */
main {
  margin-top: 70px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #ec0000 0%, #d40000 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: white;
  color: #ec0000;
}

.btn-primary:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #ec0000;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Styles */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* API Cards Grid */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.api-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #e9ecef;
}

.api-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(236, 0, 0, 0.15);
  border-color: #ec0000;
}

.api-card h3 {
  color: #ec0000;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-card p {
  color: #6c757d;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.api-card .endpoint {
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #495057;
  margin-bottom: 1rem;
}

/* Quick Start Section */
.quick-start {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin: 2rem 0;
}

.quick-start h3 {
  color: #ec0000;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.quick-start ol {
  padding-left: 1.5rem;
}

.quick-start li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.code-block {
  background: #2d3748;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  margin: 1rem 0;
}

/* Glossary */
.glossary {
  background: #f8f9fa;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.glossary-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.glossary-item h4 {
  color: #ec0000;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Footer */
.footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
}

/* API Documentation Styles (when showing ReDoc) */
.api-documentation {
  display: none;
  padding-top: 70px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.api-documentation.active {
  display: block;
}

.landing-page.hidden {
  display: none !important;
}

/* ReDoc Container - prevent duplicates and scroll issues */
#redoc-container {
  width: 100%;
  height: auto;
  overflow: visible;
  position: relative;
}

#redoc-container > div {
  width: 100% !important;
  overflow: visible !important;
}

/* Prevent ReDoc scroll conflicts */
.redoc-wrap {
  max-width: none !important;
  overflow: visible !important;
}

/* Fix ReDoc menu scroll issues */
[role="navigation"] {
  position: fixed !important;
  top: 70px !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 70px) !important;
}

/* Ensure content doesn't duplicate */
.api-documentation * {
  box-sizing: border-box;
}

/* Hide multiple instances of the same content */
#redoc-container > div:not(:first-child) {
  display: none !important;
}

/* Back Button */
.back-btn {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: #ec0000;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: none;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
  z-index: 10;
}

.back-btn:hover {
  background: #d40000;
}

.back-btn.visible {
  display: inline-block;
}

/* ReDoc Specific Styles */
.redoc-container {
  margin-top: 0;
  padding-top: 20px;
}

/* ReDoc override styles */
[data-section-id="section/Authentication"] {
  margin-top: 20px;
}

/* Improve ReDoc readability and prevent duplicates */
.redoc-wrap {
  max-width: none !important;
}

/* Prevent ReDoc from creating duplicate navigation elements */
.redoc-summary {
  position: relative !important;
}

/* Fix scroll behavior in ReDoc */
body.redoc-body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Ensure only one ReDoc instance is visible */
#redoc-container .redoc-wrap:not(:first-child) {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .nav-menu {
    display: none;
  }

  .back-btn {
    font-size: 12px;
    padding: 6px 12px;
    left: 10px;
  }

  .logo {
    margin-left: 70px;
  }

  .header-content {
    padding: 0 1rem;
  }
  
  .api-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 1rem;
  }
}