:root {
  --spotlight-gradient: linear-gradient(135deg, rgba(127, 212, 223, 0.15) 0%, rgba(94, 151, 255, 0.05) 100%);
}

.feedback-page {
  max-width: 1160px;
  margin: 120px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;

  @media (max-width: 900px) {
    grid-template-columns: 1fr;
    margin-top: 100px;
  }

  & .page-header {
    grid-column: 1 / -1;
    margin-bottom: 24px;
    animation: riseBlur 580ms var(--ease-out) both;

    & h1 {
      font-size: clamp(2.5rem, 2rem + 2vw, 4rem);
      margin-bottom: 12px;
    }

    & p {
      color: var(--ink-soft);
      font-size: 1.15rem;
      max-width: 800px;
      margin: 0;
    }
  }
}

/* Sidebar & Form Cards */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
  height: fit-content;

  & h2 {
    font-size: 1.35rem;
    margin-bottom: 18px;
    color: var(--ink-strong);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
}

.card-form, .spotlight-card, .leaderboard-card, .contact-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--surface);
  box-shadow: var(--shadow-soft);
  animation: riseBlur 580ms var(--ease-out) both;
}

@media (max-width: 900px) {
  .feedback-page .page-header {
    order: -3;
  }

  .feedback-page .leaderboard-card {
    order: -2;
  }

  .feedback-page .feed-container {
    order: -1;
  }

  .sidebar {
    display: contents;
    position: static;
  }
}

.card-form {
  animation-delay: 70ms;
}

.spotlight-card {
  background: var(--spotlight-gradient), var(--surface);
  border-color: rgba(127, 212, 223, 0.3);
  animation-delay: 120ms;

  & .spotlight-eyebrow {
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;

    &::before {
      content: "";
      display: inline-block;
      width: 6px;
      height: 6px;
      background-color: var(--cyan);
      border-radius: 50%;
      box-shadow: 0 0 8px var(--cyan);
      animation: pulseSpotlight 1.5s infinite alternate;
    }
  }

  & .spotlight-content {
    margin-bottom: 16px;

    & h3 {
      font-size: 1.15rem;
      margin-bottom: 6px;
      color: var(--ink-strong);
    }

    & p {
      font-size: 0.88rem;
      color: var(--ink-soft);
      margin: 0;
      line-height: 1.4;
    }
  }
}

@keyframes pulseSpotlight {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

.leaderboard-card {
  animation-delay: 100ms;

  & .leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;

    & h2 {
      margin-bottom: 4px;
    }

    & p {
      color: var(--ink-muted);
      font-size: 0.82rem;
      line-height: 1.35;
      margin: 0;
    }
  }

  & .leaderboard-live {
    border: 1px solid rgba(127, 212, 223, 0.3);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.7px;
    padding: 4px 8px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  & .leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }

  & .leaderboard-stat {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    min-height: 76px;
    padding: 12px;

    & strong {
      color: var(--ink-strong);
      display: block;
      font-family: var(--display);
      font-size: 1.55rem;
      line-height: 1;
      margin-bottom: 6px;
    }

    & span {
      color: var(--ink-soft);
      display: block;
      font-size: 0.76rem;
      font-weight: 800;
      letter-spacing: 0.45px;
      text-transform: uppercase;
    }

    & small {
      color: var(--ink-muted);
      display: block;
      font-size: 0.7rem;
      line-height: 1.3;
      margin-top: 5px;
    }
  }

  & .leaderboard-top {
    border-top: 1px solid var(--line);
    padding-top: 14px;

    & h3 {
      color: var(--ink-soft);
      font-size: 0.78rem;
      font-weight: 900;
      letter-spacing: 0.75px;
      margin: 0 0 10px;
      text-transform: uppercase;
    }
  }

  & .leaderboard-row {
    align-items: center;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    padding: 9px 0;

    &:not(:last-child) {
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    & .leaderboard-rank {
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--ink-soft);
      display: grid;
      font-family: var(--display);
      font-size: 0.82rem;
      font-weight: 900;
      height: 28px;
      place-items: center;
      width: 28px;
    }

    & .leaderboard-title {
      color: var(--ink-strong);
      font-size: 0.88rem;
      font-weight: 800;
      line-height: 1.25;
    }

    & .leaderboard-points {
      color: var(--cyan);
      font-size: 0.78rem;
      font-weight: 900;
      white-space: nowrap;
    }
  }
}

