/* -------------------------------
   Branding Colors
---------------------------------*/
:root {
  --primary-color: #0078d4;
  --secondary-color: #00aaff;
  --dark-gray: #333333;
  --light-gray: #f0f0f0;
  --white: #ffffff;
}

/* -------------------------------
   Global Styles
---------------------------------*/
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-gray);
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f0f5fa 0%, #ffffff 100%);
}

textarea {
  width: 100%;
  max-width: 100%;
  min-height: 4rem;
  resize: vertical;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
}

main#content {
  max-width: 600px;
  margin: 2rem auto;
  padding: 10rem 2rem 2rem 2rem;
  background-color: var(--white);
  border-radius: 80px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* -------------------------------
   Logo Styling
---------------------------------*/
#logo {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 200px;
  width: 50%;
  height: auto;
  z-index: 1000;
}

/* -------------------------------
   Touch / Mobile: Logo flows naturally
---------------------------------*/
html.touch-device #logo {
  position: relative;
  top: 0;
  left: auto;
  transform: none;
  width: 120px;
  margin: 0 auto 1.5rem auto;
}

/* -------------------------------
   Status & Spinner
---------------------------------*/
#status {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  white-space: pre-wrap;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--light-gray);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  margin-left: 0.5rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.35);
  }
}

/* -------------------------------
   Buttons & Confirmation
---------------------------------*/
#buttons {
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

#buttons.show {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#confirmation {
  display: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#confirmation.show {
  display: block;
  opacity: 1;
  transform: scale(1);
}

button {
  margin: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: var(--secondary-color);
  color: var(--white);
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px) scale(1.05);
}

#selectedChoice {
  font-weight: 600;
  color: var(--secondary-color);
}

/* -------------------------------
   Help Link & Contact
---------------------------------*/
#help-link {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  background-color: var(--white);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: pulse 2.5s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#help-link::before {
  content: "ℹ️";
  font-size: 1rem;
}

#help-link:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  animation: none;
}

#contact-link {
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

#contact-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* -------------------------------
   Help Table
---------------------------------*/
.help-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 1rem;
  text-align: left;
  min-width: 400px;
}

.help-table th {
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: 600;
  padding: 0.75rem;
  border-bottom: 2px solid var(--secondary-color);
}

.help-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

.help-table td strong {
  color: var(--primary-color);
}

.help-table tr:hover td {
  background-color: #f9f9f9;
  transition: background-color 0.3s ease;
}

/* -------------------------------
   Responsive / Touch / Mobile
---------------------------------*/
@media (max-width: 600px) {
  html.touch-device main#content {
    padding: 2rem;
    border-radius: 40px;
  }

  html.touch-device #buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  html.touch-device #buttons button {
    width: 90%;
    max-width: 300px;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  html.touch-device #confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  html.touch-device #confirmation button {
    width: 45%;
    min-width: 120px;
    padding: 0.75rem;
    font-size: 1rem;
  }

  html.touch-device .help-table-wrapper {
    overflow-x: auto;
  }

  html.touch-device .help-table {
    min-width: 400px;
  }
}