/* STE Rules Template CSS - Improved readability and simplified design */

/* Base typography improvements */
html body {
  line-height: 1.6;
  font-size: 16px;
  color: #333;
}

/* Navigation styling - Simplified and more readable */
html body .rules-navigation {
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

html body .rules-navigation h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

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

html body .nav-category {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html body .nav-category:hover {
  background: #0077cc;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,119,204,0.2);
  border-color: #0077cc;
}

html body .nav-category a {
  text-decoration: none;
  color: inherit;
  display: block;
  font-weight: 500;
}

html body .category-emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.5rem;
}

html body .nav-category strong {
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}

html body .nav-category div {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Category sections - Simplified and more readable */
html body .category-section {
  margin-bottom: 5rem;
  scroll-margin-top: 120px;
}

html body .category-header {
  background: linear-gradient(135deg, #0077cc, #005aa3);
  color: white;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  text-align: center;
}

html body .category-header div:first-child {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

html body .category-header h2 {
  color: white;
  margin-bottom: 1rem;
  font-size: 2.2rem;
  font-weight: 600;
}

html body .category-description {
  font-size: 1.1rem;
  opacity: 0.95;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
}

/* Rule card styling - Improved readability */
html body .rule-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

html body .rule-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
  border-color: #0077cc;
}

html body .rule-header {
  background: #f8f9fa;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

html body .rule-number {
  background: #0077cc;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  min-width: 50px;
  text-align: center;
  flex-shrink: 0;
}

html body .rule-title {
  flex: 1;
  margin: 0;
  color: #2c3e50;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

html body .rule-content {
  padding: 2rem;
}

html body .rule-explanation {
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Examples styling - Clearer distinction */
html body .rule-examples {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  border-left: 4px solid #0077cc;
}

html body .rule-examples h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

html body .example-item {
  margin-bottom: 1.2rem;
  padding: 0.75rem;
  border-radius: 6px;
  background: white;
  border-left: 3px solid transparent;
}

html body .example-item:last-child {
  margin-bottom: 0;
}

html body .example-good {
  color: #155724;
  font-weight: 500;
  border-left-color: #28a745;
  background: #f8fff9;
}

html body .example-bad {
  color: #721c24;
  font-weight: 500;
  border-left-color: #dc3545;
  background: #fff5f5;
}

/* Rule summary styling */
html body .rule-summary {
  background: #e7f3ff;
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

html body .rule-summary h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

html body .rule-summary p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Container improvements */
html body .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* General spacing improvements */
html body section {
  padding: 2rem 0;
}

html body section:first-child {
  padding-top: 0;
}

/* Back to top button */
html body .back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

html body .back-to-top:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

html body .back-to-top.visible {
  opacity: 1;
}

/* Utility classes for better visual separation */
html body .section-divider {
  border-top: 2px solid #e9ecef;
  margin: 3rem 0;
  opacity: 0.7;
}

html body .text-muted {
  color: #6c757d;
  font-style: italic;
}

html body .highlight-text {
  background: linear-gradient(120deg, #84fab033 0%, #84fab033 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.2em;
  background-position: 0 88%;
  padding: 0 0.2em;
}

/* Focus and accessibility improvements */
html body .rule-card:focus-within {
  outline: 2px solid #0077cc;
  outline-offset: 2px;
}

html body .nav-category:focus {
  outline: 2px solid #0077cc;
  outline-offset: 2px;
}

/* Responsive design improvements */
@media (max-width: 768px) {
  html body .rules-navigation {
    position: static;
    margin-bottom: 1.5rem;
  }
  
  html body .nav-categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  html body .nav-category {
    padding: 0.75rem;
    min-height: 70px;
  }
  
  html body .category-emoji {
    font-size: 1.2rem;
  }
  
  html body .category-header {
    padding: 1.5rem;
  }
  
  html body .category-header h2 {
    font-size: 2rem;
  }
  
  html body .rule-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  html body .rule-number {
    align-self: flex-start;
  }
  
  html body .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  html body .nav-categories {
    grid-template-columns: 1fr;
  }
  
  html body .rules-navigation {
    padding: 1rem;
  }
  
  html body .category-header {
    padding: 1rem;
  }
  
  html body .category-header h2 {
    font-size: 1.5rem;
  }
  
  html body .rule-card {
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  html body .rule-content {
    padding: 1rem;
  }
  
  html body .rule-card h3 {
    font-size: 1.1rem;
  }
  
  html body .rule-card p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  html body .rule-examples {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  html body .example-item {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}
