/* Overlay background */
.custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal content */
.custom-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

/* Close button */
.badges-close-button {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
}

/* Badge item */
.badges-entry {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.badges-icon {
    width: 48px;
    height: 48px;
    margin-right: 16px;
    border-radius: 8px;
}

.poll-button {
  display: block;        /* Make buttons take full width and stack vertically */
  width: 100%;           /* Optional: full width or adjust as needed */
  margin: 8px 0;         /* Vertical margin for spacing between buttons */
  padding: 10px 15px;    /* Comfortable padding */
  font-size: 16px;       /* Readable text size */
  cursor: pointer;
  border-radius: 6px;    /* Rounded corners, optional */
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  transition: background-color 0.2s ease;
}

.poll-button:hover {
  background-color: #d0eaff; /* Highlight on hover */
}

.vote-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin: 20px auto;   /* centers horizontally */
    max-width: 400px;    /* prevents it from taking the full width */
    text-align: center;  /* ensures the title is centered */
}

.vote-title {
    font-size: 1.4em;
    margin-bottom: 12px;
    color: #333;
    text-align: center;
}

.vote-options {
    list-style: none;
    padding: 0;
    margin: 0 auto;      /* centers the list */
    width: fit-content;  /* shrink to content width */
}

.vote-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    background: #fff;
    border-radius: 4px;
}

.vote-option-item:hover {
    background: #f8f8f8;
}

.drag-handle {
    cursor: grab;
    font-size: 1.2em;
    color: #888;
    user-select: none;
}

.drag-handle:hover {
    color: #555;
}

#presentationProgressWrapper {
  border: 2px solid var(--tertiary-color);
  border-radius: 12px;
  box-shadow: 0 0 10px var(--glow-color);
  height: 16px; /* Adjust thickness */
  margin-bottom: 16px; /* Space below */
  overflow: hidden;
  background-color: #e0e0e0; /* Light background */
}

#presentationProgress {
  height: 100%;
  width: 0%;
  cursor: pointer;
  background-color: var(--tertiary-color);
  transition: width 1s linear;
}

#questionList {
  max-height: 400px; /* Adjust as needed */
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 20px !important; /* Forces space at the very start of the list */
  padding-right: 5px;     /* Optional: space for scrollbar */
  border: 2px solid var(--tertiary-color);
  border-radius: 12px;       /* Rounded corners for a modern look */
  box-shadow: 0 0 10px var(--glow-color); /* Subtle glowing effect */
}

.question-bubble {
  background-color: #f0f2f5;
  color: #2a3344;
  padding: 12px 18px;
  border-radius: 20px;
  margin-bottom: 16px;
  position: relative; /* Ensure this is here so the label anchors correctly */
  max-width: 100%;
  word-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  animation: fadeSlideIn 0.4s ease forwards;
  opacity: 0; /* Start transparent for animation */
  flex-direction: column;
  align-items: stretch !important; /* Changed from flex-start to stretch */
  gap: 10px;
}

/* 2. Target only the first bubble in the list */
.question-bubble:first-child {
    margin-top: 15px; /* Only the top one moves down to show the label */
}

/* Styling for the Answered Divider */
.answered-divider {
    text-align: center;
    margin: 20px 0;
    font-size: 0.85rem;
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

/* Keep the upvote button looking active even in answered bubbles */
.question-bubble.is-answered .btn-outline-primary {
    opacity: 1 !important;
}

/* Answered State - Mixed in the list */
.question-bubble.is-answered {
    background-color: #e9ecef; /* Neutral gray */
    border-left: 6px solid #6c757d; /* Strong vertical indicator */
    opacity: 0.8; /* Slight dimming so active ones 'pop' more */
    box-shadow: none; /* Remove the glowing effect */
}

.answer-content {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Add a small 'Answered' label inside the bubble */
.question-bubble.is-answered::before {
    animation: badgePop 0.3s ease-out;
    content: "✓ Answered";
    position: absolute;
    top: -12px;
    left: 15px;
    background: #6c757d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 10;        /* Ensure it sits on top of the border */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes badgePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.question-bubble.is-answered .question-text {
    color: #495057;
    /* Optional: text-decoration: line-through; if you still want the strike */
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-text {
  font-size: 16px;
}

.vote-controls {
  /* Remove width: 100% */
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0; /* Ensures buttons don't crush */
}

#questionForm {
  flex-direction: column;
  gap: 10px !important;
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 15px;
  border: 2px solid var(--tertiary-color);
  border-radius: 12px;       /* Rounded corners for a modern look */
  box-shadow: 0 0 10px var(--glow-color); /* Subtle glowing effect */
}

#sendBtn {
  background-color: var(--button-bg);
  width: auto !important;
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem; 
  white-space: nowrap;
}

.buzzer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buzzer-close-button {
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 2em;
  color: white;
  cursor: pointer;
  z-index: 1001;
  user-select: none;
}
.buzzer-close-button:hover {
  color: #ffcccc;
}

.quiz-answer-choice {
    width: 90%;
    padding: 12px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    color: white;
    text-align: left;
    transition: transform 0.2s ease;
}

#downloadBadgesBtn {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#downloadBadgesBtn:hover {
    transform: scale(1.15);
    opacity: 0.8;
    color: #c56c86; /* Keeps the color consistent */
}
