/*
  Linkedly Project styles
  A dark, minimalist, futuristic design with neon accents. The page uses
  CSS variables to support dark/light modes and to centralise colours.
*/

:root {
  --bg-color: #0a0a0a;
  --text-color: #e6f1ff;
  --accent-color: #00ff9a;
  --secondary-color: #151515;
  --progress-bg: #333;
  --progress-fill: var(--accent-color);
  --input-bg: #0f0f0f;
  --input-border: var(--accent-color);
}

[data-theme='light'] {
  --bg-color: #f5f5f5;
  --text-color: #003366;
  --accent-color: #007f5f;
  --secondary-color: #ffffff;
  --progress-bg: #ccc;
  --progress-fill: var(--accent-color);
  --input-bg: #ffffff;
  --input-border: var(--accent-color);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Utility */
.badge-popup.hidden { display: none !important; }

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title {
  font-size: 1.8rem;
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Light/dark toggle button */
.mode-toggle {
  background: none;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-color);
  transition: transform 0.3s ease;
}

.mode-toggle:hover {
  transform: rotate(20deg);
}

.toggle-icon {
  font-size: 1rem;
}

/* Progress bar */
#progressContainer {
  width: 100%;
  height: 8px;
  background-color: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

#progressBar {
  height: 100%;
  width: 0%;
  background-color: var(--progress-fill);
  transition: width 0.3s ease;
}

/* Form sections */
.form-section {
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.form-section.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.required {
  color: var(--accent-color);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 2px solid transparent;
  border-bottom: 2px solid var(--input-border);
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-color);
}

textarea {
  height: 120px;
  resize: vertical;
}

small#charCount {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--accent-color);
}

#submitButton {
  width: 100%;
  padding: 12px;
  background-color: #0f1513;
  color: #8aa3a0;
  border: 2px solid #24332f;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: not-allowed;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#submitButton.ready {
  cursor: pointer;
  background: linear-gradient(135deg, #00ff9a 0%, #00d488 40%, #00b876 100%);
  color: #031b12;
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(0, 255, 154, 0.25) inset, 0 8px 24px rgba(0, 255, 154, 0.35);
  animation: none;
}

#submitButton:active {
  transform: scale(0.98);
}

#submitButton.ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(0, 255, 154, 0.3) inset, 0 10px 28px rgba(0, 255, 154, 0.45);
}

#submitButton:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--accent-color);
  }
  70% {
    box-shadow: 0 0 10px 6px rgba(0, 255, 154, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 154, 0);
  }
}

/* Spinner overlay */
#spinnerOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s ease;
}

#spinnerOverlay.hidden {
  visibility: hidden;
  opacity: 0;
}

.spinner-container {
  position: relative;
  width: 380px;
  height: 380px;
  margin-bottom: 32px;
}

.spinner-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 2px solid rgba(0, 255, 154, 0.4);
  overflow: hidden;
  box-shadow: 
    0 0 0 1px rgba(0, 255, 154, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 20px 60px rgba(0, 255, 154, 0.1);
}

.segment {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
  overflow: hidden;
}

.segment::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Spinner Labels - positioned on top for maximum visibility */
.spinner-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.segment-label {
  position: absolute;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 
    0 0 12px rgba(0, 0, 0, 1),
    0 0 20px rgba(0, 0, 0, 0.9),
    3px 3px 6px rgba(0, 0, 0, 1),
    0 0 4px rgba(0, 0, 0, 1);
  line-height: 1.1;
  white-space: pre-line;
  transform-origin: center center;
  z-index: 20;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.8);
  padding: 6px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Position each label in the center of its segment */
.label-1 {
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
}

.label-2 {
  top: 25%;
  right: 15%;
  transform: translate(50%, -50%) rotate(36deg);
  color: #ffffff;
}

.label-3 {
  bottom: 25%;
  right: 15%;
  transform: translate(50%, 50%) rotate(72deg);
  color: #ffffff;
}

.label-4 {
  bottom: 25%;
  left: 15%;
  transform: translate(-50%, 50%) rotate(-72deg);
  color: #ffffff;
}

.label-5 {
  top: 25%;
  left: 15%;
  transform: translate(-50%, -50%) rotate(-36deg);
  color: #ffffff;
}

.segment-1 {
  transform: rotate(0deg);
}
.segment-1::before {
  background: linear-gradient(135deg, #cc0000, #990000);
}

.segment-2 {
  transform: rotate(72deg);
}
.segment-2::before {
  background: linear-gradient(135deg, #0066cc, #004499);
}

.segment-3 {
  transform: rotate(144deg);
}
.segment-3::before {
  background: linear-gradient(135deg, #00aa33, #006622);
}

.segment-4 {
  transform: rotate(216deg);
}
.segment-4::before {
  background: linear-gradient(135deg, #aa0099, #660066);
}

.segment-5 {
  transform: rotate(288deg);
}
.segment-5::before {
  background: linear-gradient(135deg, #44aa00, #336600);
}

.spinner-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 140px;
  background: linear-gradient(to bottom, transparent 0%, #00ff9a 25%, #00ff9a 75%, transparent 100%);
  transform-origin: center bottom;
  transform: translate(-50%, -100%);
  border-radius: 2px;
  z-index: 12;
  box-shadow: 0 0 10px rgba(0, 255, 154, 0.6);
}

.spinner-needle::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 16px solid #00ff9a;
  filter: drop-shadow(0 0 6px rgba(0, 255, 154, 0.8));
}

.spinner-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #00ff9a, #00cc77);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 13;
  box-shadow: 
    0 0 0 2px rgba(0, 255, 154, 0.3),
    0 0 20px rgba(0, 255, 154, 0.4);
}

/* Add some subtle animations */
.spinner-needle {
  transition: transform 0.1s ease-out;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 255, 154, 0.6);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 154, 1);
  }
}

