/* ==================================================
   THEME VARIABLES
   ================================================== */
:root {
  --background: #fafafa;
  --text: #222;
  --card: #fff;
  --highlight: #de89ff;
  --card-shadow: rgba(0, 0, 0, 0.08);
  --link: #de89ff;
  --cta-background: #f2e5fa;
  --footer-text: #6f6f6f;
  --border: rgba(0,0,0,0.1);
  --transition: 0.25s;
}

[data-theme="dark"] {
  --background: #121212;
  --text: #f0f0f0;
  --card: #1e1e1e;
  --highlight: #de89ff;
  --card-shadow: rgba(0, 0, 0, 0.28);
  --link: #de89ff;
  --cta-background: #2a1f2e;
  --footer-text: #a8a8a8;
  --border: rgba(255,255,255,0.12);
}

/* ==================================================
   GLOBAL RESETS
   ================================================== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }

/* Utility: Screen reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ==================================================
   HEADER
   ================================================== */
.site-header {
  background: var(--highlight);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  cursor: pointer;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  align-items: center;
  border-bottom: none;
  border: none;
  box-shadow: none;  
}

.nav a {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.95;
  transition: opacity var(--transition);
}
.nav a:hover { opacity: 0.75; }

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.04);
}
.theme-toggle .icon { line-height: 1; }

.header-logo {
  max-height: 36px;
  width: auto;
}

/* ==================================================
   HERO
   ================================================== */
.hero {
  background: var(--card);
  padding: 3rem 1rem;
  text-align: center;
  box-shadow: 0 6px 18px var(--card-shadow);
}

.hero-logo {
  max-width: 220px;
  width: 40vw;
  height: auto;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0.5rem 0 0.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.2px;
}

.subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  margin: 0;
  opacity: 0.9;
}

/* ==================================================
   FEATURES
   ================================================== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
}

/* ==================================================
   CTA SECTION
   ================================================== */
.cta {
  background: var(--cta-background);
  padding: 3rem 1rem;
  text-align: center;
  margin-top: 1rem;
}
.cta h2 { margin-top: 0; }

.cta-button {
  display: inline-block;
  margin-top: 0.75rem;
  background: var(--highlight);
  color: #fff;
  padding: 0.9rem 1.6rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px var(--card-shadow);
}

/* ==================================================
   FOOTER
   ================================================== */
.site-footer {
  background: var(--card);
  text-align: center;
  padding: 1rem;
  color: var(--footer-text);
  font-size: 0.92rem;
}

/* ==================================================
   TABLES + WINNERS
   ================================================== */
.table-section {
  padding: 2rem 1rem;
  background: var(--card);
  margin-top: 1rem;
}

.table-header {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

/* Segmented controls */
.segmented {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0.25rem;
}
[data-theme="dark"] .segmented {
  background: rgba(255,255,255,0.12);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  color: var(--text);
  opacity: 0.9;
  flex: 1;
  text-align: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.segmented input:checked + label {
  background: var(--highlight);
  color: #fff;
  transform: translateY(-1px);
}

/* Winner cards */
.winner-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 20px var(--card-shadow);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.winner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--card-shadow);
}

#winner-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Runner-up rows */
.runner-up {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.runner-up-name {
  font-weight: 600;
  width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runner-up-bar {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
}
[data-theme="dark"] .runner-up-bar {
  background: rgba(255,255,255,0.12);
}

.runner-up-bar-fill {
  height: 100%;
  background: var(--highlight);
  border-radius: 3px;
}

.runner-up-value {
  opacity: 0.8;
}

.runner-up,
.top-tool {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.runner-up:hover,
.top-tool:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--card-shadow);
}

/* ==================================================
   TOP TOOL EMPHASIS
   ================================================== */
.top-tool {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--highlight) 0%, var(--cta-background) 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--card-shadow);
}

.top-tool .runner-up-name {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.top-tool .runner-up-bar {
  height: 18px;
  background: rgba(255,255,255,0.2);
}

.top-tool .runner-up-bar-fill {
  background: #fff;
}

.top-tool .runner-up-value {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

/* ==================================================
   DROPDOWN MENU
   ================================================== */
.nav-item.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 6px 20px var(--card-shadow);
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  transition: background var(--transition), color var(--transition);
}

.dropdown-menu li a:hover {
  background: var(--highlight);
  color: #fff;
  border-radius: 6px;
}

#winner-cards {
  margin-bottom: -1.75rem; 
}

#tool-info {
  padding-top: 0.5rem;
}

#winner-cards {
  padding-bottom: 1.5rem;
}