.poll-history-item {
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg, #fff);
}

.poll-history-question {
    font-weight: 500;
}

.poll-history-answer {
    margin-top: 6px;
    font-size: 0.9rem;
}

.poll-history-status {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.poll-history-section {
    margin-top: 24px;
    border-top: 1px solid var(--card-border);
    padding-top: 16px;
}

.poll-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    border: 0;
    background: transparent;
    color: var(--text-color, #222);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.poll-history-toggle > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 0.75rem;
}

.poll-history-chevron {
    transition: transform 0.2s ease;
}

.poll-history-toggle.expanded .poll-history-chevron {
    transform: rotate(180deg);
}

.poll-history-content.hidden {
    display: none;
}

/* Custom CSS for Modern Glassmorphism Poll UI */

.poll-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.poll-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.badges-close-button {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8fafc;
}

.badges-close-button:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.poll-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.poll-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Poll Card & Options */
.poll-card {
  background: #ffffff;
}

.poll-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 18px;
}

/* Option Buttons */
.poll-option-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  text-align: left;
}

.poll-option-btn:hover {
  border-color: #6366f1;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.poll-option-btn:active {
  transform: translateY(0);
}

.poll-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.poll-option-btn:hover .poll-letter-badge {
  background: #6366f1;
  color: #ffffff;
}

.poll-option-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  flex-grow: 1;
}

/* Post-Vote Results UI */
.poll-result-bar-wrapper {
  position: relative;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1.5px solid transparent;
}

.poll-result-bar-wrapper.selected-option {
  border-color: #6366f1;
  background: #f5f3ff;
}

.poll-result-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(129, 140, 248, 0.25) 100%);
  border-radius: 10px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.poll-result-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
}

.poll-submitted-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 14px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Expanded Modal Dimensions for Long Content */
.poll-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;

  /* Increased Width & Height Limits */
  width: 92%;
  max-width: 680px;         /* Increased from 480px to give more room for text */
  min-height: 350px;        /* Ensures a solid baseline height */
  max-height: 88vh;         /* Uses up to 88% of vertical viewport height */

  overflow-y: auto;         /* Enables smooth scrolling when content exceeds max-height */
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15),
              0 0 0 1px rgba(226, 232, 240, 0.8);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Smooth Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.poll-modal-content::-webkit-scrollbar {
  width: 6px;
}

.poll-modal-content::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

/* Optional Mobile Adjustment */
@media (max-width: 576px) {
  .poll-modal-content {
    width: 95%;
    padding: 22px 18px;
    max-height: 92vh;
  }
}
