/* Add design tokens, colors, typography, and component polish */
:root {
  --brand: #66ffff; /* neon aqua */
  --accent: #39ff14; /* neon green */
  --warn: #f59e0b; /* warning accent */
  --error: #ef4444; /* error accent */

  --bg: #121212; /* dark background */
  --card: #1e1e1e; /* card background */
  --border: #333333; /* dark border */
  --muted: #9ca3af; /* muted text */
  --ink: #ffffff; /* white text */
  --radius: 0.75rem;
}

html,
body {
  color: var(--ink);
  background-color: var(--bg);
}

/* Dark theme overrides */
body {
  background-color: #0a0a0a !important;
}

/* cards */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 120px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #0a0a0a;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  background: #374151;
  border-color: #374151;
  color: #9ca3af;
}

.btn-outline {
  background: transparent;
  border-color: #4b5563;
  color: #ffffff;
}
.btn-outline:hover:not(:disabled) {
  background: #374151;
  border-color: #66ffff;
  color: #66ffff;
}

.btn-success {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
}
.btn-success:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-warning {
  background: var(--warn);
  border-color: var(--warn);
  color: #111827;
}
.btn-warning:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-danger {
  background: var(--error);
  border-color: var(--error);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(0.95);
}

/* badges by category */
.badge.bg-benchmark {
  background: var(--brand) !important;
}
.badge.bg-review {
  background: var(--warn) !important;
}
.badge.bg-error {
  background: var(--error) !important;
}

/* stepper */
.stepper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.stepper .step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.stepper .step[aria-current='step'] {
  background: rgba(14, 165, 233, 0.08);
  border-color: var(--brand);
}
.stepper .step-index {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* sticky actions */
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

/* form polish */
.form-label {
  font-weight: 600;
  color: var(--ink);
}
.form-control,
.form-select {
  border-radius: 0.6rem;
  border-color: var(--border);
  background-color: var(--card);
  color: var(--ink);
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--muted);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(102, 255, 255, 0.15);
  background-color: var(--card);
  color: var(--ink);
}
.help-text,
.form-text,
.text-muted {
  color: var(--muted) !important;
}

/* image grids */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.thumb-grid .thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}
@media (max-width: 575.98px) {
  .thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* preview content box */
.preview-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem;
}

/* voting */
.vote-btn.active,
.vote-btn:disabled.active {
  color: #fff;
}
.vote-btn[data-vote='upvote'].active {
  background: var(--accent);
  border-color: var(--accent);
}
.vote-btn[data-vote='downvote'].active {
  background: var(--error);
  border-color: var(--error);
}

/* Dark theme specific overrides */
.bg-white {
  background-color: var(--card) !important;
}

.text-gray-800 {
  color: var(--ink) !important;
}

.text-gray-600 {
  color: var(--muted) !important;
}

.text-gray-500 {
  color: var(--muted) !important;
}

.border-gray-200 {
  border-color: var(--border) !important;
}

.bg-gray-50 {
  background-color: var(--card) !important;
}

.bg-gray-100 {
  background-color: #374151 !important;
}

/* Input field overrides for dark theme */
input[type='text'],
input[type='search'],
input[type='email'],
input[type='password'],
textarea,
select {
  background-color: var(--card) !important;
  color: var(--ink) !important;
  border-color: var(--border) !important;
}

input[type='text']::placeholder,
input[type='search']::placeholder,
input[type='email']::placeholder,
input[type='password']::placeholder,
textarea::placeholder {
  color: var(--muted) !important;
}

input[type='text']:focus,
input[type='search']:focus,
input[type='email']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
  background-color: var(--card) !important;
  color: var(--ink) !important;
  border-color: var(--brand) !important;
}

/* Additional overrides for form elements */
input,
select,
textarea {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #4b5563 !important;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af !important;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #66ffff !important;
  box-shadow: 0 0 0 0.25rem rgba(102, 255, 255, 0.15) !important;
}

/* Select dropdown options */
select option {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

/* Community page specific form fixes */
.community-page input,
.community-page select,
.community-page textarea {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border: 2px solid #4b5563 !important;
}

.community-page input:focus,
.community-page select:focus,
.community-page textarea:focus {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #66ffff !important;
  box-shadow: 0 0 0 0.25rem rgba(102, 255, 255, 0.15) !important;
}

.community-page input::placeholder,
.community-page textarea::placeholder {
  color: #9ca3af !important;
}

/* Force dark theme on all form elements */
#gameSearch,
input[name='search'],
select[name='category'],
select[name='game'] {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border: 2px solid #4b5563 !important;
}

#gameSearch:focus,
input[name='search']:focus,
select[name='category']:focus,
select[name='game']:focus {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #66ffff !important;
  box-shadow: 0 0 0 0.25rem rgba(102, 255, 255, 0.15) !important;
}

/* Force dark theme for comment textarea - maximum specificity */
textarea[name='content'],
textarea[name='content'].w-full,
textarea[name='content'].p-4,
textarea[name='content'].rounded-xl,
.community-page textarea[name='content'],
.community-page textarea[name='content'].w-full,
.community-page textarea[name='content'].p-4,
.community-page textarea[name='content'].rounded-xl {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border: 2px solid #4b5563 !important;
  border-radius: 0.75rem !important;
  padding: 1rem !important;
  width: 100% !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  resize: vertical !important;
  transition: all 0.3s ease !important;
}

textarea[name='content']:focus,
.community-page textarea[name='content']:focus {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #66ffff !important;
  box-shadow: 0 0 0 0.25rem rgba(102, 255, 255, 0.15) !important;
  outline: none !important;
}

textarea[name='content']::placeholder,
.community-page textarea[name='content']::placeholder {
  color: #9ca3af !important;
}

/* Image display fixes */
.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-image:hover {
  transform: scale(1.05);
}

.image-gallery img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

.image-gallery img:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* Image error handling */
.image-error {
  background: linear-gradient(135deg, #374151, #4b5563);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
}

/* Image type badges */
.image-type-badge {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* utilities */
.text-balance {
  text-wrap: balance;
}
