/* ===== CSS Variables ===== */
:root {
  --bg-nav: #0d1b2a;
  --bg-body: #1b2838;
  --bg-card: #1e3a5f;
  --bg-card-hover: #244b78;
  --bg-input: #0f2744;
  --accent: #4da6ff;
  --accent-dark: #2980d9;
  --accent-glow: rgba(77,166,255,0.3);
  --text: #e0e8f0;
  --text-dim: #8aa8c4;
  --border: #2a4a6b;
  --success: #4ade80;
  --danger: #f87171;
  --gold: #fbbf24;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--bg-nav);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex: 1;
}

.nav-btn {
  background: transparent;
  border: 2px solid transparent;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover { background: rgba(77,166,255,0.1); color: var(--text); }

.nav-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-user input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 160px;
  transition: border-color 0.2s;
}

.nav-user input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== SECTIONS ===== */
.section { display: none; max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 { font-size: 1.4rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { background: var(--bg-card); color: var(--text); }

.btn-secondary.small, .btn-primary.small { padding: 6px 14px; font-size: 0.8rem; }

/* ===== CARDS ===== */
.card-list { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.card-body { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 8px; line-height: 1.5; }
.card-image { width: 100%; max-height: 250px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-dim); }

.card-badge {
  background: rgba(77,166,255,0.15);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.badge-rating { color: var(--gold); background: rgba(251,191,36,0.15); }
.badge-comments { color: var(--accent); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .emoji { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; }

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px;
  overflow-y: auto;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-nav);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.25s ease-out;
}

.modal-wide { max-width: 650px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.modal-body { padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-body input,
.modal-body textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 10px;
  resize: vertical;
  transition: border-color 0.2s;
}

.modal-body input:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== IMAGE UPLOAD ===== */
.image-upload { margin-top: 6px; }

.upload-label {
  display: inline-block;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.upload-label:hover { border-color: var(--accent); color: var(--accent); }
.upload-label.small { padding: 4px 12px; font-size: 0.8rem; }

.image-preview { margin-top: 8px; }
.image-preview img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }
.image-preview.small img { max-height: 120px; }

/* ===== DISCUSSION FULL ===== */
.discussion-full { line-height: 1.7; }

/* ===== RATING BAR ===== */
.rating-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

.rating-btn {
  font-size: 1.4rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-btn:hover { border-color: var(--accent); transform: scale(1.1); }
.rating-btn.up:hover, .rating-btn.up.voted { border-color: var(--success); background: rgba(74,222,128,0.15); }
.rating-btn.down:hover, .rating-btn.down.voted { border-color: var(--danger); background: rgba(248,113,113,0.15); }

.rating-score {
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
}

.rating-score.positive { color: var(--success); }
.rating-score.negative { color: var(--danger); }

/* ===== COMMENTS ===== */
.comments-section {
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 0;
}

.comment {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.comment-author { font-weight: 600; font-size: 0.85rem; color: var(--accent); }
.comment-text { font-size: 0.85rem; margin-top: 4px; line-height: 1.5; }
.comment-image {
  max-width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-top: 6px;
}
.comment-date { font-size: 0.7rem; color: var(--text-dim); margin-top: 4px; }

/* ===== POLL OPTIONS ===== */
.poll-options { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }

.poll-option {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
}

.poll-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.poll-option-fill {
  position: absolute;
  inset: 0;
  background: rgba(77,166,255,0.15);
  border-radius: 7px;
  transition: width 0.4s ease;
}

.poll-option-text {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.poll-option-pct {
  font-weight: 600;
  color: var(--accent);
}

.poll-total {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
}

.poll-option-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.poll-option-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== HR ===== */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .navbar { gap: 10px; padding: 10px 14px; }
  .nav-links { gap: 4px; }
  .nav-btn { padding: 6px 10px; font-size: 0.8rem; }
  .nav-user input { width: 120px; }
  .section { padding: 16px 10px; }
  .modal { max-width: 100%; }
}
