/* ethostrack_styles.css */

:root {
  --bg-light: #f9f9fb;
  --bg-dark: #1e1e2f;
  --text-light: #1e1e2f;
  --text-dark: #f0f0f0;
  --accent: #005bb5;

  --grade-A: #3cb371;
  --grade-B: #8bc34a;
  --grade-C: #ffca28;
  --grade-D: #ff7043;
  --grade-F: #ef5350;
}

body.dark {
  --grade-A: #66bb6a;
  --grade-B: #aed581;
  --grade-C: #ffd54f;
  --grade-D: #ff8a65;
  --grade-F: #e57373;
}



body {
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  background: var(--bg-light);
  color: var(--text-light);
  margin: 0;
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1em;
  height: 100px;
  background: linear-gradient(to bottom, #003366, #0077cc);
  color: white;
}

body.dark .main-header {
  background: linear-gradient(to bottom, #1e1e1e, #333);
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-left: 0.5em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1em;
}

.nav-item {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.nav-item:hover,
.theme-toggle:hover {
  color: #ffcc00;
}

.theme-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

.theme-toggle .material-icons {
  font-size: 1.5rem;
}

/* Container and Layout */
.container {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.scores, .news {
  flex: 1;
  min-width: 300px;
}

.score-legend ul li {
  list-style:none;
  margin-bottom:8px;
}

.score-legend ul li strong { 
  min-width: 30px;
  display: inline-block;
}

/* Table styles */
table {
  width: 96vw;
  border-collapse: collapse;
  margin: 1rem 1vw 0 1vw;

}

th, td {
  padding: 0.5rem;
  border: 1px solid #ccc;
  text-align: center;
  cursor: pointer;

}

.cell-click div {
  display: flex;
  align-items: center;
  border: none;
  justify-content: center;
}

.trend-icon {
  margin-left: 1rem
}

th {
  background-color: #eceff1;
  font-weight: bold;
}

body.dark th {
  background-color: #2d2d3a;
}

td[data-grade^="A"] span:first-child { color: var(--grade-A); font-weight: bold; font-size: 18px; }
td[data-grade^="B"] span:first-child { color: var(--grade-B); font-weight: bold; font-size: 18px; }
td[data-grade^="C"] span:first-child { color: var(--grade-C); font-weight: bold; font-size: 18px; }
td[data-grade^="D"] span:first-child { color: var(--grade-D); font-weight: bold; font-size: 18px; }
td[data-grade^="F"] span:first-child { color: var(--grade-F); font-weight: bold; font-size: 18px; }

/* Modal styles */
#modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-container {
  position:relative;
  width:100%;
}

#modal-chart {
  background: white;
  padding: 1rem;
  max-width: 80%;
  max-height: 80%;
  overflow: auto;
  margin: auto;
  margin-top: 13%;
  max-height: 72vh;
}

.close {
  position: absolute !important;
  right: 10% !important;
  top: 3% !important;
  cursor: pointer !important;
}

body.dark #modal-chart {
  background: #2a2a3a;
  color: #f0f0f0;
}

/* News Carousel */
.news-carousel {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-light);
}

body.dark .news-carousel {
  background-color: var(--bg-dark);
}

.news-card {
  min-width: 250px;
  max-width: 250px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 1rem;
  color: var(--text-light);
  line-height: 1.4;
  font-size: 0.95rem;
  white-space: normal;
  flex-shrink: 0;
}

body.dark .news-card {
  background: #2a2a3a;
  color: var(--text-dark);
}

.month-grid-header,.scores-grid, .score-legend {
  margin:2rem;
}

.news-card div p {
  display: inline-flex;
  align-items: center;
}

.type-icon {
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: inline-block;
  margin-right:1rem;
}

.bias-type-icon {
  font-size: 20px;
  display: inline-block;
}

/* Legend */
.legend {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.legend span {
  margin-right: 10px;
}

.trending_up {color: var(--grade-A);}
.trending_down {color: var(--grade-F);}
.trending_flat {color: var(--text-light);}

body.dark .trending_flat {color: var(--text-dark);}

.regression {color: var(--grade-D);}
.trending_down {color: var(--grade-F);}
.bias {color: var(--grade-C);}
.gavel {color: #666;}
.info {color: var(--accent);}

#modal table {
  max-width: 85%;
}

.news-item {
  border-bottom: 1px solid #bbb;
  padding: 1rem;
}

.modal-container ol li, .modal-container ul li {
  margin-bottom: 1rem;
}

.site-footer {
  background: linear-gradient(to bottom, #003366, #0077cc);
  color: white;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.site-footer a {
  color: #ffcc00;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer p {
  margin: 0.3rem 0;
}

.tab-nav {
  display: flex;
  gap: 1em;
  margin-bottom: 1em;
}
.tab-button {
  padding: 0.5em 1em;
  background: #ddd;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
.tab-button.active {
  background: var(--accent);
  color: white;
}

 .bias-extreme-right { color: #8B0000; }
 .bias-solid-right { color: #B22222; }
 .bias-lean-right { color: #CD5C5C; }
 .bias-neutral { color: #aaa; }
 .bias-lean-left { color: #6495ED; }
 .bias-solid-left { color: #4169E1; }
 .bias-extreme-left { color: #00008B; }

body.dark .bias-extreme-right { color: #FF6B6B; }
body.dark .bias-solid-right { color: #FF8787; }
body.dark .bias-lean-right { color: #FFAFAF; }
body.dark .bias-neutral { color: #aaa; }
body.dark .bias-lean-left { color: #91C9FF; }
body.dark .bias-solid-left { color: #6495ED; }
body.dark .bias-extreme-left { color: #4169E1; }

.bias-scale-note {
  padding:0 1rem;
  display:inline-flex;
}

.trend-toward-neutral::before {
  content: "thumb_up";
}
.trend-away-from-neutral::before {
  content: "thumb_down";
}
.trend-unchanged::before {
  content: "sentiment_neutral";
}

.trend-toward-neutral,
.trend-away-from-neutral,
.trend-unchanged {
  color: #aaa !important;
  margin-left: .5rem;
}

.bias-cell {
  display: flex;
    align-items: center;
    /* background-color: #eee; */
    width: 100px;
    margin: auto;
    justify-content: flex-end;
}

.bias-scale-legend tbody tr td:last-child { 
  text-align: left;
}

/* Form Layout */
#modal-chart form {
  display: flex;
      flex-direction: column;
      max-width: 20rem;
      margin: auto;
}


/* Input, Select, Textarea */
#modal-chart input,
#modal-chart textarea,
#modal-chart select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Submit Button */
#modal-chart button[type="submit"] {
  background: #005bb5;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

#modal-chart button[type="submit"]:hover {
  background: #004a94;
}


/* Confirmation and Error Messages */
#modal-chart p {
  font-size: 1rem;
  margin: 1rem 0 0 0;
}

#modal-chart p[style*="color:red"] {
  color: red !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
  }

  .news-carousel {
    flex-direction: column;
    overflow-x: unset;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 1em;
  }

  .logo-link {
    margin-bottom: 1em;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.5em;
  }

  .nav-item,
  .theme-toggle {
    display: block;
    width: 100%;
    text-align: left;
  }
}
