/* ============================================
   Prop Futures Edge - Master Stylesheet
   ============================================ */

/* CSS Variables
   -------------------------------------------- */
:root {
  --bg: #0e1117;
  --panel: #151a21;
  --card: #11161d;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --accent: #2f81f7;
  --stroke: #27313d;
}

/* Base Styles
   -------------------------------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, Segoe UI, Roboto, Ubuntu, Arial;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout Containers
   -------------------------------------------- */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px;
}

/* Navigation Bar
   -------------------------------------------- */
.nav {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke);
}

.nav a {
  display: inline-block;
  margin: 0 16px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

@media (max-width: 640px) {
  .nav a {
    display: block;
    margin: 8px 0;
  }
}

/* Typography
   -------------------------------------------- */
.header {
  padding: 56px 0 24px;
  text-align: center;
}

.h1 {
  font-size: 40px;
  margin: 0 0 8px;
}

.sub {
  color: var(--muted);
  margin: 0 0 24px;
}

.lead {
  font-size: 18px;
  color: var(--muted);
}

/* Grid System
   -------------------------------------------- */
.grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 800px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .grid.three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card Component
   -------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

/* Buttons
   -------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.9;
}

/* Utilities
   -------------------------------------------- */
.hr {
  height: 1px;
  background: var(--stroke);
  margin: 24px 0;
}

ul.clean {
  margin: 0;
  padding-left: 18px;
}

.footer {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}


/* ============================================
   RESULTS PAGE STYLES
   ============================================ */

/* Results Header - Sticky
   -------------------------------------------- */
.results-header {
  padding: 40px 20px;
  border-bottom: 1px solid var(--stroke);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 100;
  text-align: center;
}

.results-header .h1 {
  font-size: 40px;
  margin: 0 0 8px;
}

.results-header .sub {
  margin: 0;
}

/* Results Container
   -------------------------------------------- */
.results-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Control Bar (Search & Page Size)
   -------------------------------------------- */
.control-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.control-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.control-bar input[type="text"]::placeholder {
  color: var(--muted);
}

.control-bar select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.row-count {
  color: var(--muted);
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
}

/* Filters Grid
   -------------------------------------------- */
.filters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 24px;
}

.filter-control {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-control label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-control input,
.filter-control select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.filter-control input::placeholder {
  color: var(--muted);
}

.filter-control input[type="number"]:not(:first-of-type) {
  margin-top: 6px;
}

/* Data Table
   -------------------------------------------- */
.table-wrapper {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: left;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

tbody tr:hover td {
  background: rgba(47, 129, 247, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Pagination Controls
   -------------------------------------------- */
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.page-pill {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  background: var(--card);
}

.page-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive Adjustments
   -------------------------------------------- */
@media (max-width: 768px) {
  .results-header .h1 {
    font-size: 32px;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .row-count {
    margin-left: 0;
  }

  th {
    top: 112px;
  }
}