.spinner-needle.spinning {
  animation: pulse-glow 0.5s ease-in-out infinite;
}

.overlay-header { text-align: center; margin-bottom: 16px; }
.overlay-title { margin: 0 0 4px 0; font-size: 1.2rem; color: #e6f1ff; }
.overlay-subtext { margin: 0; font-size: 0.9rem; color: #9fb0c1; opacity: 0.9; }



.result-message {
  font-size: 1.2rem;
  color: var(--accent-color);
  text-align: center;
}

/* Success check animation */
.success-check { margin-top: 10px; }
.success-check.hidden { display: none; }
.check-svg { width: 72px; height: 72px; }
.check-circle { fill: rgba(0,255,154,0.1); stroke: var(--accent-color); stroke-width: 2; }
.check-mark { stroke: var(--accent-color); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; path-length: 1; animation: draw 700ms ease forwards; }
@keyframes draw { from { stroke-dasharray: 1 1; } to { stroke-dasharray: 1 0; } }

/* Confetti */
.confetti {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1200;
}

@media (max-width: 480px) {
  .spinner-container { 
    width: 320px; 
    height: 320px; 
  }
  .spinner-needle { 
    height: 120px; 
  }
  .segment-label { 
    font-size: 0.75rem; 
    padding: 3px 6px;
    letter-spacing: 0.3px;
  }
}

/* Trophy overlay */
#trophyOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}

#trophyOverlay.visible {
  visibility: visible;
  opacity: 1;
}

.trophy-card {
  background-color: var(--secondary-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-color);
  max-width: 520px;
  box-shadow: 0 0 20px var(--accent-color);
}

.trophy-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.trophy-title { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px 0; }
.trophy-sub { margin: 0 0 8px 0; color: #cfe9e2; }
.trophy-follow { margin: 0; color: #cfe9e2; }
.trophy-follow a { color: var(--accent-color); text-decoration: underline; }

@media (max-width: 520px) {
  .trophy-card { max-width: calc(100% - 48px); padding: 22px 16px; }
  .trophy-title { font-size: 1.2rem; }
  .trophy-sub, .trophy-follow { font-size: 0.95rem; }
}

/* Badge styling */
.badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(180deg, #2b2b2b 0%, #1f1f1f 100%);
  color: #e6f1ff;
  border: 2px solid var(--accent-color);
  padding: 12px 16px 12px 44px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  z-index: 500;
  clip-path: polygon(0% 0%, 82% 0%, 94% 0, 100% 22%, 100% 100%, 0% 100%);
  box-shadow: 0 0 0 2px rgba(0, 255, 154, 0.18) inset, 0 8px 22px rgba(0, 255, 154, 0.28);
  overflow: hidden;
}

.badge:hover {
  transform: translateY(-1px) scale(1.03);
  background: linear-gradient(180deg, #343434 0%, #232323 100%);
  box-shadow: 0 0 0 2px rgba(0, 255, 154, 0.22) inset, 0 12px 28px rgba(0, 255, 154, 0.35);
}

.badge::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 30% 30%, #c9d2d9, #7a848a);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #111, 0 0 12px rgba(230, 241, 255, 0.25);
}

.badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 40% 60%, rgba(255,255,255,0.08) 100%);
  pointer-events: none;
  border-radius: 10px;
  clip-path: polygon(0% 0%, 82% 0%, 94% 0, 100% 22%, 100% 100%, 0% 100%);
}

/* Badge emblem + text layout */
.badge-emblem {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--accent-color);
  filter: drop-shadow(0 0 6px rgba(0, 255, 154, 0.35));
}

.badge-text {
  position: relative;
  z-index: 1;
}
.badge-popup {
  position: fixed;
  bottom: 60px;
  right: 20px;
  background-color: var(--secondary-color);
  border: 2px solid var(--accent-color);
  border-radius: 4px;
  padding: 10px;
  color: var(--text-color);
  z-index: 501;
  max-width: 200px;
  font-size: 0.8rem;
}

.badge-popup a {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Coin styling */
#coinContainer {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 300;
}

/* Bot deterrents */
.hp-wrapper {
  display: none !important;
}
.hp-field { display: none; }

.form-error {
  margin-bottom: 12px;
  color: #ff6b6b;
  font-size: 0.9rem;
}

.fine-print {
  margin-top: 10px;
  color: #9fb0c1;
  opacity: 0.8;
  font-size: 0.75rem;
}

.coin {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  animation: fall linear;
}

@keyframes fall {
  0% {
    transform: translateY(-10%);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh);
    opacity: 0;
  }
}

/* Animated background gradient movement */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 10% 10%, #002233, #000011);
  opacity: 0.35;
  transform: translate(-50%, -50%);
  animation: backgroundMove 30s linear infinite;
  z-index: -1;
}

@keyframes backgroundMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-50%, -50%);
  }
}