:root {
  --bg: #0d1117;
  --card: #161b22cc;
  --text: #e6edf3;
  --accent1: #6a5af9;
  --accent2: #00c6ff;
  --sidebar: #11151c;
}

.light {
  --bg: #f2f2f7;
  --card: #ffffffcc;
  --text: #111111;
  --sidebar: #e3e3ec;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 230px;
  background: var(--sidebar);
  padding: 20px;
  height: 100vh;
  position: fixed;
  box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 1.6rem;
  margin-bottom: 30px;
  font-weight: bold;
}

.side-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
}

.side-btn:hover {
  background: rgba(255,255,255,0.05);
}

.side-btn.active {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border: none;
}

/* Main content */
.main {
  margin-left: 250px;
  padding: 30px;
  width: calc(100% - 250px);
}

/* Header */
.header h1 {
  margin-top: 0;
  font-size: 2rem;
}

/* Glassmorphism cards */
.glass {
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Card container */
.card {
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(0,0,0,0.3);
  max-width: 1100px;
  margin: 0 auto;
}

/* Textarea input */
.input {
  width: 100%;
  height: 150px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text);
  margin-bottom: 15px;
  font-size: 1rem;
  resize: vertical;
}

/* Gradient button */
.btn.gradient {
  width: 100%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border: none;
  color: white;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 0 15px rgba(0,198,255,0.3);
}

.btn.gradient:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0,198,255,0.6);
}

/* Loading text */
.loading {
  margin-top: 10px;
  font-size: 1rem;
  opacity: 0.9;
}

/* Results output */
.results {
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
  white-space: pre-wrap;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  max-height: 60vh;
  overflow-y: auto;
}
#results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 20px;
}

.contest-card {
  background: #ffffff10;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #ffffff20;
  backdrop-filter: blur(10px);
  transition: 0.18s;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contest-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.contest-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.contest-card .desc {
  opacity: 0.9;
  margin-bottom: 10px;
  flex: 1 0 auto;
}

.contest-card .details {
  margin-top: 12px;
  font-size: 0.9rem;
  opacity: 0.95;
}

.button {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 14px;
  background: #4a7bff;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  transition: 0.2s;
}

.button:hover {
  background: #315ae6;
}

.error {
  color: #ff6b6b;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,0,0,0.04);
}

/* Empty message */
.empty {
  opacity: 0.7;
}

/* Accuracy badge */
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  margin-left: 8px;
}

.badge.high {
  background: linear-gradient(90deg, #28c76f, #2ecc71);
  box-shadow: 0 6px 18px rgba(46,204,113,0.12);
}

.badge.medium {
  background: linear-gradient(90deg, #f6c343, #f39c12);
  box-shadow: 0 6px 18px rgba(243,156,18,0.12);
}

.badge.low {
  background: linear-gradient(90deg, #ff6b6b, #ff4d4f);
  box-shadow: 0 6px 18px rgba(255,77,79,0.08);
}

/* small accuracy legend */
.accuracy-legend {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Legend badge smaller */
.badge.legend {
  padding: 5px 8px;
  font-size: 0.8rem;
  opacity: 0.95;
}

/* Accessibility focus */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

/* Mobile responsiveness */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    gap: 10px;
    padding: 12px;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }

  .card {
    margin: 12px;
  }
}
