/* Landing page styles for DB Viewer Demo */
/* Optimized for SEO, Accessibility and Performance */

/* Add optimized loading hints for fonts to improve CLS (Cumulative Layout Shift) */

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.hero-section {
  padding: 80px 20px;
  text-align: center;
  background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 100%);
  border-radius: 12px;
  margin-bottom: 60px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: linear-gradient(
    135deg,
    rgba(88, 104, 224, 0.1) 0%,
    rgba(88, 104, 224, 0) 70%
  );
  border-radius: 50%;
  top: -150px;
  left: -150px;
  z-index: 0;
}

.hero-section::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: linear-gradient(
    135deg,
    rgba(88, 104, 224, 0.1) 0%,
    rgba(88, 104, 224, 0) 70%
  );
  border-radius: 50%;
  bottom: -150px;
  right: -150px;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  color: #333;
  margin-bottom: 10px;
}

.hero-slogan {
  font-size: 24px;
  font-weight: 600;
  color: #5868e0;
  margin-bottom: 20px;
  font-style: italic;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 20px;
  color: #666;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  padding: 16px 32px;
  background-color: #5868e0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(88, 104, 224, 0.3);
  text-align: center;
  min-width: 180px;
  box-sizing: border-box;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(88, 104, 224, 0.4);
  background-color: #4959ca;
}

.features-section {
  padding: 40px 0;
  margin-bottom: 60px;
}

.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 50px;
}

.features-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.feature-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 30px;
  width: calc(33.333% - 30px);
  min-width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f3ff;
  border-radius: 50%;
}

.feature-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.feature-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
}

.demo-section {
  background-color: #f5f7ff;
  padding: 60px 20px;
  border-radius: 12px;
  text-align: center;
}

.demo-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.demo-cta {
  display: inline-block;
  padding: 14px 28px;
  background-color: #5868e0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.demo-cta:hover {
  background-color: #4959ca;
}

/* GitHub section styling */
.github-section {
  padding: 3rem 1rem;
  text-align: center;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.github-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem auto;
  max-width: 500px;
}

.github-link {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background-color: #24292e;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 80px;
}

.github-link:hover {
  background-color: #2c3137;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.github-link svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 4px;
}

.link-content {
  flex: 1;
}

.link-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #fff;
}

.link-description {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.4;
}

.github-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px 0 40px 0;
  flex-wrap: wrap;
}

.github-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.stat-icon {
  font-size: 18px;
}

