/**
 * polls.css - Community Polls Page Styles
 * Modern, high-contrast design with glass morphism
 */

/* ===== PAGE LAYOUT ===== */
.polls-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* ===== HERO SECTION ===== */
.polls-hero {
  position: relative;
  text-align: center;
  padding: 4rem 2rem 3rem;
  margin-bottom: 3rem;
  overflow: hidden;
}

.polls-hero__glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(24, 225, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.polls-hero__content {
  position: relative;
  z-index: 1;
}

.polls-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(24, 225, 255, 0.15), rgba(147, 51, 234, 0.15));
  border: 1px solid rgba(24, 225, 255, 0.3);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan, #18e1ff);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.5s ease-out;
}

.polls-hero__badge svg {
  stroke: currentColor;
}

.polls-hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #fff;
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.polls-hero h1 .highlight {
  background: linear-gradient(135deg, var(--cyan, #18e1ff) 0%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.polls-hero__sub {
  font-size: 1.1rem;
  color: #a1a1aa;
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ===== STATS ROW ===== */
.polls-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease-out 0.3s both;
}

.polls-stat {
  text-align: center;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  min-width: 140px;
  transition: all 0.3s ease;
}

.polls-stat:hover {
  border-color: rgba(24, 225, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.polls-stat__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--cyan, #18e1ff);
  opacity: 0.8;
}

.polls-stat__value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.polls-stat__label {
  font-size: 0.7rem;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ===== SECTION HEADERS ===== */
.polls-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.polls-section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.polls-section-header h2 svg {
  color: var(--cyan, #18e1ff);
  opacity: 0.8;
}

.polls-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ef4444;
}

.polls-live-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ===== FEATURED POLL SECTION ===== */
.polls-featured {
  margin-bottom: 3rem;
}

.polls-featured__poll {
  background: linear-gradient(135deg, rgba(24, 225, 255, 0.05), rgba(147, 51, 234, 0.05));
  border: 1px solid rgba(24, 225, 255, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.polls-featured__poll::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan, #18e1ff), #9333ea);
}

/* Featured Poll Content Layout */
.poll-featured-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

.poll-featured-chart {
  display: flex;
  justify-content: center;
}

.poll-featured-chart svg {
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.poll-featured-chart svg path,
.poll-featured-chart svg circle {
  stroke: rgba(15, 20, 25, 0.9);
  stroke-width: 3;
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-origin: center;
}

.poll-featured-chart svg path:hover,
.poll-featured-chart svg circle:hover {
  transform: scale(1.04);
  filter: brightness(1.2);
}

.poll-featured-chart svg text {
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.poll-featured-info {
  display: flex;
  flex-direction: column;
}

.poll-featured-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}

.poll-featured-meta {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin: 0 0 1.5rem;
}

.poll-featured-info .poll-legend {
  justify-content: flex-start;
  max-width: none;
  margin-bottom: 1.5rem;
}

.poll-featured-desc {
  font-size: 0.95rem;
  color: #71717a;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .poll-featured-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .poll-featured-info {
    align-items: center;
  }

  .poll-featured-info .poll-legend {
    justify-content: center;
  }
}

/* ===== POLLS SECTION ===== */
.polls-section {
  margin-bottom: 4rem;
}

/* ===== POLLS GRID ===== */
.polls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 400px) {
  .polls-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== POLL CARD ===== */
.poll-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.poll-card:hover {
  transform: translateY(-4px);
  border-color: rgba(24, 225, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.poll-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan, #18e1ff), #9333ea);
  opacity: 0;
  transition: opacity 0.3s;
}

.poll-card:hover::before {
  opacity: 1;
}

.poll-card__header {
  margin-bottom: 1.25rem;
}

.poll-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.poll-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.poll-card__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #22c55e;
  flex-shrink: 0;
}

.poll-card__live-dot {
  width: 5px;
  height: 5px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.poll-card__desc {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.poll-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: #71717a;
}

.poll-card__meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.poll-card__meta i {
  opacity: 0.7;
}

/* ===== POLL OPTIONS ===== */
.poll-card__options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.poll-option {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.poll-option:not(.poll-option--voted):hover {
  border-color: rgba(24, 225, 255, 0.4);
  background: rgba(24, 225, 255, 0.08);
}

.poll-option:not(.poll-option--voted):active {
  transform: scale(0.98);
}

.poll-option--voted {
  cursor: default;
}

.poll-option__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(24, 225, 255, 0.2), rgba(24, 225, 255, 0.05));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0.75rem 0 0 0.75rem;
}

.poll-option__content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.poll-option__text {
  font-weight: 500;
  color: #e4e4e7;
  font-size: 0.95rem;
}

.poll-option__percent {
  font-weight: 700;
  color: var(--cyan, #18e1ff);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ===== POLL CTA ===== */
.poll-card__cta {
  margin-top: 1rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.poll-card__cta p {
  font-size: 0.8rem;
  color: #71717a;
  margin: 0;
}

/* ===== PIE CHART POLL (Featured) ===== */
.poll-card--pie {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.poll-card--pie:hover {
  transform: none;
  box-shadow: none;
}

.poll-card--pie::before {
  display: none;
}

.poll-card--pie .poll-card__header {
  margin-bottom: 1.5rem;
  width: 100%;
}

.poll-card--pie .poll-card__title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.poll-card--pie .poll-card__meta {
  justify-content: center;
  color: #a1a1aa;
}

.poll-pie-chart {
  position: relative;
  margin: 0 0 1.5rem;
}

.poll-pie-chart svg {
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.poll-pie-chart svg path,
.poll-pie-chart svg circle {
  stroke: rgba(15, 20, 25, 0.9);
  stroke-width: 3;
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-origin: center;
}

.poll-pie-chart svg path:hover,
.poll-pie-chart svg circle:hover {
  transform: scale(1.04);
  filter: brightness(1.2);
}

.poll-pie-chart svg text {
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* ===== PIE CHART LEGEND ===== */
.poll-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.poll-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #e4e4e7;
}

.poll-legend__color {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.poll-legend__label {
  font-weight: 500;
}

.poll-legend__percent {
  font-weight: 700;
  color: #a1a1aa;
  margin-left: 0.25rem;
}

.poll-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--cyan, #18e1ff);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  background: rgba(24, 225, 255, 0.1);
  border: 1px solid rgba(24, 225, 255, 0.3);
  border-radius: 999px;
}

.poll-card__link:hover {
  color: #fff;
  background: rgba(24, 225, 255, 0.2);
  transform: translateX(3px);
}

/* ===== HOW IT WORKS SECTION ===== */
.polls-how-it-works {
  margin-top: 4rem;
  text-align: center;
}

.polls-how-it-works h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
}

.polls-how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.polls-how-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  transition: all 0.3s ease;
}

.polls-how-card:hover {
  border-color: rgba(24, 225, 255, 0.3);
  transform: translateY(-4px);
}

.polls-how-card__number {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--cyan, #18e1ff), #9333ea);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.polls-how-card__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--cyan, #18e1ff);
  opacity: 0.8;
}

.polls-how-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.polls-how-card p {
  font-size: 0.9rem;
  color: #a1a1aa;
  line-height: 1.6;
  margin: 0;
}

/* ===== LOADING STATE ===== */
.polls-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
}

.polls-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--cyan, #18e1ff);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.polls-loading p {
  color: #71717a;
  font-size: 0.9rem;
}

/* ===== EMPTY STATE ===== */
.polls-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
}

.polls-empty__icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.polls-empty h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.polls-empty p {
  color: #71717a;
  max-width: 300px;
  margin: 0 auto;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== POLL LOADING STATE ===== */
.poll-loading {
  opacity: 0.6;
  pointer-events: none;
}

.poll-loading .poll-option {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .polls-page {
    padding: 0 1rem 5rem;
  }

  .polls-hero {
    padding: 3rem 1rem 2rem;
  }

  .polls-hero h1 {
    font-size: 2.25rem;
  }

  .polls-stats {
    gap: 0.75rem;
  }

  .polls-stat {
    padding: 1rem 1.25rem;
    min-width: 100px;
  }

  .polls-stat__value {
    font-size: 1.5rem;
  }

  .polls-grid {
    grid-template-columns: 1fr;
  }

  .poll-card {
    padding: 1.25rem;
  }

  .polls-featured__poll {
    padding: 1.5rem;
  }

  .polls-how-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .polls-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .poll-legend {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* ===== HOME PAGE PIE CHART (Widget) ===== */
.poll-card--hero.poll-card--pie {
  background: rgba(15, 20, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.poll-card--hero.poll-card--pie .poll-card__title {
  font-size: 1.1rem;
}

.poll-card--hero.poll-card--pie .poll-legend {
  flex-direction: column;
  max-width: 180px;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.poll-card--hero.poll-card--pie .poll-legend__item {
  font-size: 0.75rem;
  width: 100%;
}

.poll-card--hero.poll-card--pie .poll-legend__label {
  flex: 1;
  text-align: left;
}

/* ===== PLACEHOLDER STATE ===== */
.poll-card--placeholder {
  background: rgba(15, 20, 25, 0.9);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 2rem;
}

.poll-placeholder {
  text-align: center;
}

.poll-placeholder__icon {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.poll-placeholder__text {
  font-size: 1rem;
  color: #a1a1aa;
  margin: 0 0 0.25rem;
}

.poll-placeholder__sub {
  font-size: 0.8rem;
  color: #71717a;
  margin: 0;
}
