/* HNTB First Kiosk Styles */

/* Base styles */
#hntb-kiosk-first {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden !important;
  width: 1080px;
  height: 1920px;
  background: #000;
}

/* Ensure body and html never show scrollbars */
body, html {
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#hntb-kiosk-first * {
  box-sizing: border-box;
}

/* Screen containers */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden !important;
  width: 100%;
  height: 100%;
}

.screen-background {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.screen-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px;
}

/* Start Screen */
.start-screen .logo-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 300px;
  background-color: white;
}

.start-screen .game-logo {
  width: max-content;
  max-width: max-content;
  height: max-content;
  max-height: max-content;
}

.start-screen .game-logo img {
  width: auto;
  height: 120px;
  max-height: 120px;
}

.start-button {
  font-family: 'Interstate', Arial, sans-serif;
  font-size: 64px;
  font-weight: bold;
  padding: 32px 72px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  color: white;
  border: none;
  border-radius: 80px;
  background-color: #f26522;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
  transform: translateY(-2px);
  background-color: #d9541d;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.3s ease;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.popup-content {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  overflow: hidden !important;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  padding: 80px;
  animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  background: linear-gradient(145deg, #ffffff 0%, #f8f8f8 100%);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3),
  0 10px 25px rgba(0, 0, 0, 0.1),
  inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-close {
  font-size: 24px;
  font-weight: bold;
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #999;
  border: 2px solid transparent;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.popup-close:hover {
  transform: rotate(90deg) scale(1.1);
  color: #f26522;
  border-color: #f26522;
  background: rgba(242, 101, 34, 0.1);
}

.popup-content h2 {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 50px 0;
  text-align: center;
  letter-spacing: -1px;
  color: #1a1a1a;
  background: linear-gradient(135deg, #333 0%, #666 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Form styles */
.form-group {
  margin-bottom: 35px;
  animation: fadeInUp 0.5s ease backwards;
}

.form-group:nth-child(1) {
  animation-delay: 0.1s;
}

.form-group:nth-child(2) {
  animation-delay: 0.2s;
}

.form-group:nth-child(3) {
  animation-delay: 0.3s;
}

.form-group label {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
}

.form-group input {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  width: 100%;
  padding: 22px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  background: #fafafa;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.form-group input:focus {
  transform: translateY(-1px);
  border-color: #f26522;
  outline: none;
  background: white;
  box-shadow: 0 0 0 4px rgba(242, 101, 34, 0.15),
  inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* States Grid */
.states-grid {
  display: grid;
  margin-top: 20px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.02);
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.state-button {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  padding: 18px 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #555;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.state-button:hover {
  transform: translateY(-2px);
  color: #f26522;
  border-color: #f26522;
  background: rgba(242, 101, 34, 0.05);
  box-shadow: 0 4px 12px rgba(242, 101, 34, 0.15);
}

.state-button.selected {
  transform: scale(1.02);
  color: white;
  border-color: #f26522;
  background: linear-gradient(135deg, #f26522 0%, #d9541d 100%);
  box-shadow: 0 4px 15px rgba(242, 101, 34, 0.3);
}

/* Submit button */
.submit-button {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 50px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.6s ease 0.4s backwards;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: white;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #f26522 0%, #ff7b3d 100%);
  box-shadow: 0 10px 30px rgba(242, 101, 34, 0.3),
  inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #ff7b3d 0%, #f26522 100%);
  box-shadow: 0 15px 40px rgba(242, 101, 34, 0.4),
  inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-button:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
  background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
  box-shadow: none;
}

/* Trivia Screen */
.trivia-screen .screen-content {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px;
}

.trivia-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 120px 90px;
}

.trivia-logo {
  max-width: 300px;
}

.trivia-logo img {
  width: 100%;
  height: auto;
}

.trivia-timer {
  font-size: 64px;
  font-weight: bold;
  justify-content: center;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  padding: 20px 5px;
  text-align: center;
  color: white;
  border-radius: 15px;
  background: #f26522;
}

/* Question Section */
.question-container {
  width: 100%;
  max-width: 900px;
  margin: 320px auto 80px;
}

.question-label {
  font-family: 'Interstate', Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  width: max-content;
  margin: auto auto -10px;
  padding: 10px 30px 20px 30px;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 1 !important;
  color: #f26522;
  border-radius: 10px;
  background: #fff;
}

.question-box {
  width: 100%;
  padding: 50px 60px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.question-text {
  font-family: 'Interstate', Arial, sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: #002051;
}

/* Answers Section */
.answers-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.answer-button {
  font-family: 'Interstate', Arial, sans-serif;
  font-size: 32px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  padding: 35px 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: #002051;
  border: none;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.answer-button:hover:not(:disabled) {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(242, 101, 34, 0.3);
}

.answer-button:disabled {
  cursor: default;
}

.answer-button.correct {
  color: white;
  background: #4caf50;
  box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3),
  0 2px 8px rgba(76, 175, 80, 0.2),
  inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.answer-button.incorrect {
  color: white;
  background: #f44336;
  box-shadow: 0 5px 20px rgba(244, 67, 54, 0.3),
  0 2px 8px rgba(244, 67, 54, 0.2),
  inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.answer-button.unselected {
  opacity: 0.5;
  color: #0f0f0f70;
  background: #ffffff70;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1),
  0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Animations */
.slide-from-left {
  animation: slideFromLeft 0.5s ease forwards;
}

.slide-from-right {
  animation: slideFromRight 0.5s ease forwards;
}

.slide-from-bottom {
  animation: slideFromBottom 0.5s ease forwards;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Preloader styles */
.preloader {
  position: absolute;
  z-index: 9999;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #000;
}

.loader {
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  border: 4px solid #333;
  border-top: 4px solid #fff;
  border-radius: 50%;
}

.preloader p {
  font-family: Arial, sans-serif;
  font-size: 18px;
  margin-top: 20px;
  color: #fff;
}

/* Start screen specific styles */
.start-screen .game-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.start-screen .screen-content {
  padding-top: 320px;
}

/* Keyframe for loader spin (moved from style tag) */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Virtual keyboard adjustments for HNTB */
.virtual-keyboard {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif !important;
  position: fixed !important;
  bottom: 60px !important;
  left: 50% !important;
  width: 85% !important;
  max-width: 900px !important;
  transform: translateX(-50%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background-color: rgba(26, 26, 26, 0.98) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
  0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
  backdrop-filter: blur(20px) !important;
}

.virtual-keyboard .keyboard-key {
  font-family: "Interstate", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  min-width: 56px !important;
  height: 56px !important;
  text-transform: uppercase !important;
  border-radius: 12px !important;
}

.virtual-keyboard .keyboard-key.key-orange {
  background-color: #f26522 !important;
}

.virtual-keyboard .keyboard-key.key-orange:hover {
  background-color: #d9541d !important;
}

/* Email keyboard specific row alignments */
.virtual-keyboard.keyboard-email .keyboard-row:nth-child(2) {
  padding-left: 45px;
}

.virtual-keyboard.keyboard-email .keyboard-row:nth-child(3) {
  padding-left: 90px;
}

/* Alpha keyboard specific row alignments */
.virtual-keyboard.keyboard-alpha .keyboard-row:nth-child(2) {
  padding-left: 30px;
}

.virtual-keyboard.keyboard-alpha .keyboard-row:nth-child(3) {
  padding-left: 60px;
}

/* Emoji keyboard specific - ensure no extra padding on emoji rows */
.virtual-keyboard.keyboard-emoji .keyboard-row:nth-child(2),
.virtual-keyboard.keyboard-emoji .keyboard-row:nth-child(3) {
  padding-left: 0;
}

/* Adjust popup position when keyboard is shown */
.popup-content {
  max-height: calc(100vh - 400px);
  transition: max-height 0.3s ease;
}

/* Prevent input zoom on iOS */
.form-group input {
  font-size: 20px !important;
}

@media (max-width: 768px) {
  .form-group input {
    font-size: 20px !important;
  }
}

/* Confetti styles */
.confetti-container {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform-origin: center center;
  animation: confetti-burst 3s ease-out forwards;
  background: #f0f;
}

@keyframes confetti-burst {
  0% {
    transform: translate(-50%, -50%) translateX(var(--burst-x)) translateY(var(--burst-y)) scale(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) translateX(calc(var(--burst-x) * 0.2)) translateY(calc(var(--burst-y) * 0.2)) scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translateX(calc(var(--burst-x) * 3)) translateY(calc(var(--burst-y) * 3 + 200px)) scale(0.3) rotate(1080deg);
    opacity: 0;
  }
}

.confetti:nth-child(odd) {
  width: 8px;
  height: 16px;
  animation-duration: 2.5s;
}

.confetti:nth-child(3n) {
  width: 12px;
  height: 12px;
  animation-duration: 2.8s;
  border-radius: 50%;
}

.confetti:nth-child(4n) {
  width: 6px;
  height: 18px;
  animation-duration: 3.2s;
}

.confetti:nth-child(5n) {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  animation-duration: 2.3s;
}

/* Different confetti colors */
.confetti.color-1 {
  background: #ff6b6b;
}

.confetti.color-2 {
  background: #4ecdc4;
}

.confetti.color-3 {
  background: #45b7d1;
}

.confetti.color-4 {
  background: #f9ca24;
}

.confetti.color-5 {
  background: #f0932b;
}

.confetti.color-6 {
  background: #eb4d4b;
}

.confetti.color-7 {
  background: #6ab04c;
}

.confetti.color-8 {
  background: #e056fd;
}

.confetti.color-9 {
  background: #ff00ff;
}

.confetti.color-10 {
  background: #00ff00;
}