/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  padding: 0;
  font-size: 18px; /* Increased from browser default (usually 16px) */
  line-height: 1.6; /* Better readability with increased line height */
}

/* ==========================================================================
   Layout & Structure
   ========================================================================== */
/* Header */
header {
  background-color: #764B93;
  min-height: 6rem;
  height: auto;
  width: 100%;
  margin-bottom: 30px;
  display: flex;
  align-items: center; /* Vertically center the content */
  padding: 1.25rem 0;
}

header .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  color: white;
  margin: 0;
  padding: 0;
  font-size: 3rem; 
  font-weight: 600; /* Slightly bolder */
}

/* Main Layout */
.page-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
  padding-left: 30px;
  border-left: 1px solid #eee;
}

/* Sidebar Navigation */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  padding-right: 20px;
  height: fit-content;
  margin-top: 30px;
}

.sidebar h3 {
  color: #764B93;
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.sidebar ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  color: #333;
  text-decoration: none;
  display: block;
  padding: 8px 12px; /* Larger click area */
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.sidebar a:hover {
  background-color: #f1f1f1;
  border-left-color: #764B93;
}

/* ==========================================================================
   Content Elements
   ========================================================================== */
blockquote {
  background-color: #f5f5f5;
  border-left: 4px solid #ddd;
  margin: 1.5em 0;
  padding: 1em;
  font-style: italic;
}

.bordered-image {
  border: 2px solid #764B93;
  border-radius: 4px;
  padding: 8px;
  display: block;
  margin: 20px auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  max-width: 100%;
}

pre {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 5px 0;
}

/* List Styling */
ul li {
  margin-bottom: 15px;
}

ul li:last-child {
  margin-bottom: 0;
}

/* Results Display */
.results {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
}

.adversary-type {
  margin-top: 15px;
  padding: 10px;
  border-left: 3px solid #764B93;
}

/* ==========================================================================
   Interactive Components
   ========================================================================== */
/* Tabs Component */
.tab-container {
  margin: 20px 0;
  border: 4px solid black; /* Adjust the thickness and color as needed */
  padding: 10px; /* Optional: Add padding for better spacing */
  border-radius: 4px;
  overflow: hidden;
  height: auto;      /* allow content to determine height */
  min-height: 12rem; /* optional minimum for visual balance */
}

.tabs {
  display: flex;
  background-color: #f1f1f1;
  border-bottom: 1px solid #ddd;
}

.tab-button {
  background-color: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 15px 20px;
  transition: 0.3s;
  font-size: 1.2rem;
  flex-grow: 1;
  font-weight: 500;
}

.tab-button:hover {
  background-color: #ddd;
}

.tab-button.active {
  background-color: #764B93;
  color: white;
}

.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

/* Slider Components */
.slider-container {
  margin: 10px 0;
  display: grid;
  grid-template-columns: 1fr 1fr; /* responsive two-column by default */
  align-items: center;
  gap: 10px;
  margin-left: 0; /* remove fixed left offset */
}

.slider-container label {
  font-weight: 500;
  font-size: 1.1rem;
}

.slider-container input[type="range"] {
  width: 100%;
}

.slider-container span {
  min-width: 80px;
  font-size: 1.1rem;
}

/* Money Slider Specific */
#money-slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

#money-slider-container label {
  width: auto;
  flex: 1 1 220px;
  min-width: 140px;
}

#money-slider {
  flex: 2 1 100%;
  width: 100% !important;
  max-width: 100%;
}

#money-slider-container span {
  flex: 0 0 auto;
}

/* Adjust headings to be larger */
h2 {
  font-size: 2.5rem; 
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

h3 {
  font-size: 1.8rem;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}

/* Small utility styles for page meta and simple pagers */
.page-meta {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.75rem;
}

.pager {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.98rem;
}

.pager a {
  color: #764B93; /* match header accent */
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.pager a:hover {
  background: rgba(118,75,147,0.08);
  border-color: rgba(118,75,147,0.12);
}

@media (max-width: 700px) {
  .page-container {
    padding: 0 12px;
    flex-direction: column; /* Stack sidebar above content */
  }
  .sidebar {
    display: block; /* Ensure Contents is visible on phones */
    position: static; /* Remove sticky on small screens */
    width: 100%;
    height: auto; /* Avoid Safari collapsing the box */
    margin-top: 0.5rem;
    padding-right: 0; /* Avoid extra right padding */
    border-bottom: 1px solid #eee; /* Visual separation */
    padding-bottom: 0.5rem;
  }
  .main-content {
    padding-left: 0; /* Remove left padding on small screens */
    border-left: none; /* Remove divider on small screens */
    margin-top: 0.75rem;
  }
  .pager { justify-content: space-between; width: 100%; }
}

@media (max-width: 520px) {
  .slider-container {
    grid-template-columns: 1fr; /* stack sliders on very small screens */
  }
  .main-content {
    border-left: none;
    padding-left: 0.5rem;
  }
}

/* Site footer */
.site-footer {
  margin-top: 2.5rem;
  padding: 12px 20px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between; /* two columns: left text, right logo */
  gap: 16px;
}
.site-footer a { color: #764B93; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Footer columns */
.site-footer .footer-left {
  text-align: left;
}
.site-footer .footer-right {
  margin-left: auto;
  text-align: right;
}
.site-footer .footer-right img {
  max-width: 120px;
  height: auto;
}

@media (max-width: 520px) {
  .site-footer {
    flex-direction: row;
    align-items: center;
  }
  .site-footer .footer-right img {
    max-width: 90px;
  }
}