body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f5f7;
  color: #222;
}

/* News-style header */
#site-header {
  background: #111827;
  color: #f9fafb;
  border-bottom: 3px solid #2563eb;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo span {
  color: #facc15;
  margin-left: 4px;
}

.main-nav a {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 16px;
  font-size: 0.9rem;
}

.main-nav a:hover {
  text-decoration: underline;
}

#experiment-controls {
  background: #222;
  color: #fff;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

#experiment-controls.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#status-bar {
  background: #f0f0f0;
  padding: 6px 12px;
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid #ddd;
  justify-content: center;
}

/* Big banner container */
#top-banner {
  width: 100%;
  padding: 0;
}

#top-banner.hidden {
  display: none;
}

.top-banner-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Mid-page banner */
.banner-row {
  margin-top: 16px;
  margin-bottom: 4px;
}

.banner-row.hidden {
  display: none;
}

.banner-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.banner-image {
  width: 100%;
  height: 90px;
  display: block;
  object-fit: cover;
  border: 3px solid #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.7);
  cursor: pointer;
}

/* Sticky bottom banner */
.bottom-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #111827;
  border-top: 3px solid #f97316;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 9000;
}

.bottom-banner.hidden {
  display: none;
}

.bottom-banner img {
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
}

.bottom-banner-text {
  color: #f9fafb;
  font-size: 0.9rem;
}

/* Main layout */
#page {
  display: flex;
  min-height: calc(100vh - 180px);
  max-width: 1200px;
  margin: 0 auto;
}

/* Make content scrollable to force scrolling through articles */
#content {
  flex: 1;
  padding: 20px 24px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.section-title {
  margin-top: 0;
  font-size: 1.4rem;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 6px;
}

.task-intro {
  font-size: 0.95rem;
  color: #4b5563;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
}

/* Side ad columns */
.ad-column {
  width: 220px;
  background: #f4f4f4;
  padding: 12px 10px;
  display: none;
  gap: 10px;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

.ad-column::before {
  content: "Sponsored";
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 8px;
}

.ad-box {
  background: #ffffff;
  border: 2px solid #ff8800;
  padding: 4px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 0 5px #ff9900;
}

.ad-image {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

/* Inline article-style ads */
.inline-ad {
  background: #fff7ed;
  border-color: #f97316;
  position: relative;
}

.inline-ad::before {
  content: "ADVERTISEMENT";
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.7rem;
  color: #b45309;
}

.inline-ad img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  margin-top: 8px;
}

/* Article list */
#article-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 40px 0;
}

/* News-style article look */
.article {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
  cursor: pointer;
  background: #ffffff;
  border-left: 4px solid #9ca3af;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-left-color 0.15s ease;
  font-size: 0.95rem;
  line-height: 1.4;
}

.article:hover {
  background: #f9fafb;
  border-left-color: #2563eb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.hidden {
  display: none;
}

/* Popup ad */
.popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 280px;
  z-index: 9999;
}

.popup-content {
  background: white;
  border: 2px solid #ff9a00;
  padding: 15px 15px 30px 15px;
  height: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.popup-content p {
  margin-top: 0;
  font-weight: 600;
}

#popup-image-container img {
  max-width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  margin: 8px auto 0 auto;
}

#closePopup {
  position: absolute;
  top: -10px;
  right: -10px;
  background: red;
  color: white;
  font-weight: bold;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  border: none;
}

/* Flashing intrusive ad */
.flash-ad {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: yellow;
  color: red;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border: 3px solid red;
  animation: flash 0.5s infinite;
  cursor: pointer;
  z-index: 99999;
}

.flash-ad.hidden {
  display: none;
}

@keyframes flash {
  0% { background: yellow; }
  50% { background: red; color: white; }
  100% { background: yellow; }
}

/* Modal / start screen / survey */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal.visible {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px 25px;
  max-width: 520px;
  width: 90%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#survey-modal h2 {
  margin-top: 0;
}

#survey-modal textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: monospace;
}

.close-survey-btn {
  margin-top: 12px;
  padding: 6px 10px;
  background: #111827;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Survey styling (inside modal) */
#survey {
  margin-top: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

#survey label {
  display: block;
  margin-bottom: 6px;
}

#survey input {
  padding: 4px 6px;
  width: 80px;
}

#finishBtn {
  margin-top: 8px;
  padding: 6px 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#finishBtn:hover {
  background: #1d4ed8;
}

#csv-block {
  margin-top: 12px;
}

#csv-block label {
  display: block;
  margin: 6px 0 2px 0;
}
