/* 
 * Rules Pages Sidebar Navigation
 * Fixed sidebar that doesn't scroll with page content
 */

/* Rules container layout */
.rules-container {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* Fixed Sidebar Navigation */
.rules-sidebar {
  position: fixed;
  top: 100px; /* Account for header */
  left: 2rem;
  width: 280px;
  height: calc(100vh - 120px);
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

/* Sidebar scrollbar styling */
.rules-sidebar::-webkit-scrollbar {
  width: 6px;
}

.rules-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.rules-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 102, 0, 0.3);
  border-radius: 3px;
}

.rules-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 102, 0, 0.5);
}

/* Sidebar header */
.rules-nav-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-nav-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rules-version,
.rules-endorsement {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0.25rem 0;
}

/* Navigation list */
.rules-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rules-nav li {
  margin-bottom: 0.25rem;
}

/* Navigation links */
.rules-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.rules-nav-link:hover {
  background: rgba(255, 102, 0, 0.1);
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.rules-nav-link.active {
  background: rgba(255, 102, 0, 0.2);
  color: var(--brand-primary);
  font-weight: 500;
  border-left: 3px solid var(--brand-primary);
  padding-left: calc(0.75rem - 3px);
}

/* Sub-navigation */
.rules-subnav {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.5rem 1rem;
}

.rules-subnav .rules-nav-link {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  color: rgba(255, 255, 255, 0.6);
}

.rules-subnav .rules-nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.rules-subnav .rules-nav-link.active {
  background: rgba(255, 102, 0, 0.15);
  color: var(--brand-primary);
  border-left: 2px solid var(--brand-primary);
  padding-left: calc(0.6rem - 2px);
}

/* Main content area - offset for fixed sidebar */
.rules-content {
  margin-left: 320px; /* Sidebar width + gap */
  width: calc(100% - 320px);
  background: rgba(26, 31, 46, 0.4);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

/* Rule sections */
.rule-section {
  margin-bottom: 3rem;
  scroll-margin-top: 120px; /* Account for fixed header */
}

.rule-header {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 102, 0, 0.3);
}

.rule-content {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}

/* Mobile responsive - hide sidebar on small screens */
@media (max-width: 1024px) {
  .rules-sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s ease;
  }
  
  .rules-sidebar.active {
    left: 0;
  }
  
  .rules-content {
    margin-left: 0;
    width: 100%;
  }
  
  /* Add mobile menu toggle button */
  .rules-mobile-toggle {
    display: block;
    position: fixed;
    top: 100px;
    left: 1rem;
    z-index: 101;
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  .rules-container {
    flex-direction: column;
    padding: 1rem;
  }
  
  .rules-sidebar {
    width: 100%;
    height: auto;
    position: static;
    margin-bottom: 1rem;
  }
  
  .rules-content {
    padding: 1rem;
  }
  
  .rule-header {
    font-size: 1.5rem;
  }
}

/* Desktop only - ensure sidebar stays fixed */
@media (min-width: 1025px) {
  .rules-mobile-toggle {
    display: none;
  }
  
  .rules-sidebar {
    left: 2rem !important;
  }
}