.stat-text {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

@media (min-width: 768px) {
  .github-links {
    flex-direction: row;
    justify-content: center;
    max-width: 800px;
  }
}

/* Mobile Responsive Styling */
@media (max-width: 768px) {
  /* Hero Section */
  .landing-container {
    padding: 20px 0; /* Remove horizontal padding */
  }

  .hero-section {
    padding: 40px 15px;
    margin-bottom: 30px;
    margin-left: 0;
    margin-right: 0;
  }

  .hero-title {
    font-size: 2rem; /* Smaller title on mobile */
    margin-bottom: 15px; /* Reduced bottom margin */
    padding: 0 10px; /* Added horizontal padding */
  }

  .hero-slogan {
    font-size: 1.2rem; /* Smaller slogan on mobile */
    margin-bottom: 15px; /* Reduced bottom margin */
    padding: 0 10px; /* Added horizontal padding */
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 25px; /* Reduced margin */
    padding: 0 5px; /* Added horizontal padding */
  }

  .hero-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
    margin: 25px 0; /* Adjusted vertical margin */
  }

  .stat-item {
    padding: 10px;
    flex: 1;
    width: auto;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .hero-cta {
    width: 100%;
    max-width: 300px;
    text-align: center;
    margin: 0;
  }

  /* Features Section */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .feature-card {
    padding: 20px;
  }

  /* Installation Section */
  .installation-section {
    padding: 30px 0; /* Removed horizontal padding */
  }

  .installation-steps {
    grid-template-columns: 1fr;
    gap: 30px; /* Increased gap between steps */
    margin-bottom: 30px;
    padding: 15px 0 0 0; /* Removed horizontal padding */
  }

  .step-card {
    padding: 25px 0; /* Removed horizontal padding */
    padding-top: 30px; /* More top padding for mobile */
    margin: 0; /* Removed horizontal margins */
    width: 100%; /* Force full width */
    margin-top: 25px; /* Increased top margin to account for the step number */
  }

  .step-number {
    top: -20px; /* Position further up for better visibility */
    left: 25px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .advanced-config {
    padding: 25px 0; /* Removed horizontal padding */
    margin-top: 30px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 0; /* Remove border radius */
  }

  .advanced-config .code-block {
    max-width: 100%; /* Override max-width constraint on mobile */
    margin: 0; /* Remove auto margins */
    width: 100%;
    border-radius: 0;
  }

  /* Code Block Styling */
  .code-block {
    margin-bottom: 15px;
    max-width: none; /* Remove max-width constraint */
    width: 100%; /* Force full width */
    margin-left: 0; /* Remove auto margins */
    margin-right: 0;
    box-sizing: border-box;
    border-radius: 0; /* Remove border radius on mobile */
    border-left: none;
    border-right: none;
  }

  .code-block pre {
    padding: 12px 0; /* Remove horizontal padding */
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    -webkit-overflow-scrolling: touch; /* Enhanced smooth scrolling on iOS */
  }

  .code-header {
    padding: 10px 6px; /* Reduced horizontal padding */
    flex-wrap: wrap;
  }

  .copy-btn {
    padding: 5px 10px;
    margin-left: auto;
  }

  /* Github Section */
  .github-stats {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .github-stat {
    width: 100%;
    text-align: center;
    margin: 5px 0;
  }

  .github-links {
    flex-direction: column;
    gap: 15px;
  }

  .github-link {
    width: 100%;
    padding: 15px;
  }
}

/* Extra small screens optimization (iPhone SE, etc) */
@media (max-width: 375px) {
  .hero-title {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .hero-slogan {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .hero-cta {
    padding: 12px 20px;
    font-size: 14px;
  }

  .hero-stats {
    gap: 8px;
    margin: 20px 0;
  }

  .stat-number {
    font-size: 18px;
  }

  .stat-label {
    font-size: 12px;
  }

  .stat-item {
    padding: 5px;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 30px;
  }

  .installation-section {
    padding: 25px 10px;
  }

  .step-content h3 {
    font-size: 16px;
  }

  .step-number {
    top: -20px;
    left: 20px;
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-width: 2px;
  }

  .code-block pre {
    padding: 8px 0; /* Removed horizontal padding */
    font-size: 0.75rem;
    width: 100%;
  }

  .code-header {
    padding: 8px 4px;
    width: 100%;
    box-sizing: border-box;
  }

  .copy-btn {
    padding: 3px 8px;
    font-size: 10px;
  }

  .code-block code {
    font-size: 0.75rem;
    padding-left: 4px !important; /* Small left padding for readability */
  }

  .advanced-config {
    padding: 20px 0; /* Removed horizontal padding */
    width: 100%;
    box-sizing: border-box;
    border-radius: 0;
  }

  .advanced-config h3 {
    font-size: 16px;
  }

  /* Ensure code blocks use full width on smallest screens */
  .code-block,
  .code-block pre,
  .code-header {
    width: 100%;
    box-sizing: border-box;
    max-width: none;
  }
}

/* Very small screens optimization */
@media (max-width: 320px) {
  .hero-stats {
    gap: 5px;
  }

  .stat-number {
    font-size: 16px;
  }

  .stat-label {
    font-size: 10px;
  }

  /* Full-width code blocks for tiny screens */
  .code-block,
  .advanced-config .code-block {
    width: 100%;
    margin: 0 0 15px 0;
    padding: 0;
    border-radius: 0;
  }

  .code-block pre {
    padding: 6px 0;
    font-size: 0.7rem;
  }

  .code-header {
    padding: 6px 2px;
  }

  .advanced-config {
    padding: 15px 0;
    border-radius: 0;
  }

  .landing-container {
    padding: 15px 0;
  }
}

/* Footer styling */
.footer {
  padding: 2rem 1rem;
  text-align: center;
  background-color: #343a40;
  color: #ffffff;
  font-size: 0.9rem;
  width: 100%;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  box-sizing: border-box;
}

/* Installation section styles */
.installation-section {
  padding: 60px 20px;
  margin-bottom: 60px;
  background-color: #ffffff;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  overflow: hidden; /* Contain any overflow */
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: #666;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.installation-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 5px;
  padding-top: 15px; /* Added top padding for the grid to accommodate step numbers */
}

.step-card {
  background-color: #fff;
  border: 2px solid #f1f3ff;
  border-radius: 12px;
  padding: 30px;
  padding-top: 35px; /* Increased top padding to make room for the step number */
  margin-top: 20px; /* Added top margin to provide space for the number */
  transition: all 0.3s ease;
  position: relative;
  overflow: visible; /* Changed to visible to ensure the number is not cut off */
  box-sizing: border-box;
  width: 100%;
}

.step-card:hover {
  border-color: #5868e0;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 104, 224, 0.1);
}

.step-number {
  position: absolute;
  top: -10px; /* Reduced negative top position */
  left: 30px;
  background: linear-gradient(135deg, #5868e0, #4959ca);
  color: white;
  width: 40px; /* Larger circle */
  height: 40px; /* Larger circle */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px; /* Larger font size */
  box-shadow: 0 4px 8px rgba(88, 104, 224, 0.4); /* Enhanced shadow */
  z-index: 10; /* Higher z-index */
  border: 2px solid white; /* Add a white border for better visibility */
}

.step-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  margin-top: 5px; /* Reduced top margin since we added padding to the parent */
}

.step-content p {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.code-block {
  background-color: #282c34;
  border: 1px solid #3e4451;
  border-radius: 8px;
  overflow: hidden;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.code-header {
  background-color: #21252b;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9da5b4;
  border-bottom: 1px solid #181a1f;
}

.code-language {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: #5868e0;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.copy-btn:hover {
  background: #4959ca;
}

.copy-btn:active {
  background: #3d4ab8;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  background-color: transparent !important;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  max-width: 100%;
}

.code-block code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  white-space: pre;
  display: inline-block;
  min-width: 100%;
  -webkit-text-size-adjust: none; /* Prevent iOS text size adjustment */
  tab-size: 2; /* Smaller tab size for mobile */
}

@media (max-width: 768px) {
  .code-block code {
    padding: 0 !important;
    margin: 0 !important;
  }
}

.advanced-config {
  background-color: #f5f7ff;
  padding: 40px;
  border-radius: 12px;
  margin-top: 40px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.advanced-config h3 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

.advanced-config p {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  text-align: center;
}

.advanced-config .code-block {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Hero section enhancements */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(88, 104, 224, 0.1);
  color: #5868e0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid rgba(88, 104, 224, 0.2);
}

.hero-badge svg {
  width: 16px;
  height: 16px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #5868e0;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
  font-weight: 500;
}

/* Hero CTA button enhancements */
.hero-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
  width: 100%;
  box-sizing: border-box;
}

.hero-cta.secondary {
  background-color: transparent;
  color: #5868e0;
  border: 2px solid #5868e0;
  box-shadow: 0 4px 12px rgba(88, 104, 224, 0.15);
}

.hero-cta.secondary:hover {
  background-color: #5868e0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(88, 104, 224, 0.3);
}

@media (max-width: 768px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Increased gap between buttons */
    margin-top: 30px; /* Added top margin */
    margin-bottom: 20px; /* Added bottom margin */
  }

  .hero-cta {
    width: 100%;
    max-width: 280px;
    text-align: center;
    padding: 14px 28px; /* Slightly smaller padding */
    font-size: 16px; /* Slightly smaller font */
    display: block; /* Ensure block display */
  }

  .hero-cta.secondary {
    margin-top: 5px; /* Extra margin for secondary button */
  }
}