.contact-card {
  animation-delay: 170ms;
}

.form-group {
  margin-bottom: 16px;

  & label {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
}

.form-control {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink-strong);
  font-family: var(--sans);
  font-size: 0.94rem;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);

  &:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(127, 212, 223, 0.15);
  }

  &textarea {
    resize: vertical;
    min-height: 90px;
  }
}

/* Buttons */
.btn-submit,
.btn-secondary-link {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 850;
  font-family: var(--display);
  cursor: pointer;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background-color 180ms var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;

  &:active {
    transform: translateY(0) scale(0.98);
  }
}

.btn-submit {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #6ba2ff, #2f6bea 72%);
  box-shadow: 0 10px 24px rgba(47, 107, 234, 0.25);

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(47, 107, 234, 0.38);
  }
}

.btn-secondary-link {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-strong);

  &:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
  }

  &.active {
    &.up {
      color: var(--cyan);
      background: rgba(127, 212, 223, 0.12);
      border-color: var(--cyan);
    }
    &.down {
      color: var(--red);
      background: rgba(241, 79, 66, 0.12);
      border-color: var(--red);
    }
  }
}

/* Main Content Feed */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 20px;

  & .controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 8px;
    animation: riseBlur 580ms var(--ease-out) both;
  }

  & .filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    & .filter-tab {
      border: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.04);
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      color: var(--ink-soft);
      transition: all 180ms var(--ease-out);

      &:hover {
        border-color: var(--line-strong);
        color: var(--ink-strong);
        background: rgba(255, 255, 255, 0.08);
      }

      &.active {
        background: var(--cyan);
        color: var(--bg);
        border-color: var(--cyan);
        font-weight: 750;
      }
    }
  }

  & .sort-select {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: border-color 180ms var(--ease-out);

    &:focus {
      outline: none;
      border-color: var(--cyan);
    }
  }

  & .feedback-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* Feedback Card */
.feedback-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 56px 1fr;
  padding: 20px;
  gap: 16px;
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out);
  animation: riseBlur 580ms var(--ease-out) both;

  &:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
  }

  & .vote-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    user-select: none;

    & .vote-btn {
      background: none;
      border: none;
      color: var(--ink-muted);
      cursor: pointer;
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 6px;
      transition: all 180ms var(--ease-out);

      &:hover {
        background: rgba(255, 255, 255, 0.06);
        color: var(--ink-strong);
      }

      &.up.active {
        color: var(--cyan);
        background: rgba(127, 212, 223, 0.12);
      }

      &.down.active {
        color: var(--red);
        background: rgba(241, 79, 66, 0.12);
      }
    }

    & .vote-score {
      font-family: var(--display);
      font-size: 1.15rem;
      font-weight: 800;
      color: var(--ink-strong);
      min-width: 24px;
      text-align: center;
    }
  }

  & .feedback-body {
    display: flex;
    flex-direction: column;
    gap: 8px;

    & h2 {
      font-size: 1.28rem;
      font-weight: 800;
      color: var(--ink-strong);
      margin: 0;
      line-height: 1.25;
    }

    & .feedback-desc {
      color: var(--ink-soft);
      font-size: 0.94rem;
      margin: 0;
      line-height: 1.45;
      white-space: pre-wrap;
    }

    & .feedback-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;

      & .category-badge {
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 3px 8px;
        border-radius: 999px;
        border: 1px solid;

        &.feature {
          border-color: var(--cyan);
          color: var(--cyan);
          background: rgba(127, 212, 223, 0.08);
        }

        &.bug {
          border-color: var(--red);
          color: var(--red);
          background: rgba(241, 79, 66, 0.08);
        }

        &.adjustment {
          border-color: var(--blue);
          color: var(--blue);
          background: rgba(94, 151, 255, 0.08);
        }

        &.other {
          border-color: var(--gold);
          color: var(--gold);
          background: rgba(217, 161, 95, 0.08);
        }
      }

      & .feedback-time {
        font-size: 0.8rem;
        color: var(--ink-muted);
      }
    }
  }
}

/* Status & Toast */
.state-message {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.01);

  & svg {
    width: 38px;
    height: 38px;
    color: var(--ink-muted);
    margin-bottom: 12px;
  }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: #101d2c;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--ink-strong);
  font-family: var(--sans);
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  display: none;
  animation: toastEnter 300ms var(--ease-out);
}

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