/* Global Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Root Variables */
:root {
  --primary-dark: rgb(44, 41, 56);
  /* Dark gray */
  --primary-light: rgb(145, 140, 170);
  /* Light grayish purple */
  --primary-medium: rgb(91, 87, 109);
  /* Medium grayish purple */
  --primary-bg: rgb(51, 46, 54);
  /* Background */
  --secondary-light: rgb(128, 127, 139);
  /* Light muted */
  --accent-gold: rgb(220, 188, 72);
  /* Gold accent */
  --accent-gold-dark: rgb(104, 90, 46);
  /* Darker gold */
  --accent-gold-bright: rgb(207, 177, 59);
  /* Bright gold */
  --neutral-light: rgb(244, 244, 244);
  /* Lightest neutral (near white) */
  --neutral-white: rgb(255, 255, 255);
  /* Pure white */
  --neutral-dark: rgb(135, 108, 101);
  /* Warm neutral */
}

/* General Styles */
body {
  background: var(--primary-bg);
  font-family: Arial, sans-serif;
  color: var(--neutral-light);
}

.header-wrapper,
.footer-wrapper {
  margin: auto;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1600px;
  margin: auto;
  padding: .5em;
}

/* // Not login user */
.alert {
  padding: 1em;
  border: 1px solid #ffc107;
  background-color: #fff3cd;
  color: #856404;
  border-radius: 0.25rem;
  text-align: center;
  font-size: 1em;
}


/*// Accordion Styles */
.accordion {
  max-width: 300px;
  width: 100%;
  background: rgba(56, 36, 36, 0);
  display: flex;
  flex-direction: column;
}

.accordion-item {
  width: 100%;
}

.accordion-button {
  background: var(--primary-dark);
  color: var(--neutral-white);
  padding: 0.625em;
  font-weight: bold;
  font-size: clamp(0.5em, 1vw, .9em);
  cursor: pointer;
  text-align: center;
  border: none;
  border-radius: 0.5em;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.accordion-button:hover {
  background-color: var(--primary-medium);
}

.accordion-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.accordion-body {
  background-color: var(--primary-bg);
  padding: 15px;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  line-height: 1.6;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.accordion-body .info-text {
  font-size: 0.8em;
  color: #e0cdcd;
  text-shadow: 2px 2px 4px rgb(220, 166, 225, 0.22);
}

.accordion-body .info-text::before {
  content: "🔹 ";
  font-size: 1.2em;
  color: #007BFF;
}

/* Table Styles */
.table-wrapper {
  overflow-x: auto;
  padding: 0.75em;
  margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

.table th,
.table td {
  padding: 8px;
  text-align: center;
  word-wrap: break-word;
  border: 1px solid var(--secondary-light);
}

td {
  background: var(--primary-dark);
}

.table>tbody>tr>td[data-label]::before {
  color: var(--accent-gold-dark);
}

/* Button Styles */
.upvote,
.downvote {
  background: var(--primary-dark);
  color: var(--neutral-white);
  padding: 10px;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.upvote:hover,
.downvote:hover {
  background: var(--primary-medium);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Voting Button Icons */
.upvote::after {
  content: "\2191";
}

.downvote::after {
  content: "\2193";
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  margin-bottom: 1em;
}

.pagination>input[type="number"] {
  max-width: 39px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
  color: var(--neutral-white);
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
  margin-left: .6em;
  margin-right: .03em;
}


.pagination>input[type="number"]:focus {
  outline: none;
}

.no-spinner::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pagination>input[type="submit"] {
  background: var(--primary-dark);
  color: var(--neutral-white);
  border: none;
  padding: 11px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.pagination>input[type="submit"]:hover {
  background: var(--primary-medium);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination>input[type="submit"]:focus {
  outline: none;
}

/* Results Per Page Select */
#resultsPerPage {
  max-width: 43px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
  color: var(--neutral-white);
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
  margin: 0 .6em;
}

#resultsPerPage:focus {
  outline: none;
}

#resultsPerPage>option {
  background: var(--primary-dark);
  color: var(--neutral-white);
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#resultsPerPage>option:hover {
  background: var(--primary-medium);
}

/*// Pagination Links */
.pagination a,
.pagination span {
  padding: 8px 14px;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 5px;
  color: var(--neutral-white);
  cursor: pointer;
  transition: background-color 0.3s;
}

.pagination a:hover {
  background-color: #f0f0f0;
}

.pagination .current {
  background-color: #4CAF50;
  color: white;
  border: 1px solid #4CAF50;
}

.pagination .disabled {
  color: #ddd;
  cursor: not-allowed;
  border: 1px solid #ddd;
}

/* // Custom-pagination */
.custom-pagination a,
.custom-pagination .disabled {
  margin: 0 5px;
}

.custom-pagination a:hover {
  background-color: #e0e0e0;
}



/* Media Queries */
@media (max-width: 678px) {
  .table>tbody>tr:first-child {
    display: none;
  }

  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }

  .table td {
    flex: 1 1 50%;
    position: relative;
    padding: 10px;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
  }
}

@media (min-width: 600px) {
  .accordion {
    max-width: 90%;
    flex-direction: row;
    justify-content: space-between;
    margin: .9em auto;
  }

  .accordion-item {
    font-size: 1.2em;
    margin-bottom: 0;
  }

  .accordion-item:nth-child(2) {
    margin: 0 1em;
  }
}


@media (max-width: 280px) {
  .table td {
    flex: 1 1 100%;
  }
}

.accordion-item {
  margin-bottom: 0.25em;
}

.accordion-header {
  border-radius: 10px 10px 0 0;
}

.vote_count.positive {
  color: var(--accent-gold);
  font-weight: bold;
}

.vote_count.negative {
  color: var(--accent-gold-dark);
  font-weight: bold;
}