/* Simplified Algorithm Pages Styling */

/* Basic algorithm page container - minimal styling */
.algorithm-isolation-container {
  /* Simple containment without interference */
  position: relative;
  width: 100%;
}

.algorithm-page {
  /* Standard content spacing */
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Algorithm Header - Simplified */
.algorithm-header {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.algorithm-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  background: #007bff;
  color: white;
  margin-bottom: 1rem;
}

.algorithm-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: #212529;
}

.algorithm-header .subtitle {
  font-size: 1.25rem;
  color: #6c757d;
  font-weight: 400;
}

/* Meta Information */
.algorithm-meta {
  margin-top: 1.5rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.meta-value {
  font-weight: 600;
  font-size: 1rem;
  color: #212529;
}

/* Quick Navigation - Simplified */
.quick-nav {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.quick-nav h3 {
  margin: 0 0 1rem 0;
  color: #495057;
  font-size: 1.125rem;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.quick-nav .nav-item {
  display: block;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  text-decoration: none;
  color: #495057;
  font-weight: 500;
  transition: all 0.2s ease;
}

.quick-nav .nav-item:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  text-decoration: none;
  color: #212529;
}

/* Features Grid - Simple */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.feature-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.feature-content h4 {
  margin: 0 0 0.5rem 0;
  color: #212529;
  font-size: 1.125rem;
  font-weight: 600;
}

.feature-content p {
  margin: 0;
  color: #6c757d;
  line-height: 1.5;
}

/* Parameters Grid - Simple */
.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.param-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.param-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.param-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
}

.param-value.highlight {
  color: #007bff;
}

.param-desc {
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.4;
}

/* Code Examples - Simple */
.code-example {
  margin: 2rem 0;
}

.code-example h3 {
  color: #212529;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.code-tabs {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  background: #f8f9fa;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-title {
  font-weight: 600;
  color: #495057;
}

.code-lang {
  font-size: 0.875rem;
  color: #6c757d;
  background: #e9ecef;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

/* Tables - Simple */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

tr:hover {
  background: #f8f9fa;
}

/* Use Cases - Simple */
.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.use-case-category {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border-left: 4px solid #007bff;
}

.use-case-category h4 {
  margin: 0 0 1rem 0;
  color: #212529;
  font-size: 1.125rem;
}

.use-case-category ul {
  margin: 0;
  padding-left: 1.5rem;
}

.use-case-category li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Security Sections - Simple */
.security-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-left: 4px solid #f39c12;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.security-warning h3 {
  color: #856404;
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
}

.security-warning ul {
  margin: 0;
  padding-left: 1.5rem;
}

.security-warning li {
  margin-bottom: 0.75rem;
  color: #856404;
  line-height: 1.5;
}

/* Overview Box - Simple */
.overview-box {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.overview-content p {
  margin: 0;
  color: #1565c0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .algorithm-page {
    padding: 1rem 0;
  }
  
  .algorithm-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }
  
  .algorithm-header h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .algorithm-header .subtitle {
    font-size: 1.125rem;
  }
  
  .meta-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .nav-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }
  
  .feature-icon {
    font-size: 1.75rem;
  }
  
  .params-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .param-card {
    padding: 1rem;
  }
  
  .param-value {
    font-size: 1.125rem;
  }
  
  .use-cases {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .use-case-category {
    padding: 1.25rem;
  }
  
  .quick-nav {
    padding: 1rem;
  }
  
  .code-example h3 {
    font-size: 1.125rem;
  }
  
  .code-header {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .related-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .algorithm-header {
    padding: 1rem 0.75rem;
  }
  
  .algorithm-header h1 {
    font-size: 1.75rem;
  }
  
  .algorithm-badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .params-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-card,
  .param-card,
  .related-card {
    padding: 0.875rem;
  }
  
  .quick-nav .nav-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }
  
  .use-case-category {
    padding: 1rem;
  }
  
  .security-warning,
  .overview-box {
    padding: 1rem;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .params-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .use-cases {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Related Algorithms - Simple */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-card:hover {
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.related-content h4 {
  margin: 0 0 0.5rem 0;
  color: #212529;
  font-size: 1rem;
  font-weight: 600;
}

.related-content p {
  margin: 0;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Security color indicators */
.security-high { color: #4CAF50; }
.security-medium { color: #FF9800; }
.security-low { color: #F44336; }
.security-partial { color: #FFC107; }