/* Copyright 2024-2025 soap.fyi. All rights reserved. <https://soap.fyi> */
/* static/styles.css --- */

/* CORRECTED FONT PATHS */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/inter-v19-latin-regular.woff2') format('woff2'); 
}
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('/static/fonts/inter-v19-latin-600.woff2') format('woff2');
}

/* --- Color & Theme Variables --- */
:root {
  --positive-color: #2E8B57;
  --negative-color: #CD5C5C;
  --neutral-color: #BFBFBF;
  
  --primary-accent: #76B0DF;
  --secondary-accent: #bce0f0;
  --secondary-accent-hover: #d7f0fa;
  
  --text-primary: #2e2e2e;
  --text-secondary: #666;
  --background-main: #f8f8f8;
  --background-card: #fdfdfd;
  --border-color: #e0e0e0;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Segoe UI", sans-serif;
  background-color: var(--background-main);
  color: var(--text-primary);
  padding-top: 68px;
  min-height: 100vh;
}

.main-content-wrapper {
  padding: 1rem 0;
  flex-grow: 1;
  width: 100%;
}

.tab-content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.controls-container {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  padding: 10px 20px;
  background-color: var(--background-main);
  text-align: center;
  width: 100%;
  color: var(--text-secondary);
}
.footer-link { color: #70c1b3; }
.footer p { font-size: 0.85em; }

/* --- Dashboard Tabs --- */
.dashboard-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0 10px;
  flex-wrap: nowrap;
}
.tab-link {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-primary);
  background-color: #f0f0f0;
  border-radius: 5px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}
.tab-link:hover { background-color: var(--secondary-accent-hover); }
.tab-link.active {
  background-color: var(--secondary-accent);
  font-weight: bold;
}

/* --- Navbar --- */
.navbar {
  background-color: #bce0f0;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  transform: translateZ(0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  box-sizing: border-box;
}
.navbar .nav-left, .navbar .nav-right, .navbar .navbar-right-menu {
  display: flex;
  align-items: center;
}
.navbar a {
  display: block;
  color: var(--text-primary);
  padding: 14px 16px;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}
.navbar a:hover {
  background-color: var(--secondary-accent-hover);
  color: var(--text-primary);
}
.navbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #2e2e2e;
  font-size: 20px;
  font-weight: bold;
  white-space: nowrap;
}

/* --- Forms --- */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-multiselect {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
.form-text-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}
.form-range-slider {
  width: 100%;
  margin: 5px 0;
}
.slider-container { margin-bottom: 1.5rem; }
.slider-label-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.slider-current-value {
  font-weight: bold;
  color: #337ab7;
  text-align: right;
}

/* --- Buttons --- */
button.button-primary {
  background-color: var(--primary-accent);
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  width: 100%;
  margin-top: 1rem;
}
button.button-primary:hover {
  background-color: #5c9acb;
}

