/* Fonts */
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* Global */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: #111;
  color: #eee;
  overflow-y: scroll;
}
a { color: #ccc; text-decoration: none; }
a:visited { color: #bbb; }
a:hover { color: #aaa; }
a:active { color: #999; }

/* Header */
header {
  position: sticky;
  top: 0;
  background: #111;
  color: #fff;
  padding: 0.4rem 0.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}
header a { color: #fff; }
header h1 { margin: 0; font-weight: 700; font-size: 1.6rem; }
.simulation-notice { font-size: 0.9rem; color: #aaa; margin: 0.5rem 0; padding: 0.5rem; background: #222; border-radius: 8px; }

/* Main Layout */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 0.8rem;
}
.news-feed {
  min-height: 50vh; /* Ensure scrollable for infinite scroll */
}

/* Buttons */
.button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
}
.button-container.hidden { display: none; }
.question { font-size: 1.5rem; margin: 1rem 0; }
.stacked-button {
  background: #444;
  color: #eee;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0.5rem 0;
  width: 200px;
  text-align: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.stacked-button:hover { background: #666; transform: translateY(-2px); }
.stacked-button:active { background: #333; transform: translateY(0); }
#reset-selection {
  position: fixed; /* Fix the button to the viewport */
  
  right: 25%; /* Distance from the right of the viewport */
  margin-top: 0.2rem;
  width: auto;
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  z-index: 1000; /* Ensure it stays on top of other elements */
  background-color: grey; /* Background color */
  border: 1px solid #ccc; /* Border color */
  border-radius: 5px; /* Rounded corners */
  transition: background-color 0.3s ease, border-color 0.3s ease; /* Smooth transition for color */
}

/* Simple hover effect */
#reset-selection:hover {
  background-color: slategrey; /* Light gray on hover */
  border-color: #bbb; /* Slightly darker border on hover */
}

/* Focus effect for better accessibility */
#reset-selection:focus {
  outline: none; /* Remove default outline */
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.1); /* Subtle shadow on focus */
}





/* Posts */
.news-item {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 1rem;
  margin: 0 auto 1rem;
  opacity: 0; /* Start hidden */
  transform: translateY(20px); /* Slight upward animation */
  transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth fade and slide */
}

.news-feed {
  min-height: 100vh; /* Ensure scrollable */
}

.post-wrapper {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 12px;
  align-items: start;
}
.post-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.post-body { display: flex; flex-direction: column; }
.post-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.post-name { font-weight: 600; color: #fff; }
.post-handle { font-size: 0.9rem; color: #aaa; }
.post-time { font-size: 0.85rem; color: #777; margin-left: auto; }
.post-content p { margin: 0.4rem 0; line-height: 1.4; white-space: pre-wrap; }
.post-footer { display: flex; gap: 1rem; margin-top: 0.5rem; user-select: none; }
.post-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: #aaa;
}
.post-icon .icon-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.post-icon:hover .icon-box { background: rgba(255,255,255,0.1); }

.news-item.visible {
  opacity: 1;
  transform: translateY(0); /* End position */
}
/* Main Layout */
.news-feed {
  min-height: auto;
  position: relative; /* Contain children */
}

/* Loader */
.loader-wrapper {
  display: flex;
  justify-content: center;
  margin: 1rem 0; /* Reduced margin for tighter fit */
  min-height: 0; /* Remove fixed height to flow naturally */
}

.spinner {
  position: relative; /* Flow with content */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  opacity: 0; /* Start hidden */
  transition: opacity 0.3s ease; /* Smooth fade */
}

.spinner.visible {
  opacity: 1; /* Fade in when visible */
}

.spinner::before,
.spinner:after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.spinner:before {
  width: 100%;
  height: 100%;
  background-image: linear-gradient(0deg, #ff00cc 0%, #333399 100%);
  animation: spin8932 0.5s infinite linear;
}

.spinner:after {
  width: 85%;
  height: 85%;
  background-color: #212121;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin8932 {
  to {
    transform: rotate(360deg);
  }
}

/* End Message */
.end-message {
  text-align: center;
  padding: 1rem;
  color: #aaa;
  font-size: 1rem;
  opacity: 0; /* Start hidden */
  transition: opacity 0.3s ease; /* Smooth fade */
  margin-top: 0; /* No extra space until visible */
  display: none; /* Hidden by default */
}

.end-message.visible {
  opacity: 1; /* Fade in when visible */
  display: block; /* Ensure it shows */
}