:root {
  /* Core Colors & Theme */
  --background-dark: #000000;
  --text-primary: #e5e5e5;
  --text-secondary: #8f8f8f;
  --highlight-teal: #6fffd9;
  --highlight-purple: #bf00ff;
  --border-color: #2a2a2a;
  --card-background-mobile: #222222;
  --header-background: #161616;
}

/* Base Styles */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body, html {
  margin: 0;
  overscroll-behavior: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background-dark);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  margin: 3rem 10rem;
}

h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--highlight-teal);
  font-size: 2.2rem;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: all-scroll;
  max-height: 65vh;
  padding-bottom: 1px;
  scrollbar-width: thin; /* For Firefox */
  scrollbar-color: var(--border-color) transparent; /* For Firefox */
  position: relative; /* For shadow positioning */
  border: solid 2px;
  border-color: var(--highlight-teal);
}

/* Remove all previous shadow implementations */
.table-wrapper::after,
.table-wrapper::before {
  display: none;
}

/* Custom scrollbar styling for WebKit browsers (Chrome, Safari, etc.) */
.table-wrapper::-webkit-scrollbar {
  height: 8px; /* Horizontal scrollbar height */
  width: 8px; /* Vertical scrollbar width */
}

.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* Change to auto to allow min-width to work */
}

th {
  background: var(--highlight-teal);
  color: #000000;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 1rem;
  white-space: nowrap;
  border-top: none;
  border-bottom: none !important;
  /* box-shadow: inset 0 0px 0, inset 0 -2px 0 var(--highlight-teal); */
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1.75rem;
  min-width: 160px; /* Minimum width for regular columns */
  width: 120px; /* Default width for regular columns */
}

th:first-child {
  font-weight: bold;
  color: #000000;
  background: var(--highlight-teal);
  position: sticky;
  left: 0;
  top: 0;
  letter-spacing: 0px;
  z-index: 999;
  min-width: 150px; /* Different minimum width for the first column */
  text-align: left;
  width: 150px; /* Default width for the first column */
   /* Inner shadow on the right side */
}

td {
  padding: 1rem 2rem;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  background: #0e0e0e;
  color: var(--text-primary);
   /* Minimum width for regular columns */
   /* Default width for regular columns */
}

td:first-child {
  font-weight: 700;
  color: var(--text-secondary);
  background-color: var(--header-background);
  position: sticky;
  left: 0;
  text-align: right;
  font-size: 0.75rem;
  z-index: 1;
  min-width: 150px; /* Different minimum width for the first column */
  letter-spacing: .5px;
  width: 150px; /* Default width for the first column */
  text-transform: uppercase;
  box-shadow: 5px 0 5px -5px rgba(0, 0, 0, 1); /* Inner shadow on the right side */
}

th .tool-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  font-weight: 500;
  text-transform: revert-layer;
}

th .tool-logo {
  max-height: 32px;
  max-width: 32px;
  display: block;
}

th .tool-name {
  display: block;
  font-size: 0.84rem;
  line-height: 1.2;
  font-weight: 700;
}

/* Style checkmarks and crosses */
.check, .cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.check:hover, .cross:hover {
  transform: scale(1.1);
}

.check svg {
  fill: var(--highlight-teal);
}

.cross svg {
  fill: none;
  stroke: #ff6b6b;
  stroke-width: 2;
  stroke-linecap: round;
}

.shadow-container {
    position: relative;
    width: 100%;
    height: 0;
    pointer-events: none;
}

