/* 
 * Rules Page Styles - Rosewood Ridge Site
 * Web 3.0 Design System
 */

@import url('variables.css');

/* RP Term Definitions for Featured Snippets */
.rp-definitions {
  max-width: 900px;
  margin: 1.5rem auto 2rem;
  padding: 1.5rem 2rem;
  background: var(--container-bg);
  border-radius: var(--border-radius-std);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-definitions h2 {
  color: var(--text-secondary-color);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.3rem;
}

.rp-definitions dl {
  margin: 0;
}

.rp-definitions dt {
  color: var(--highlight-color);
  font-size: 1.05rem;
  margin-top: 1rem;
}

.rp-definitions dd {
  margin-left: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.9;
}

/* Rules page base */
.rules-page {
  scroll-behavior: smooth;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 1.5rem 2rem 235px;
  overflow-x: hidden;
}

/* Rules header and title styling */
.rules-header {
  text-align: center;
  margin-bottom: 3rem;
}

/* Header SVG icon */
.rules-header-icon {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  color: var(--highlight-color);
  opacity: 0.7;
  animation: rulesPulse 3s ease-in-out infinite;
}

/* SOP department logo */
.sop-logo {
  display: block;
  width: 240px;
  height: 240px;
  margin: 3rem auto 1.5rem;
  border-radius: 50%;
  filter: grayscale(100%) brightness(1.8) contrast(1.1);
  opacity: 0.85;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.sop-logo:hover {
  opacity: 1;
  filter: grayscale(100%) brightness(2) contrast(1.15);
}

/* SOP subtitle line */
.sop-subtitle {
  display: block;
  font-size: 0.52em;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary-color);
  margin-top: 0.25rem;
}

@keyframes rulesPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Section icons */
.section-icon {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 0.5rem;
  color: var(--highlight-color);
  flex-shrink: 0;
}

.rules-section h2 {
  display: flex;
  align-items: center;
}

/* Danger variant for zero-tolerance sections */
.rules-section--danger {
  border-color: var(--error-color, #d9534f);
  background: linear-gradient(135deg, var(--container-bg) 0%, rgba(217, 83, 79, 0.06) 100%);
}

.rules-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.rules-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: var(--highlight-color);
}

.rules-header p {
  font-size: 1.2rem;
  color: var(--text-secondary-color);
  max-width: 800px;
  margin: 1rem auto;
  line-height: 1.6;
}

/* Rules content layout */
.rules-container {
  margin: 2rem 0;
}

.rules-sidebar {
  position: fixed;
  left: 0;
  top: calc(var(--header-height, 60px) + 0.5rem);
  width: 220px;
  background: var(--container-bg);
  border-radius: 0 var(--border-radius-std) var(--border-radius-std) 0;
  padding: 1rem 0.75rem;
  box-shadow: var(--box-shadow-std);
  border: 1px solid var(--accent-color);
  border-left: none;
  max-height: calc(100vh - var(--header-height, 60px) - 1rem);
  overflow-y: auto;
  font-size: 0.85rem;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight-color) rgba(20, 20, 20, 0.4);
}

.rules-sidebar::-webkit-scrollbar {
  width: 5px;
}

.rules-sidebar::-webkit-scrollbar-track {
  background: rgba(20, 20, 20, 0.4);
  border-radius: 4px;
}

.rules-sidebar::-webkit-scrollbar-thumb {
  background: var(--highlight-color);
  border-radius: 4px;
}

.rules-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--bright-accent);
}

.rules-content {
  min-width: 0;
}

/* Rules navigation */
.rules-nav {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.rules-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--highlight-color);
  color: var(--text-color);
}

.rules-nav li {
  margin-bottom: 0.25rem;
}

.rules-nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: var(--border-radius-std);
  transition: background-color 0.2s, color 0.2s;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rules-nav a:hover, .rules-nav a.active {
  background-color: var(--highlight-color);
  color: var(--text-color);
}

.rules-nav a.active {
  font-weight: 600;
}

/* Rules section styling */
.rules-section {
  background: var(--container-bg);
  border-radius: var(--border-radius-std);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow-std);
  border: 1px solid var(--accent-color);
}

.rules-section:last-child {
  margin-bottom: 0;
}

.rules-section h2 {
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--highlight-color);
  color: var(--text-color);
}

.rules-section h3 {
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-color);
}

.rules-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-secondary-color);
}

/* Rules list styling */
.rules-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.rules-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text-secondary-color);
}

.rules-list li::marker {
  color: var(--highlight-color);
}

/* Important rule highlight */
.rule-important {
  background: rgba(125, 56, 45, 0.2);
  border-left: 4px solid var(--highlight-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--border-radius-std) var(--border-radius-std) 0;
}

.rule-important p {
  margin: 0;
  color: var(--text-color);
}

.rule-important-title {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--highlight-color);
}

/* Rules note */
.rule-note {
  background: rgba(40, 40, 40, 0.3);
  border-left: 4px solid var(--dark-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--border-radius-std) var(--border-radius-std) 0;
}

.rule-note p {
  margin: 0;
  font-style: italic;
}

/* Rules table */
.rules-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.rules-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--border-radius-std);
  overflow: hidden;
}

.rules-table thead {
  background: var(--gradient-accent);
}

.rules-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.rules-table tbody tr {
  background-color: rgba(255, 255, 255, 0.03);
  transition: background-color 0.2s;
}

.rules-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.rules-table tbody tr:hover {
  background-color: rgba(125, 56, 45, 0.1);
}

.rules-table td {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--dark-accent);
}

.rules-table td:first-child {
  font-weight: 500;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--highlight-color);
  color: var(--text-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--bright-accent);
  color: var(--text-color);
}

/* Code inline for command references */
.rules-section code {
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--highlight-color);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .rules-page {
    padding-left: 1.5rem;
  }
  
  .rules-sidebar {
    position: relative;
    left: auto;
    top: 0;
    width: 100%;
    max-height: none;
    overflow: visible;
    border-radius: var(--border-radius-std);
    border-left: 1px solid var(--accent-color);
    margin-bottom: 1.5rem;
  }
  
  .rules-section {
    padding: 1.5rem;
  }
}