/* -----------------------------------
   CARD ANIMATIONS
----------------------------------- */
@keyframes cardPopIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Vote cards — snappy */
.card-animate {
  opacity: 0;
  animation: cardPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Results cards — slower, more deliberate */
.card-animate-slow {
  opacity: 0;
  animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* -----------------------------------
   PAGE LAYOUT
----------------------------------- */
.page {
  display: none;
  padding: 24px 0 40px;
  animation: none;
}

.page.active {
  display: block;
}

.profile-page.active {
  display: flex;
}

.results-page.active {
  display: block;
}

/* -----------------------------------
   PAGE TRANSITIONS
----------------------------------- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.page.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.page.slide-in-left {
  animation: slideInLeft 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* -----------------------------------
   LANDING PAGE
----------------------------------- */
.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 20px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.landing-tagline p {
  font-size: 18px;
  opacity: 0.75;
  margin: 0;
  line-height: 1.5;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.landing-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.landing-btn:hover {
  opacity: 0.85;
}

.primary-landing-btn {
  background: #e0e0e0;
  color: #222;
}

.secondary-landing-btn {
  background: #e0e0e0;
  color: #222;
}

body.dark-mode .secondary-landing-btn {
  background: #333;
  color: #eee;
}

.landing-about {
  border-top: 1px solid #ddd;
  padding-top: 24px;
  width: 100%;
}

body.dark-mode .landing-about {
  border-top-color: #333;
}

.landing-about h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.landing-about p {
  font-size: 15px;
  opacity: 0.7;
  line-height: 1.6;
  margin: 0;
}

/* -----------------------------------
   RESULTS PAGE
----------------------------------- */
.results-page {
  padding: 24px 0 60px;
}

.results-page-header {
  text-align: center;
  margin-bottom: 8px;
}

.results-heading {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}

.results-subheading {
  font-size: 14px;
  opacity: 0.6;
  margin: 0 0 24px;
}

.results-loading {
  opacity: 0.6;
  font-size: 15px;
  margin-top: 20px;
  text-align: center;
}

.results-page-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.back-to-vote-btn {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.6;
  font-family: inherit;
  transition: opacity 0.2s;
}

.back-to-vote-btn:hover {
  opacity: 1;
}

/* -----------------------------------
   RESULTS SCREEN (legacy — kept for safety)
----------------------------------- */
#results-screen {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.results-btn {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: #7c7c7c;
  color: #fff;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
  display: block;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 16px;
}

.share-btn {
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: #7c7c7c;
  color: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 15px;
}

.share-confirm {
  font-size: 13px;
  opacity: 0.7;
  margin: 0;
  min-height: 20px;
}

/* -----------------------------------
   RESULT BAR CARDS
----------------------------------- */
.result-bar-card {
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin: 16px 0;
  text-align: left;
  box-sizing: border-box;
}

.result-bar-prompt {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.9;
}

.result-bar-your-choice {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 14px;
}

.result-bar-track {
  width: 100%;
  height: 36px;
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  border-radius: 10px;
  width: 0%;
  /* transition applied via JS for animation */
}

.result-bar-pct {
  font-size: 20px;
  font-weight: 700;
  margin-top: 10px;
}

.result-bar-breakdown {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.65;
  margin-top: 6px;
}

/* -----------------------------------
   FOOTER
----------------------------------- */
footer {
  max-width: 600px;
  text-align: center;
  margin-top: 40px;
  opacity: 0.7;
}

/* -----------------------------------
   PROFILE PAGE
----------------------------------- */
.profile-page {
  justify-content: center;
  align-items: flex-start;
}

.profile-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
}

body.dark-mode .profile-card {
  background: #1e1e1e;
  box-shadow: none;
}

.profile-header {
  margin-bottom: 24px;
}

.profile-subtitle {
  opacity: 0.7;
  font-size: 14px;
}

.profile-field-group {
  margin-bottom: 24px;
  text-align: left;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.profile-label {
  display: block;
  margin-bottom: 6px;
  opacity: 0.8;
}

.profile-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
}

body.dark-mode .profile-input {
  background: #2a2a2a;
  border-color: #444;
  color: #fff;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #4a90e2;
  color: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}

.secondary-btn {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #ddd;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}

body.dark-mode .secondary-btn {
  background: #333;
  color: #fff;
}

.profile-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -----------------------------------
   AVATAR
----------------------------------- */
.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #4a90e2;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
}

.avatar-initial {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #b6b7b8;  /* change from grey to blue so it's visible */
  color: white;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