.shadow-left {
    width: 30px;
    height: 60px;
    background: linear-gradient(90deg, #00000033, transparent);
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    margin-left: 195px;
    margin-top: 2px;
}

.shadow-right {
    width: 40px;
    height: 60px;
    background: linear-gradient(90deg, transparent, #0e0e0e80);
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    margin-right: 2px;
    margin-top: 2px;
    border-radius: 0px 6px 0px 0px;
}

thead {
    height: 60px;
}

/* --- Responsive Design --- */
@media screen and (max-width: 900px) {
  body {
    margin: 1.5rem;
  }
  
  .table-wrapper {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0;
  }
  
  table {
    table-layout: auto; /* Switch to auto layout on mobile */
    min-width: 800px;
  }
  
  th, td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    width: auto; /* Allow columns to size based on content */
    min-width: 150px;
  }
  
  th:first-child, td:first-child {
    width: 110px; /* Allow first column to size based on content */
    min-width: 90px;
    font-size: .7rem;
    font-weight: 600;
  }

  th .tool-logo {
    max-height: 25px;
    max-width: 28px;
  }
  
  th .tool-name {
    font-size: 0.85em;
  }
  
  .filter-pills {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    width: 100%;
  }
  
  .filter-pill {
    white-space: nowrap;
  }
  
  .controls-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-controls, .sort-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .sort-controls select {
    width: 100%;
  }

  .shadow-left {
    margin-left: 154px;
  }
}

/* --- Print Styles --- */
@media print {
  body {
    margin: 0;
    background: white;
    color: black;
  }
  
  .table-wrapper {
    max-height: none;
    overflow: visible;
  }
  
  table {
    border: 1px solid #ddd;
  }
  
  th, td {
    border: 1px solid #ddd;
    background: white !important;
    color: black !important;
  }
  
  th {
    background: #f5f5f5 !important;
  }
  
  td:first-child {
    background: #f5f5f5 !important;
  }
  
  .check svg {
    fill: black;
  }
  
  .cross svg {
    stroke: black;
  }
  
  .table-controls {
    display: none;
  }
  
  .page-header {
    background: none;
    border: none;
    margin-bottom: 1rem;
    padding: 0;
  }
  
  .page-header h1 {
    color: black;
  }
  
  .page-header .subtitle {
    color: #666;
  }
}

/* Remove individual antialiasing declarations */
/* Apply antialiasing to all text elements */
h1, h3, h4, h5, h6, p, span, div, label, select, option {
  /* Remove these lines */
  /* -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; */
}

/* Ensure form controls are crisp */
select, label {
  /* Remove these lines */
  /* -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; */
}

/* --- Page Header --- */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
}

.page-header h1 {
  color: #ffffff;
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.page-header .subtitle {
  color: #ffffff;
  font-size: 1.1rem;
  margin: 0;
}

/* --- Table Controls --- */
.table-controls {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--header-background);
  border-radius: 16px;
}

.controls-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.filter-controls, .sort-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-controls label, .sort-controls label {
  font-weight: 400;
  color: var(--text-primary);
  white-space: nowrap;
  font-size: .9rem;
}

.filter-controls select, .sort-controls select {
  background: var(--background-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-controls select:hover, .sort-controls select:hover {
  border-color: var(--highlight-teal);
}

.filter-controls select:focus, .sort-controls select:focus {
  outline: none;
  border-color: var(--highlight-teal);
  box-shadow: 0 0 0 2px rgba(111, 255, 217, 0.2);
}

/* Responsive adjustments for controls */
@media screen and (max-width: 768px) {
  .controls-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-controls, .sort-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .filter-controls select, .sort-controls select {
    flex: 1;
    max-width: 100%;
  }
}

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  background: var(--background-dark);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.filter-pill:hover {
  border-color: var(--highlight-teal);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--highlight-teal);
  color: var(--background-dark);
  border-color: var(--highlight-teal);
  /* font-weight: 600; */
}

/* Responsive adjustments for filter pills */
@media screen and (max-width: 768px) {
  .filter-pills {
    width: 100%;
    justify-content: center;
  }
}

/* Content Sections */
.content-sections {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.content-sections section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: #141414;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.content-sections h2 {
  font-size: 2rem;
  color: var(--highlight-teal);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  text-align: left;
}

.content-sections h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem;
}

.content-sections p {
  line-height: 1.6;
  color: #ffffff;
  margin-bottom: 1rem;
}

.content-sections ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.content-sections ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.6;
  color: #c1c1c1;
}

.content-sections ul li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--highlight-teal);
}

/* Rules & MCP Table */
.support-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--background-dark);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.support-table th,
.support-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.support-table th {
  background: var(--header-background);
  font-weight: 600;
  color: var(--text-primary);
}

.support-table tr:last-child td {
  border-bottom: none;
}

/* Tool Breakdowns */
.tool-breakdown {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--header-background);
  border-radius: 8px;
  border-left: 4px solid var(--highlight-teal);
}

.tool-breakdown h3 {
  color: var(--highlight-teal);
  margin-top: 0;
}

.tool-breakdown ul {
  margin-bottom: 1rem;
}

.tool-breakdown p {
  margin-bottom: 0;
}

/* FAQ Section */
.faq-section dl {
  margin: 0;
}

.faq-section dt {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.faq-section dt:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.faq-section dd {
  margin: 0.5rem 0 1rem;
  padding-left: 1rem;
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .content-sections {
    padding: 0 0.5rem;
  }

  .content-sections section {
    padding: 1.5rem;
  }

  .content-sections h2 {
    font-size: 1.75rem;
  }

  .content-sections h3 {
    font-size: 1.25rem;
  }

  .support-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Print Styles */
@media print {
  .content-sections {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .content-sections section {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .support-table {
    border: 1px solid #ddd;
  }

  .tool-breakdown {
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
