/* ---------------------------
   Clearify style.css (merged)
   --------------------------- */

/* Color tokens */
:root{
  --bg: #dff0f5;
  --card-bg: #ffffff;
  --accent-green: #74D3AE;
  --accent-blue-1: #2563eb;
  --accent-blue-2: #42A5F5;
  --muted: #666;
  --light-border: #e0e0e0;
}

/* Global */
body {
  margin: 0;
  font-family: sans-serif;
  background-color: var(--bg);
  color: #333;
}

/* ----- HEADER ----- */
header {
  background: var(--card-bg);
  padding: 1rem 500px;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2rem;
  background: linear-gradient(to right, var(--accent-blue-1), var(--accent-blue-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

nav button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-weight: 500;
}

/* ----- HERO SECTION ----- */
section.hero {
  text-align: center;
  padding: 3rem 1rem;
}

section.hero h1 {
  font-size: 3rem;
  background: linear-gradient(to right, var(--accent-blue-1), var(--accent-blue-2));
  display: inline-block;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

/* ----- CARD COMPONENT ----- */
.card {
  background: var(--card-bg);
  border-radius: 0.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.card-header {
  background: var(--accent-green);
  color: white;
  padding: 0.75rem 1rem;
  font-weight: bold;
}

.card-content {
  padding: 1rem;
}

/* ----- INPUTS & TEXTAREA ----- */
textarea,
input[type="text"] {
  width: 100%;
  border: 2px solid #ddd;
  border-radius: 0.4rem;
  padding: 0.5rem;
  font-size: 1rem;
  resize: none;
  box-sizing: border-box;
}

/* ----- BUTTONS ----- */
button.analyze {
  background: var(--accent-green);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
}

button.analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ----- RESULTS ----- */
.results {
  margin-top: 2rem;
}

.score {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: bold;
  margin-right: 1rem;
}

.score.bias {
  background: #ffe58f;
}

.score.risk {
  background: #ffccc7;
}

/* ----- FEEDBACK ----- */
.feedback-stars span {
  font-size: 1.5rem;
  cursor: pointer;
}

.feedback-stars .active {
  color: gold;
}

/* ----- ICON ALIGNMENT ----- */
.tick {
  vertical-align: -5px; /* moves image slightly lower relative to text */
}

/* ----- SWITCH SLIDER ----- */ 
.switch-container { 
  height: 40px;
  background: var(--accent-green);
  border-radius: 30px; 
  position: relative; 
  display: flex; align-items: 
  center; justify-content: 
  space-between; padding: 0 10px; 
  font-family: sans-serif;
  font-weight: bold;
  cursor: pointer; 
  user-select: none; 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
} 
.switch-slider { 
position: absolute;
top: 5px; left: 5px; 
width: 320px; 
height: 30px; 
background: white; 
border-radius: 25px; 
transition: all 0.5s ease; z-index: 1; }

.switch-container.active .switch-slider {
  left: calc(50% + 4px);
}

.switch-label {
  flex: 1;
  text-align: center;
  z-index: 2; /* keep text visible above slider */
  color: black;
}

.switch-container.active .switch-label.text {
  color: black;
}

.switch-container:not(.active) .switch-label.url {
  color: black;
}

/* ----- SUMMARY BLOCKS ----- */
.summary-block {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--light-border);
  padding-bottom: 0.5rem;
}

.summary-block ul {
  list-style-type: disc;
  margin-left: 1.2rem;
}

#analysis-summary {
  margin-bottom: 1.5rem;
}

/* ----- TABLE STYLING ----- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: bold;
  background-color: #f8f9fa;
}

/* ----- SUMMARY BLOCKS LAST ----- */
.summary-block:last-child {
  border-bottom: none;
}

.summary-block strong {
  color: var(--accent-blue-1);
}

/* -----------------------------
   Political & Social Bias styles
   ----------------------------- */

/* Two-column grid inside a card */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* Individual small analysis card */
.analysis-card {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.analysis-card h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
}

/* Big label for prediction */
.label-big {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  color: #222;
}

/* muted helper text */
.muted {
  color: var(--muted);
}

.small { font-size: 0.9rem; }
.tiny { font-size: 0.8rem; color: #888; margin-top: 0.5rem; }

/* Progress bar container */
.progress {
  width: 100%;
  height: 12px;
  background: #f1f1f1;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.6rem;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.03);
}

/* Progress bar inner (default green) */
.progress-inner {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 600ms ease;
  background: linear-gradient(90deg, #74D3AE, #4CAF50);
}

/* Different color styles for political leaning */
.progress-inner.right {
  background: linear-gradient(90deg, var(--accent-blue-2), var(--accent-blue-1));
}
.progress-inner.center {
  background: linear-gradient(90deg,#FFE082,#FFB74D);
}

/* make sure text fits */
.analysis-main { width: 100%; }

.gemini-summary-card {
  border-left: 4px solid var(--accent-blue-1);
}


/* Small responsive adjustments */
@media (max-width: 900px) {
  header { padding: 1rem 2rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .switch-slider {
    width: 160px;
    left: 8px;
  }
  .switch-container.active .switch-slider {
    left: calc(100% - 168px);
  }
}

/* tiny helpers to ensure consistent spacing */
.card .analysis-card + .analysis-card { margin-top: 0.5rem; }

.spectrumBar {
  position: relative;
  width: 100%;
  height: 12px;
  background: linear-gradient(
    to right,
    #4f46e5 0%,
    #9ca3af 50%,
    #dc2626 100%
  );
  border-radius: 8px;
  margin: 10px 0;
}

.spectrumMarker {
  position: absolute;
  top: -4px;
  width: 10px;
  height: 20px;
  background: #000;
  border-radius: 2px;
  transition: left 0.4s ease;
}

.spectrumLegend {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.spectrumLabel {
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

.bias-green {
  color: #16a34a; /* Tailwind green-600 */
  font-weight: 600;
}

.bias-red {
  color: #dc2626; /* Tailwind red-600 */
  font-weight: 600;
}

