body {
  background: linear-gradient(135deg, #1A0033 0%, #2A0044 100%);
  color: #00FFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

#backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('images/Shiller.webp') no-repeat center center fixed;
  background-size: cover;
  opacity: 0.12;
  z-index: -1;
  animation: pulseBackdrop 15s infinite ease-in-out;
}

@keyframes pulseBackdrop {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.22; }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(106, 13, 173, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #00FFFF;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
  background: linear-gradient(90deg, #00FFFF, #FFD700);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header p {
  margin: 0;
  font-size: 1.1rem;
  color: #FFD700;
  font-weight: 500;
  opacity: 0.9;
}

h2 {
  color: #00FFFF;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

h3 {
  color: #00FFFF;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 16px 0;
}

button, input, select {
  background: rgba(106, 13, 173, 0.95);
  color: #00FFFF;
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 12px 24px;
  margin: 6px 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.1);
}

button:hover, input:hover, select:hover {
  background: linear-gradient(45deg, #6A0DAD, #870d94);
  border-color: #FFD700;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.3), 0 0 8px rgba(0, 255, 255, 0.2);
}

input[type="text"], select {
  background: rgba(106, 13, 173, 0.75);
  transition: background 0.3s ease;
}

input[type="file"] {
  padding: 10px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #FFD700;
  border-radius: 4px;
}

input::placeholder {
  color: rgba(0, 255, 255, 0.65);
  font-weight: 400;
}

#howto {
  padding: 28px;
  background: rgba(106, 13, 173, 0.88);
  border-radius: 16px;
  margin: 32px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#howto ul {
  list-style: none;
  padding: 0;
}

#howto li {
  margin: 12px 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.main-container {
  padding: 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.top-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
}

#leaderboard, #create {
  padding: 28px;
  background: rgba(106, 13, 173, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#leaderboard {
  max-width: 420px;
}

#leaderboardList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  background: rgba(0, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.leaderboard-entry:hover {
  background: rgba(0, 255, 255, 0.15);
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

.leaderboard-entry .rank {
  width: 32px;
  height: 32px;
  background: #FFD700;
  color: #1A0033;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-right: 14px;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.leaderboard-entry .campaign-name {
  flex: 1;
  color: #00FFFF;
  font-weight: 600;
}

.leaderboard-entry .completions {
  color: #FFD700;
  font-weight: 600;
}

#filters, #campaigns {
  padding: 28px;
  background: rgba(106, 13, 173, 0.88);
  border-radius: 16px;
  margin: 32px 0;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#filters {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 12px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: linear-gradient(45deg, #FFD700, #FFEA00);
  color: #1A0033;
  border-color: #FFD700;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

#campaignList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.campaign-card {
  background: rgba(106, 13, 173, 0.92);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.campaign-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3), 0 0 12px rgba(0, 255, 255, 0.2);
}

.campaign-card h3 {
  margin: 0 0 14px;
  font-size: 1.75rem;
  color: #00FFFF;
  font-weight: 700;
}

.campaign-card p {
  margin: 6px 0;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.campaign-card img {
  display: block;
  margin: 0 auto 14px;
  max-height: 200px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#campaigns {
  max-height: 720px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #FFD700 rgba(106, 13, 173, 0.5);
}

#campaigns::-webkit-scrollbar {
  width: 8px;
}

#campaigns::-webkit-scrollbar-track {
  background: rgba(106, 13, 173, 0.5);
}

#campaigns::-webkit-scrollbar-thumb {
  background: #FFD700;
  border-radius: 4px;
}

aside #create {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  align-items: flex-start;
  width: 100%;
}

.task-entry {
  display: flex;
  flex-direction: row;
  gap: 14px;
  margin-bottom: 14px;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
}

.task-entry select, .task-entry input {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  margin: 0;
  text-align: left;
  display: block; /* Ensure inputs are block-level to start on new line */
}

.task-entry .taskCost {
  color: #FFD700;
  font-size: 1rem;
  padding: 8px;
  margin: 0;
  text-align: left;
}

.task-entry .removeTask {
  padding: 10px 20px;
  font-size: 1rem;
  background: #FF4500;
  border-color: #FF4500;
  border-radius: 8px;
  margin: 0;
}

/* Specific fix for IPFS upload input/label */
#create input[type="text"][id*="ipfs"], #create label[for*="ipfs"] {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: left;
  clear: both; /* Ensure it starts on a new line */
}

#addTask {
  padding: 12px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
}

#chainSelector {
  padding: 12px;
  font-size: 1.05rem;
  border-radius: 10px;
}

#approveUSDC {
  padding: 12px;
  border: 1px solid #00FFFF;
  border-radius: 10px;
}

#approveUSDC:disabled {
  background: rgba(106, 13, 173, 0.6);
  cursor: not-allowed;
}

#dashboard {
  padding: 28px;
  background: rgba(106, 13, 173, 0.88);
  border-radius: 16px;
  margin: 32px 0;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.proof-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}

.proof-checkbox {
  cursor: pointer;
}

.proof-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: grid;
  place-content: center;
  z-index: 100;
}

.modal-content {
  background: rgba(106, 13, 173, 0.95);
  border-radius: 16px;
  padding: 28px;
  max-width: 640px;
  width: 90%;
  color: #00FFFF;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  font-size: 2rem;
  margin: 0 0 16px;
  font-weight: 700;
}

.modal-content h3 {
  font-size: 1.5rem;
  margin: 16px 0 8px;
}

.modal-content p {
  font-size: 1.05rem;
  margin: 8px 0;
  line-height: 1.6;
}

.task-list {
  margin: 16px 0;
}

.task-item {
  margin: 12px 0;
}

.task-link {
  display: inline-block;
  background: rgba(106, 13, 173, 0.95);
  color: #00FFFF;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.task-link:hover {
  background: linear-gradient(45deg, #FFD700, #FFEA00);
  color: #1A0033;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.close-modal {
  background: #FF4500;
  color: #ffffff;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: linear-gradient(45deg, #FFD700, #FFEA00);
  color: #1A0033;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.copyable {
  color: #FFD700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.copyable:hover {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.copy-btn {
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 10px;
}

.copy-btn:hover {
  background: linear-gradient(45deg, #6A0DAD, #870d94);
}

.completed {
  color: #FFD700;
  font-weight: 600;
  margin-left: 10px;
}

.pending {
  color: #FF4500;
  font-weight: 600;
  margin-left: 10px;
}

.ended {
  color: #FFD700;
  font-weight: 600;
  margin-left: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.pagination button {
  background: linear-gradient(45deg, #FFD700, #FFEA00);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  color: #1A0033;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination button:disabled {
  background: rgba(106, 13, 173, 0.6);
  cursor: not-allowed;
}

.pagination span {
  align-self: center;
  color: #FFD700;
  font-weight: 500;
}

.modal.error .modal-content {
  background: #ff4444;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 68, 68, 0.3);
}

.modal.success .modal-content {
  background: rgba(106, 13, 173, 0.95);
  color: #ffffff;
}

.howto-toggle {
  background: rgba(0, 255, 255, 0.12);
  color: #00FFFF;
  padding: 14px;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 1.05rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.howto-toggle:hover {
  background: rgba(0, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 255, 255, 0.3);
}

.howto-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  padding: 0 14px;
  background: rgba(106, 13, 173, 0.75);
  color: #ffffff;
  border-radius: 12px;
}

.howto-content.active {
  max-height: 640px;
  padding: 14px;
}