/* --- Tables --- */
.table-scroll-wrapper {
  overflow: auto;
  border: 1px solid #ddd;
  margin-top: 0.5rem;
  width: 100%;
}
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.styled-table th, .styled-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  word-break: break-word;
}
.styled-table th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  font-weight: bold;
}
.styled-table tbody tr:nth-child(even) { background-color: #f9f9f9; }
.styled-table tbody tr:hover { background-color: #f1f1f1; }

/* --- Feed/Top Word Tables --- */
.feed-table-wrapper table.feed-table,
.feed-table-wrapper table.top-word-data-table {
  table-layout: fixed;
  width: 100%;
}
.feed-table-wrapper table th,
.feed-table-wrapper table td {
  word-wrap: break-word;
  hyphens: auto;
}
.feed-table-wrapper table.feed-table td:nth-child(4),
.feed-table-wrapper table.top-word-data-table td:nth-child(4),
.feed-table-wrapper table.top-word-data-table td:nth-child(5) {
  text-align: right;
}

/* Column width rules */
.feed-table-wrapper table.feed-table th:nth-child(1),
.feed-table-wrapper table.feed-table td:nth-child(1) { width: 24%; }
.feed-table-wrapper table.feed-table th:nth-child(2),
.feed-table-wrapper table.feed-table td:nth-child(2) { width: 30%; }
.feed-table-wrapper table.feed-table th:nth-child(3),
.feed-table-wrapper table.feed-table td:nth-child(3) { width: 24%; }
.feed-table-wrapper table.feed-table th:nth-child(4),
.feed-table-wrapper table.feed-table td:nth-child(4) { width: 22%; }

.feed-table-wrapper table.top-word-data-table th:nth-child(1),
.feed-table-wrapper table.top-word-data-table td:nth-child(1) { width: 28%; }
.feed-table-wrapper table.top-word-data-table th:nth-child(2),
.feed-table-wrapper table.top-word-data-table td:nth-child(2) { width: 28%; }
.feed-table-wrapper table.top-word-data-table th:nth-child(3),
.feed-table-wrapper table.top-word-data-table td:nth-child(3) { width: 26%; }
.feed-table-wrapper table.top-word-data-table th:nth-child(4),
.feed-table-wrapper table.top-word-data-table td:nth-child(4) { width: 18%; }

/* --- Plot Images & Messages --- */
.plot-container {
  text-align: center;
  margin: 1.5rem 0;
}
.plot-container img {
  max-width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 4px;
}
.info-message, .warning-message {
  padding: 10px 15px;
  border-radius: 5px;
  margin: 1rem 0;
  text-align: center;
}
.info-message {
  background-color: #eef;
  color: #336;
  border: 1px solid #cce;
}
.warning-message {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* --- Sentiment Classes --- */
.sentiment-positive { color: var(--positive-color); font-weight: bold; }
.sentiment-negative { color: var(--negative-color); font-weight: bold; }
.sentiment-neutral { color: var(--neutral-color); }

/* --- Misc --- */
.data-expander summary {
  cursor: pointer;
  font-weight: bold;
  color: #337ab7;
}
.data-expander summary:hover { text-decoration: underline; }
.text-muted { color: var(--text-secondary); font-style: italic; }
.contribute-link-container {
  text-align: center;
  margin-bottom: 1.5rem;
}
.contribute-link-container a {
  color: var(--primary-accent);
  font-weight: bold;
}

/* --- Metrics Panel --- */
.metrics-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  margin: 1rem 0;
  font-size: 80%; /* 👈 Add this line */
}

.metrics-container ul {
  list-style: none;
  padding: 20px;
  margin: 0;
}
.metrics-container li {
  margin-bottom: 12px;
  font-size: 1em;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.metrics-container li:last-child {
  border-bottom: none;
}
.metrics-container li span {
  float: right;
  font-weight: bold;
  color: #337ab7;
}


#overview-metrics-content div ul {
  padding: 0;
}

.metrics-container {
  padding: 10px !important;
}

@media (max-width: 680px) {
  .dashboard-tabs {
    width: 100%;
    justify-content: space-around;
    gap: 2px;
  }

  .tab-link {
    padding: 10px 3px;
    font-size: 12px;
    flex-grow: 1;
  }

  .navbar {
    padding: 0 10px;
    height: 49px;
  }

  .navbar a {
    font-size: 16px;
    padding: 0 12px;
  }

  .navbar-title {
    font-size: 17px;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .spacer {
    width: 60px;
  }

  body {
    padding-top: 49px;
  }
}

@media (max-width: 480px) {
  .tab-link {
    font-size: 11px;
    padding: 8px 2px;
  }

  .navbar {
    height: 46px;
    padding: 0 8px;
  }

  .navbar a {
    font-size: 15px;
    padding: 0 10px;
  }

  .navbar-title {
    font-size: 16px;
  }

  .spacer {
    width: 50px;
  }

  body {
    padding-top: 46px;
  }
}

/* --- Specific Slider Override --- */
#min_votes_slider_sentiment {
  width: 100%;
}

@media (max-width: 768px) { /* Adjust the max-width as needed */
    #lookup-content table td {
        font-size: 0.68rem; /* Smaller font size for mobile */
    }
        #lookup-content table thead th {
        font-size: 0.75rem; /* Smaller font size for mobile */
    }

        #feed-content table td {
        font-size: 0.6rem; /* Smaller font size for mobile */
    }
        #feed-content table thead th {
        font-size: 0.6rem; /* Smaller font size for mobile */
    }

}

/* --- START: NEW STYLES FOR OVERVIEW METRICS LINKS --- */
/*
  This targets the new <a> tags in the metrics list.
  - Groups :link and :visited to ensure the color does not change after clicking.
  - Inherits the color from the parent <span> to match the existing style.
  - Adds an underline on :hover and :active for better user feedback.
*/
.metrics-container li span a,
.metrics-container li span a:link,
.metrics-container li span a:visited {
  color: inherit; /* Inherit the blue color from the parent span */
  text-decoration: none; /* No underline by default */
  font-weight: inherit; /* Inherit bold weight from the parent span */
}

.metrics-container li span a:hover,
.metrics-container li span a:active {
  color: #23527c; /* A darker blue for the hover/active state */
  text-decoration: underline; /* Add underline on hover */
}
/* --- END: NEW STYLES FOR OVERVIEW METRICS LINKS --- */