/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* CAPTCHA Container */
.captcha-container {
  max-width: 320px;
  margin: 0 auto 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.captcha-box {
  text-align: center;
}

.captcha-box h3 {
  margin: 0 0 10px;
  color: #333;
  font-size: 1.2em;
}

.captcha-box p {
  margin: 0 0 15px;
  color: #666;
  font-size: 0.9em;
}

.captcha-text {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  margin-bottom: 15px;
  background: #f5f5f5;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 5px;
  user-select: none;
  color: #333;
  border: 1px dashed #ccc;
}

.captcha-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.captcha-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.captcha-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.captcha-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.captcha-button:hover {
  background: #e9e9e9;
  border-color: #ccc;
}

.captcha-button svg {
  width: 20px;
  height: 20px;
  color: #666;
}

.captcha-verify-button {
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

.captcha-verify-button:hover {
  background: #5a6fd8;
}

.captcha-verify-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.captcha-status {
  margin: 10px 0 0;
  min-height: 20px;
  font-size: 14px;
  font-weight: 500;
}

.captcha-status.success {
  color: #4caf50;
}

.captcha-status.error {
  color: #f44336;
}

/* Hide CAPTCHA by default */
.captcha-container {
  display: none;
}

/* Show CAPTCHA when needed */
.show-captcha .captcha-container {
  display: block;
}

/* Hide poll options until verified */
.poll-options {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s;
}

.show-poll-options .poll-options {
  opacity: 1;
  pointer-events: auto;
}

/* Poll Container */
.poll-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out;
}

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

/* Poll Title */
.poll-title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    line-height: 1.3;
}

/* Poll Options */
.poll-options {
    margin-bottom: 30px;
}

.poll-option {
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.poll-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.option-content {
    padding: 20px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

.option-icon {
    font-size: 1.5em;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.option-text {
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
    flex-grow: 1;
    text-align: left;
}

.vote-count {
    font-weight: 600;
    color: #667eea;
    margin-left: 10px;
    font-size: 0.9em;
    transition: opacity 0.3s ease;
}

.vote-count.visible {
    opacity: 1;
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.8s ease-out;
}

/* Voted State */
.poll-option.voted {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* Total Votes */
.total-votes {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
}

.total-votes p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Status Display */
.status-display {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 480px) {
    .poll-container {
        padding: 25px;
    }
    
    .poll-title {
        font-size: 1.5em;
    }
    
    .option-content {
        padding: 15px;
    }
    
    .option-icon {
        font-size: 1.3em;
        margin-right: 10px;
    }
    
    .option-text {
        font-size: 1em;
    }
}


.total-votes p {
  margin: 0;                          /* Remove default margin */
  font-size: 14px;                    /* Smaller font */
  color: #666;                        /* Medium gray text */
}

.total-votes span {
  font-weight: 600;                   /* Bold font weight */
  color: #333;                        /* Dark gray text */
}

/* ======================================== */
/* TUTORIAL STYLES */
/* ======================================== */

/* Tutorial steps container */
.tutorial-steps {
  margin-bottom: 40px;                /* Space below tutorial */
}

/* Individual tutorial step */
.step {
  margin-bottom: 24px;                /* Space between steps */
  padding: 20px;                      /* Internal spacing */
  background-color: #f8f9fa;          /* Light background */
  border-left: 4px solid #007bff;     /* Blue left border */
  border-radius: 4px;                 /* Rounded corners */
}

.step h4 {
  margin: 0 0 8px 0;                  /* Remove default margin, add bottom margin */
  font-size: 16px;                    /* Font size */
  font-weight: 600;                   /* Bold font weight */
  color: #007bff;                     /* Blue text */
}

.step p {
  margin: 0;                          /* Remove default margin */
  font-size: 14px;                    /* Smaller font */
  color: #666;                        /* Medium gray text */
  line-height: 1.5;                   /* Tighter line height */
}

/* Status display styling */
.status-display {
  padding: 16px;                      /* Internal spacing */
  background-color: #f8f9fa;          /* Light background */
  border-radius: 8px;                 /* Rounded corners */
  border: 1px solid #e0e0e0;          /* Light border */
  margin-bottom: 40px;                /* Space below status */
}

.status-display p {
  margin: 0;                          /* Remove default margin */
  font-size: 14px;                    /* Smaller font */
  font-weight: 500;                   /* Medium font weight */
}

/* ======================================== */
/* RESPONSIVE DESIGN */
/* ======================================== */

/* Mobile devices (screens smaller than 768px) */
@media (max-width: 768px) {
  main {
    margin: 40px auto;                /* Reduce top/bottom margin */
    padding: 0 16px;                  /* Reduce left/right padding */
  }

  header {
    padding: 16px 20px;               /* Reduce header padding */
    flex-direction: column;           /* Stack header items vertically */
    gap: 8px;                         /* Space between header items */
  }

  .poll-container {
    padding: 24px 16px;               /* Reduce poll container padding */
  }

  .vote-buttons {
    flex-direction: column;           /* Stack buttons vertically */
    gap: 16px;                        /* Reduce gap between buttons */
  }

  .vote-btn {
    min-width: 100%;                  /* Full width buttons */
    padding: 16px 20px;               /* Reduce button padding */
  }

  .vote-text {
    font-size: 16px;                  /* Smaller font for mobile */
  }

  .vote-count {
    font-size: 20px;                  /* Smaller count font for mobile */
  }

  .step {
    padding: 16px;                    /* Reduce step padding */
  }
}

/* ======================================== */
/* ANIMATIONS */
/* ======================================== */

/* Slide in animation for vote confirmations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide out animation for vote confirmations */
@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Pulse animation for vote counts */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Apply pulse animation when vote counts update */
.vote-count.updated {
  animation: pulse 0.3s ease-in-out;
}
