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

body {
  background-color: #292524;
  color: #fafaf9;
  font-family: "Sono", sans-serif;
  padding: 48px 64px;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.hidden {
  display: none !important;
}

/* MAIN LAYOUT */
.container {
  max-width: 1500px;
  margin: 0 auto;
}

.header {
  margin-bottom: 3rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #292524;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.main {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 48px;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* ELEMENTS */

.logo {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-shrink: 0;
}

.logo img {
  height: 68px;
  width: 68px;
}

.title-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

h1 {
  font-family: "Coiny", sans-serif;
  font-size: 3.2rem;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1;
  margin: 0;
}

.slogan {
  font-family: "Sono", sans-serif;
  font-size: 1.2rem;
  color: #94a3b8;
  margin: 0;
  font-style: italic;
  letter-spacing: 1px;
}

.category {
  text-transform: uppercase;
  font-size: 14px;
  font-family: "Coiny", sans-serif;
  padding: 3px 10px;
  border-radius: 100px;
  cursor: pointer;
}

.fact {
  font-size: 20px;
  line-height: 1.4;
  background-color: #44403c;
  margin-bottom: 16px;
  padding: 16px 24px;
  letter-spacing: -1px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.fact-bottom-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tag {
  text-transform: uppercase;
  font-size: 14px;
  font-family: "Coiny", sans-serif;
  padding: 3px 10px;
  border-radius: 100px;
}

.fact-date {
  color: #a8a29e;
  font-size: 14px;
}

.vote-buttons {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.vote-buttons button {
  border: none;
  background-color: #78716c;
  font-size: 18px;
  padding: 6px 12px;
  border-radius: 100px;
  color: inherit;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

@media (max-width: 1200px) {
  .fact-bottom-line {
    flex-wrap: wrap;
    gap: 12px;
  }

  .vote-buttons {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

.source:link,
.source:visited {
  color: #3b82f6;
  text-decoration: none;
  margin-left: 12px;
  transition: 0.3s;
}

.source:hover,
.source:active {
  color: #60a5fa;
  text-decoration: underline;
}

.btn {
  border: none;
  font-family: "Coiny", sans-serif;
  line-height: 1;
  text-transform: uppercase;
  font-size: 17px;
  padding: 16px 0 13px;
  background-image: linear-gradient(135deg, #3b82f6, #ef4444, #16a34a, #eab308);
  color: inherit;
  border-radius: 100px;
  cursor: pointer;
  transition: 0.3s;
}

.btn:hover {
  transform: scale(110%) rotate(-2deg);
}

.btn-large {
  font-size: 1.4rem;
  padding: 1.2rem 2.4rem;
  text-transform: uppercase;
  font-family: "Coiny", sans-serif;
}

.btn-all-categories {
  margin-bottom: 16px;
  width: 100%;
  background-image: none;
  background-color: #000000;
  color: #ffffff;
}

.btn-category {
  width: 100%;
  background-image: none;
}

/* FORM */
.fact-form {
  background-color: #44403c;
  margin-bottom: 40px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 16px;
}

.fact-form input,
.fact-form select {
  width: 220px;
  background-color: #78716c;
  border: none;
  border-radius: 100px;
  padding: 16px;
  font-size: 18px;
  color: inherit;
  font-family: inherit;
}

.fact-form input::placeholder {
  color: #a8a29e;
}

.fact-form input:first-child {
  flex-grow: 1;
}

.fact-form span {
  font-weight: 600;
  font-size: 18px;
  margin-right: 18px;
}

@media (max-width: 1000px) {
  body {
    padding: 32px 48px;
  }

  .fact-form {
    flex-direction: column;
    align-items: stretch;
  }

  .fact-form input,
  .fact-form select {
    width: auto;
  }
}

/* Add hover effect for the title */
.logo:hover h1 {
  background-image: linear-gradient(135deg, #ef4444, #16a34a, #3b82f6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 16px;
    display: flex;
    justify-content: center; /* Center the container */
  }

  .container {
    width: 100%;
    max-width: 600px; /* Limit width on mobile */
    margin: 0 auto; /* Center the container */
    padding: 0 8px; /* Add small padding */
  }

  h1 {
    font-size: 3.2rem;
  }

  .slogan {
    font-size: 1.4rem;
  }

  .btn-large {
    font-size: 1.6rem;
    padding: 1.2rem 2.4rem;
  }

  .container {
    padding-right: 0; /* Remove extra padding */
  }

  .header {
    flex-direction: column;
    margin-bottom: 0;
    padding: 0;
  }

  .logo {
    justify-content: center;
    margin-right: 0;
  }

  .author-credits {
    margin-right: 0;
  }

  .header-controls {
    width: 100%;
    flex-direction: column;
    gap: 12px;
    margin-right: 0;
  }

  .sort-select {
    width: 100%;
    padding: 12px 16px;
  }

  .btn-open {
    width: 100%;
  }

  .main {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Improve category buttons layout for mobile */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 8px;
    padding: 0 4px;
    margin-right: 0;
  }

  .btn-all-categories {
    grid-column: 1 / -1; /* Make "All" button span full width */
    margin-bottom: 8px;
  }

  .btn-category,
  .btn-all-categories {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin-right: 0;
  }

  /* Adjust fact cards for mobile */
  .fact {
    padding: 12px 16px;
    font-size: 15px;
    margin-bottom: 12px;
    margin-right: 0;
  }

  .fact-form {
    padding: 16px;
    gap: 12px;
  }

  /* Make voting buttons more touch-friendly */
  .vote-buttons button {
    padding: 8px 12px;
    min-width: 60px;
  }

  /* Remove extra padding and margins */
  .facts-list,
  .fact-bottom-line,
  .vote-buttons,
  .container {
    padding-right: 0;
    margin-right: 0;
  }

  .author-credits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.2rem; /* Larger text on mobile */
    font-weight: bold; /* Make name bolder */
  }

  /* Create a separate line for links */
  .author-credits .links {
    font-size: 1rem; /* Slightly smaller than the name */
    font-weight: normal;
  }

  /* Make category tags smaller */
  .tag {
    font-size: 12px; /* Reduced from 14px */
    padding: 2px 8px; /* Reduced padding */
    margin: 0;
  }

  /* Adjust source and category container */
  .source-category-container {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap between source and category */
  }

  /* Adjust source size to match */
  .source:link,
  .source:visited {
    font-size: 12px; /* Match category size */
    margin: 0;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px; /* Reduce padding further */
  }

  h1 {
    font-size: 2.8rem;
  }

  .slogan {
    font-size: 1.2rem;
  }
}

.btn-open {
  margin-left: 0;
}

/* Update the gap between category buttons */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Add styles for header controls and sort select */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-select {
  background-color: #78716c;
  border: none;
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 16px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #3b82f6;
}

.author-credits {
  font-size: 1rem;
  color: #fafaf9;
  text-align: center;
  flex: 1;
}

.author-credits a {
  color: #3b82f6;
  text-decoration: none;
}

.author-credits a:hover {
  text-decoration: underline;
}

aside ul {
  list-style: none;
  padding: 0;
}

.btn-category,
.btn-all-categories {
  width: 100%;
  background-image: none;
  position: relative;
  padding-left: 48px; /* Space for the indicator */
  text-align: center; /* Center the text */
  display: flex;
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  padding-right: 48px; /* Balance the left padding */
}

.btn-category.active,
.btn-all-categories.active {
  transform: scale(1.05);
}

/* Just the indicator */
.btn-category.active::before,


/* Hover effect without changing opacity */
.btn-category:not(.active):hover,
.btn-all-categories:hover {
  background-color: #292524;
}

.btn-all-categories:hover {
  transform: scale(110%) rotate(-2deg);
}

/* Mobile Responsive Updates */
@media (max-width: 430px) {
  body {
    padding: 4px; /* Minimal padding on very small screens */
  }

  .container {
    padding-right: 0;
  }

  .header {
    gap: 12px;
    padding-right: 0;
  }

  h1 {
    font-size: 2rem;
  }

  .slogan {
    font-size: 0.9rem;
  }

  /* Make category grid single column for very small screens */
  aside ul {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-right: 0;
  }

  .btn-category,
  .btn-all-categories {
    width: 100%;
    margin-right: 0;
  }

  /* Adjust the form for smaller screens */
  .fact-form {
    padding: 12px;
  }

  .fact-form input,
  .fact-form select {
    font-size: 15px;
    padding: 10px 16px;
  }

  /* Remove extra padding and margins */
  .facts-list,
  .fact,
  .fact-bottom-line,
  .vote-buttons,
  .header,
  .logo,
  .author-credits,
  .header-controls {
    padding-right: 0;
    margin-right: 0;
  }

  /* Make category tags smaller */
  .tag {
    font-size: 11px; /* Even smaller on very small screens */
    padding: 2px 6px;
  }

  /* Adjust source and category container */
  .source-category-container {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap between source and category */
  }

  /* Adjust source size to match */
  .source:link,
  .source:visited {
    font-size: 11px; /* Match category size */
    margin: 0;
  }
}

/* Handle notch/dynamic island area on iPhone */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* Update the author credits styles */
.author-credits {
  font-size: 1rem;
  color: #fafaf9;
  text-align: center;
  flex: 1;
}

.author-credits a {
  color: #3b82f6;
  text-decoration: none;
}

.author-credits a:hover {
  text-decoration: underline;
}

/* Add mobile-specific styles */
@media (max-width: 768px) {
  .author-credits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.2rem; /* Larger text on mobile */
    font-weight: bold; /* Make name bolder */
  }

  /* Create a separate line for links */
  .author-credits .links {
    font-size: 1rem; /* Slightly smaller than the name */
    font-weight: normal;
  }
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Update mobile responsive styles */
@media (max-width: 768px) {
  body {
    padding: 16px;
    display: flex;
    justify-content: center; /* Center the container */
  }

  .container {
    width: 100%;
    max-width: 600px; /* Limit width on mobile */
    margin: 0 auto; /* Center the container */
    padding: 0 8px; /* Add small padding */
  }

  /* Adjust fact cards */
  .fact {
    width: 100%;
    margin: 0 auto 12px auto; /* Center facts with margin */
    font-size: 17px; /* Keep the larger font size */
  }

  /* Center the category buttons */
  aside ul {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 8px;
  }

  /* Center header elements */
  .header {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .header-controls {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* iPhone specific adjustments */
@media (max-width: 430px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 0 4px;
  }

  /* Keep everything centered */
  .fact,
  .header-controls,
  aside ul {
    max-width: 100%;
  }
}

/* Fix mobile layout */
@media (max-width: 768px) {
  body {
    padding: 24px 12px; /* Reduce horizontal padding */
  }

  .main {
    display: flex; /* Change from grid to flex */
    flex-direction: column;
    gap: 24px;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  section {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .facts-list {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .fact {
    width: 100%;
    margin: 0 0 16px 0; /* Only keep bottom margin */
    padding: 16px;
  }

  aside {
    width: 100%;
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding: 0;
  }

  .main {
    width: 100%;
    padding-right: 0;
  }

  section {
    width: 100%;
    padding-right: 0;
  }

  .facts-list {
    width: 100%;
    padding-right: 0;
  }

  .fact {
    width: 100%;
    padding: 16px;
    margin: 0 0 16px 0;
    box-sizing: border-box;
  }

  /* Override any inherited padding */
  .fact-bottom-line,
  .vote-buttons,
  .tag,
  .fact-date {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  /* Remove container constraints */
  .container {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Reset main section */
  .main {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Reset section and list */
  section,
  .facts-list {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Adjust fact cards */
  .fact {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    box-sizing: border-box;
  }

  /* Ensure body doesn't add extra space */
  body {
    padding: 16px 8px;
    max-width: 100%;
    overflow-x: hidden;
  }
}

@media (max-width: 768px) {
  /* Target both traditional and logical properties */
  .container,
  .main,
  section,
  .facts-list,
  .fact {
    width: 100% !important;
    inline-size: 100% !important;
    max-width: 100% !important;
    max-inline-size: 100% !important;

    padding-right: 0 !important;
    padding-inline-end: 0 !important;

    margin-right: 0 !important;
    margin-inline-end: 0 !important;
  }

  body {
    padding: 16px 8px !important;
    padding-inline: 8px !important;
    max-width: 100vw !important;
    max-inline-size: 100vw !important;
    overflow-x: hidden !important;
  }

  .fact {
    box-sizing: border-box !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
  }
}

/* Add larger margins to header controls */
.sort-select {
  margin: 0 48px;
  line-height: 1; /* Remove extra line height */
  padding: 8px; /* Consistent padding */
}

.sort-select option {
  padding: 8px;
  line-height: 1;
}

.btn-open {
  margin: 0 24px; /* 24px on left and right */
}

/* Preserve margins on mobile */
@media (max-width: 768px) {
  .sort-select,
  .btn-open {
    margin-left: 24px !important;
    margin-right: 24px !important;
  }
}

@media (max-width: 768px) {
  .tag {
    padding: 6px 12px; /* Reduce padding slightly on mobile */
    margin: 0 8px; /* Add some horizontal margin */
  }

  /* Specific adjustments for longer category names */
  .tag[style*="entertainment"],
  .tag[style*="technology"],
  .tag[style*="history"] {
    padding: 6px 10px; /* Slightly less padding for longer words */
    font-size: 0.9em; /* Slightly smaller font size */
    margin: 0 6px; /* Slightly less margin */
  }
}

/* Update sort select styles */
.sort-select {
  margin: 0 32px; /* Increased margin */
  position: relative;
  min-width: 200px; /* Ensure enough space for text */
}

/* Add "Sort by:" text using pseudo-element */
.sort-select::before {
  content: "Sort by:";
  position: absolute;
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
  color: #fafaf9;
  font-size: 16px;
}

/* Preserve margins on mobile */
@media (max-width: 768px) {
  .sort-select {
    margin-left: 32px !important;
    margin-right: 32px !important;
    width: calc(100% - 64px); /* Account for margins */
  }

  /* Adjust label position on mobile */
  .sort-select::before {
    left: 16px;
    transform: none;
    top: -24px;
  }
}

@media (max-width: 768px) {
  .fact {
    font-size: 17px;
    padding: 16px;
    margin-bottom: 12px;
  }

  /* Reorganize fact bottom line elements */
  .fact-bottom-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Create a container for source and category */
  .source-category-container {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Style source link */
  .source:link,
  .source:visited {
    display: inline-block;
    margin: 0;
    font-size: 0.9em;
  }

  /* Style category tag */
  .tag {
    margin: 0;
    display: inline-block;
  }

  /* Style date */
  .fact-date {
    font-size: 0.85em;
    margin: 4px 0;
  }

  /* Keep vote buttons at the bottom */
  .vote-buttons {
    width: 100%;
    justify-content: flex-start;
    margin-top: 8px;
  }
}

/* Update button styles for mobile */
@media (max-width: 768px) {
  .btn-large {
    font-size: 1.1rem; /* Reduced from 1.6rem */
    padding: 0.8rem 1.6rem; /* Reduced padding */
  }

  .btn-open {
    width: calc(100% - 32px);
    margin-bottom: 16px;
  }

  /* Keep category buttons rounded */
  .btn-category,
  .btn-all-categories {
    border-radius: 100px;
    background-image: none;
    box-shadow: none;
  }
}

/* Even smaller for very small screens */
@media (max-width: 430px) {
  .btn-large {
    font-size: 1rem; /* Further reduced */
  }

  .btn-open {
    font-size: 1.5rem !important;
    padding: 0.7rem 1rem;
  }
}

/* Mobile-specific category grid layout */
@media (max-width: 768px) {
  /* Adjust spacing between share fact and categories */
  .fact-form {
    margin-bottom: 24px; /* Reduced from 40px */
  }

  /* Create 2-column grid for categories */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
  }

  /* Make "All" button span full width */
  .btn-all-categories {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  /* Adjust category buttons for grid layout */
  .btn-category {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* Adjust mobile category layout */
@media (max-width: 768px) {
  /* Reduce space between fact form and categories */
  .fact-form {
    margin-bottom: 16px; /* Reduced from 24px */
  }

  /* Create 2-column grid for categories */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    width: 100%;
  }

  /* Center "All" button and make it narrower */
  .btn-all-categories {
    grid-column: 1 / -1;
    width: 50%; /* Make button narrower */
    margin: 0 auto 8px auto; /* Center horizontally and add small bottom margin */
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Adjust category buttons for grid layout */
  .btn-category {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* Additional adjustments for very small screens */
@media (max-width: 430px) {
  .btn-all-categories {
    width: 60%; /* Slightly wider on very small screens */
  }
}

@media (max-width: 768px) {
  /* Reduce space above categories */
  .fact-form {
    margin-bottom: 12px; /* Reduced space */
  }

  /* Create 2-column grid for categories */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    width: 100%;
  }

  /* Position "All" button in the middle */
  .btn-all-categories {
    grid-column: 1 / -1; /* Span both columns */
    width: 40%; /* Make button narrower */
    margin: 0 auto 8px auto; /* Center horizontally */
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    order: -1; /* Move to top */
  }

  /* Make category buttons fill their grid cells */
  .btn-category {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Ensure categories are arranged in 2 columns */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* Remove any previous mobile category styles */

@media (max-width: 768px) {
  /* Container for categories */
  aside ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 377px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }

  /* Category list item containing ALL button */
  .category:first-child {
    grid-column: 1 / -1;
    width: 40%;
    margin: -8px auto 0; /* Negative margin to move up and remove space */
  }

  /* ALL button styling */
  .btn-all-categories {
    width: 100%;
    min-height: 36px; /* Slightly reduced height */
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px; /* Reduced bottom margin */
    font-size: 13px; /* Slightly smaller font */
    padding: 6px 12px; /* Reduced padding */
  }

  /* Category buttons */
  .btn-category {
    width: 100%;
    min-height: 36px; /* Match ALL button height */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px; /* Match ALL button font size */
    padding: 6px 12px; /* Match ALL button padding */
  }

  /* Reduce space above categories */
  .fact-form {
    margin-bottom: 16px; /* Increased slightly to account for negative margin */
  }
}

/* Add these styles */
.comment-box {
  display: none;
  margin-top: 8px;
  width: 100%;
}

.comment-box.active {
  display: block;
}

.comment-textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  background-color: #292524;
  border: 1px solid #78716c;
  border-radius: 8px;
  color: #fafaf9;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 8px;
  resize: vertical;
}

.comment-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.comment-button {
  padding: 4px 12px;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  cursor: pointer;
  background-color: #78716c;
  color: #fafaf9;
}

.submit-comment {
  background-color: #ef4444;
}

.comments-section {
  margin-top: 1rem;
  padding: 0 1rem;
  border-top: 1px solid #44403c;
  padding-top: 0.5rem;
}

.comment {
  background-color: #292524;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.comment-text {
  color: #fafaf9;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.comment-date {
  color: #78716c;
  font-size: 0.8rem;
}

.comments-list {
  margin-top: 0.5rem;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.vote-type {
  font-size: 14px;
}

.comment-date {
  color: #78716c;
  font-size: 0.8rem;
}

/* Update comment button styles */
.comment-button {
  padding: 4px 12px;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  cursor: pointer;
  background-color: #78716c;
  color: #fafaf9;
}

/* Style for submit upvote button */
.submit-comment[data-vote-type="votesUp"] {
  background-color: #16a34a !important; /* Green color for upvotes */
}

/* Style for submit downvote button */
.submit-comment[data-vote-type="votesDown"] {
  background-color: #ef4444 !important; /* Red color for downvotes */
}

/* Default submit button style */
.submit-comment {
  background-color: #78716c;
}

.comments-title {
  font-size: 1rem;
  color: #a8a29e;
  margin-bottom: 0.5rem;
  font-family: "Coiny", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.comment-link {
  color: #3b82f6;
  text-decoration: none;
  word-break: break-all;
}

.comment-link:hover {
  text-decoration: underline;
  color: #60a5fa;
}

.comment-text {
  color: #fafaf9;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.fact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.share-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #fafaf9;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-button:hover {
  color: #eab308;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Make the share icon slightly larger */
.share-button svg {
  width: 28px;
  height: 28px;
}

.share-tooltip {
  position: absolute;
  background-color: #1a1a1a;
  color: #fafaf9;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  animation: fadeIn 0.2s ease-in-out;
  visibility: hidden;
  width: 120px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.highlight {
  animation: highlightFact 2s ease-out;
}

@keyframes highlightFact {
  0%,
  100% {
    background-color: #44403c;
  }
  50% {
    background-color: #57534e;
  }
}

/* Style for back button */
.btn-back {
  background-color: #1a1a1a !important;
  color: #fafaf9 !important;
  border: 1px solid #333 !important;
  margin-bottom: 16px !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  transition: all 0.2s !important;
}

.btn-back:hover {
  background-color: #333 !important;
  transform: translateX(-4px) !important;
}

@media (max-width: 768px) {
  .btn-back {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Share menu styles */
.share-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Make Copy Link option stand out */
.copy-link {
  padding: 16px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #333;
}

.copy-link .share-text {
  font-weight: 600;
  font-size: 1.1em;
}

.share-header {
  padding: 12px 16px;
  color: #78716c;
  font-size: 0.9em;
  font-weight: 500;
}

.share-section-header {
  padding: 8px 16px;
  color: #78716c;
  font-size: 0.9em;
  background-color: #1a1a1a;
  border-top: 1px solid #333;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  color: #fafaf9;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

.share-option:hover {
  background-color: #333;
}

/* Ensure the fact container has relative positioning for menu placement */
.fact {
  position: relative;
}

/* Fact not found error message styling */
.fact-not-found-message {
  text-align: center;
  padding: 4rem 2rem;
  background-color: #44403c;
  border-radius: 16px;
  margin: 2rem auto;
  max-width: 600px;
}

.fact-not-found-message h2 {
  color: #fbbf24;
  font-size: 2rem;
  margin-bottom: 1rem;
  font-family: "Coiny", sans-serif;
}

.fact-not-found-message p {
  color: #d6d3d1;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.fact-not-found-message .btn {
  margin: 0 auto;
  display: inline-block;
}
