/* Test webhook deployment - 2025-01-08 */
/* Pixel-style font */
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

/* Reset base styles */
html,
body {
  margin: 0;
  padding: 0;
}

/* Overall page background */
body {
  font-family: "Press Start 2P", sans-serif;
  background: #000;
  image-rendering: pixelated;
  color: #fff;
}

/* ANIMATED BANNER (Main Page) */
.full-banner {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 20px auto;
  background: #001c40; /* Deep space blue */
  overflow: hidden;
  max-width: 1440px;
}

/* Make sure the banner never blocks clicks on overlays or UI */
.full-banner,
.banner-stars,
.banner-letters,
.banner-foreground {
  pointer-events: none;
}

.banner-stars, .banner-letters, .banner-foreground {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

/* Hide letters until JS positions and animates them to avoid bunching at 0,0 */
.banner-letters {
  opacity: 0;
}

.banner-star, .banner-letter-wrap, .banner-letter {
  position: absolute;
  will-change: transform;
}

/* Hide individual letters until they're ready to animate */
.banner-letter {
  visibility: hidden;
}

/* Wrapper that carries the animation so image scaling isn't overridden */
.banner-letter-wrap {
  pointer-events: none;
}

/* Animation for drifting elements */
@keyframes bannerDrift {
  from { transform: translateX(-100px); }
  to   { transform: translateX(calc(100vw + 200px)); }
}

.banner-foreground {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.banner-title-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  width: auto;
  height: auto;
}

/* Ensure user info panel sits above banner layers */
#userInfo {
  z-index: 5000;
}

/* Coin button hover effect */
#coinButton:hover {
  transform: scale(1.2);
}

/* Bars container */
#bars-container {
  margin-top: 0;
}

/* BAR SECTIONS */
.bar-section {
  position: relative;
  padding: 10px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 4px 4px 0 #fff;
  background: #000;
  image-rendering: pixelated;
  margin-bottom: 20px;
}

/* Theme-specific bar backgrounds - FIXED for Vercel */
.bar-bg-1 { background-image: url("/Assets/images/ReefBG.png"); background-repeat: repeat-x; }
.bar-bg-2 { background-image: url("/Assets/images/SortopiaBG.png"); background-repeat: repeat-x; }
.bar-bg-3 { background-image: url("/Assets/images/spaceBG.png"); background-repeat: repeat-x; }


.bar-alpha-bay {
  text-align: center;
  font-family: "Press Start 2P", sans-serif;
  font-size: 2rem;
  color: #aefff4;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);/* adds a drop shadow */

}

.bar-sortopia {
  text-align: center;
  font-family: "Press Start 2P", sans-serif;
  font-size: 2rem;
  color: #c2fea7;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);/* adds a drop shadow */
}

.bar-space {
  text-align: center;
  font-family: "Press Start 2P", sans-serif;
  font-size: 2rem;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);/* adds a drop shadow */
 
}

/* SCROLLABLE CARDS */
.scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.card-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px;
  flex: 1;
}
.card-container::-webkit-scrollbar {
  display: none;
}
.card-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Arrow Buttons */
.scroll-arrow {
  background-color: #000;
  border: 2px solid #fff;
  color: #0ff;
  font-size: 1.5rem;
  padding: 10px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
  image-rendering: pixelated;
}
.scroll-arrow:hover {
  background-color: #333;
}
.left-arrow {
  margin-right: 10px;
}
.right-arrow {
  margin-left: 10px;
}

/* SORT CARDS (Main Page) */
.sort-card {
  background-color: #444;
  border-radius: 10px;
  padding: 15px;
  width: 200px;
  min-width: 200px;
  border: 3px solid #fff;
  box-shadow: 4px 4px 0 #fff;
  transition: transform 0.3s, box-shadow 0.3s;
  transform: perspective(1000px) rotateY(0deg);
  background-image: url("/Assets/images/reef_tile.png");
  background-repeat: repeat;
  image-rendering: pixelated;
}
.sort-card:hover {
  transform: perspective(1000px) rotateY(10deg);
  box-shadow: 8px 8px 0 #fff;
}
.sort-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #0ff;
  text-align: center;
  font-family: "Press Start 2P", sans-serif;

}

/* Theme-specific card backgrounds for main page cards */
.card-bg-1 { background-image: url("/Assets/images/ReefCardBG.png"); }
.card-bg-2 { background-image: url("/Assets/images/ForestCardBG.png"); }
.card-bg-3 { background-image: url("/Assets/images/SpaceCardBG.png"); }

.sort-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
  pointer-events: none;
}

.sort-card.locked-future {
  border-style: dashed;
}

.sort-card.locked button {
  opacity: 0.6;
  cursor: not-allowed;
}

.sort-card.locked button:hover {
  background-color: #111;
}

.placement-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 20px;
}

.placement-modal-content {
  background: #000;
  border: 3px solid #00ff00;
  border-radius: 10px;
  padding: 30px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
  text-align: center;
  font-family: "Press Start 2P", sans-serif;
}

.placement-modal-content h2 {
  color: #00ff00;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.placement-modal-body p {
  color: #ffff00;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.placement-modal-body .placement-modal-sub {
  color: #0ff;
  font-size: 0.75rem;
}

.placement-modal-actions {
  margin-top: 20px;
}

.placement-modal-btn {
  background: #000;
  color: #0ff;
  border: 2px solid #fff;
  border-radius: 5px;
  padding: 10px 20px;
  font-family: "Press Start 2P", sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.placement-modal-btn:hover {
  background: #0ff;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
  transform: scale(1.05);
}

/* BUTTONS IN SORT CARDS */
.sort-card button {
  display: block;
  width: 100%;
  margin: 5px 0;
  padding: 8px;
  font-size: 0.8rem;
  border: 2px solid #fff;
  border-radius: 5px;
  cursor: pointer;
  background-color: #000;
  color: #0ff;
  transition: background-color 0.3s;
  font-family: "Courier New", Courier, monospace;
}
.sort-card button:hover {
  background-color: #222;
}

/* Progress indicators for completed sorts */
.sort-card button.completed {
  position: relative;
  border: 3px solid #00ff00 !important;
  box-shadow: 0 0 10px #00ff00 !important;
}

.sort-card button.completed::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #00ff00;
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  z-index: 10;
}

.sort-card button.completed:hover {
  box-shadow: 0 0 15px #00ff00 !important;
}

/* Partially completed blind sort (yellow glow) */
.sort-card button.partially-completed {
  position: relative;
  border: 3px solid #ffff00 !important;
  box-shadow: 0 0 10px #ffff00 !important;
}

.sort-card button.partially-completed::after {
  content: "◐";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ffff00;
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  z-index: 10;
}

.sort-card button.partially-completed:hover {
  box-shadow: 0 0 15px #ffff00 !important;
}

/* Speed time display */
.sort-card button.speed-time {
  position: relative;
  border: 3px solid #ff6600 !important;
  box-shadow: 0 0 10px #ff6600 !important;
  font-size: 0.7rem;
  font-family: "Courier New", Courier, monospace;
}

.sort-card button.speed-time::after {
  content: "⏱";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff6600;
  color: #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  z-index: 10;
}

.sort-card button.speed-time:hover {
  box-shadow: 0 0 15px #ff6600 !important;
}

/* Card styling for fully completed sorts */
.sort-card.all-completed {
  position: relative;
  border: 3px solid #00ffff !important;
  box-shadow: 0 0 20px #00ffff !important;
}

.sort-card.all-completed::before {
  content: "COMPLETED";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 255, 255, 0.9);
  color: #000;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 10px;
  z-index: 10;
  font-family: "Press Start 2P", sans-serif;
}

#sort-title {
  font-size: 2rem;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); /* Optional shadow for more pop */
}

/* DRAGGABLE WORD TILES (Sort Page) */
.word {
  display: inline-block;
  background: radial-gradient(circle, #333 0%, #000 100%);
  border: 2px solid #fff;
  padding: 0.5em 0.8em;
  margin: 0.2em;
  font-size: 0.8rem;
  text-align: center;
  cursor: move;
  user-select: none;
  border-radius: 5px;
  position: relative;
  min-width: 45px;
  min-height: 15px;
}

.word span {
  position: relative;
  z-index: 2;
}

/* Highlight overlay for word tiles */
.word.highlighted::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 0, 0.6);
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
  transition: background 0.3s;
}

/* ------------------------------
   NEW: Bottom Controls Layout
------------------------------ */
#bottomControls {
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

#leftControls {
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Voice selector - positioned at far left */
#voiceSelector {
  margin-right: 20px;
}

#voiceDropdown {
  background-color: #000;
  color: #0ff;
  border: 2px solid #fff;
  border-radius: 4px;
  padding: 8px 12px;
  font-family: "Press Start 2P", sans-serif;
  font-size: 0.7rem;
  cursor: pointer;
  min-width: 120px;
}

#voiceDropdown:hover {
  border-color: #0ff;
  box-shadow: 0 0 0 2px #0ff inset;
}

#voiceDropdown:focus {
  outline: none;
  border-color: #0ff;
  box-shadow: 0 0 0 3px #0ff inset;
}

#robotHead {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto; /* Centers the image horizontally in its container */
}

#exampleSentenceBox {
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  border-radius: 5px;
  min-width: 350px;
  font-size: 1rem;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rightControls {
  padding-right: 40px;
}

#actionButtons {
  display: flex;
  gap: 30px;
}

/* Action Buttons (Check, Resort, Home) */
#actionButtons button {
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 60px;
  height: 60px;
  border: none;
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* Resort and Home buttons */
#resortBtn {
  background-image: url("/Assets/images/refresh_button.png");
  cursor: pointer;
}
#resortBtn:hover {
  transform: scale(1.05);
}

#homeBtn {
  background-image: url("/Assets/images/home_button.png");
  cursor: pointer;
}
#homeBtn:hover {
  transform: scale(1.05);
}

/* -----------------------------
   SORT PAGE (sort.html) STYLES
----------------------------- */
body.sort-page {
  margin: 2em;
  background-color: #000;
  background-image: none;
  image-rendering: pixelated;
  color: #fff;
}

#categories-container {
  display: flex;
  justify-content: space-around;
  gap: 1em;
  margin-bottom: 1em;
}

.category-column {
  border: 3px solid #fff;
  width: 200px;
  min-height: 300px;
  padding: 1em;
  position: relative;
  background-color: rgba(255, 255, 255, 0.5);
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.category-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5em;
}

.category-header h3 {
  margin: 0;
  font-size: 1.4rem;
  text-align: center;
  color: #000;
  font-weight: bold;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5);
}

.category-content {
  min-height: 180px;
  border: 2px dashed #aaa;
  padding: 0.5em;
  background-color: #333;
  position: relative;
}

.score-display {
  font-size: 0.7rem;
  white-space: nowrap;
  position: absolute;
  bottom: 5px; /* adjust the value as needed */
  left: 50%;
  transform: translateX(-50%);
  color: #fff; /* or your preferred color */
}

#word-bank {
  border: 3px dashed #fff;
  min-height: 100px;
  padding: 0;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  background-color: #333;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#wordBankCheckBtn {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border: 3px solid #fff;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.9);
  color: #0ff;
  font-family: "Press Start 2P", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  z-index: 5;
}

#wordBankCheckBtn:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.6);
  background-color: rgba(0, 0, 0, 1);
}

#wordBankCheckBtn:disabled {
  cursor: default;
  opacity: 0.7;
  box-shadow: none;
}

/* NEW: Level-Specific Main Backgrounds for Sort Page */
body.sort-page.level-1 {
  background-image: url("/Assets/images/reef_page_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
}
body.sort-page.level-2 {
  background-image: url("/Assets/images/forest_page_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
}
body.sort-page.level-3 {
  background-image: url("/Assets/images/space_bg_500x500.png");
  background-size: cover;
  background-repeat: no-repeat;
}

/* NEW: Level-Specific Tile Backgrounds for Word Tiles */
body.sort-page.level-1 .word {
  background: radial-gradient(circle, #333 0%, #000 100%);
}
body.sort-page.level-2 .word {
  background: radial-gradient(circle, #333 0%, #000 100%);
}
body.sort-page.level-3 .word {
  background: radial-gradient(circle, #333 0%, #000 100%);
}
.word {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* NEW: Replace "Read These Words" Button with Speaking Robot Head Image */
.read-words-btn {
  background-image: url("/Assets/images/robot_spkr_head.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 95px;
  height: 95px;
  border: none;
  background-color: transparent; /* ensure transparency is preserved */
  display: block; /* force block for centering */
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px; /* add space above the button */
  margin-bottom: 0; /* remove any extra space below */
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* Disabled state: grey and default cursor */
.read-words-btn:disabled {
  filter: grayscale(100%);
  cursor: default;
}

/* Active (enabled) state: full color with pointer cursor and scale-on-hover */
.read-words-btn:not(:disabled) {
  filter: grayscale(0%);
  cursor: pointer;
}
.read-words-btn:not(:disabled):hover {
  transform: scale(1.05);
}

#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
}

/* New styling for confetti pieces */
.confetti {
  position: absolute;
  top: -20px;  /* start a bit above the viewport */
  opacity: 1;
  border-radius: 2px;
  /* Use a longer duration so the fall is prolonged */
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    /* Move down the full viewport height while rotating */
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-modal {
  background: #001018;
  border: 3px solid #00ffff;
  border-radius: 10px;
  padding: 20px 24px;
  width: 320px;
  font-family: "Press Start 2P", sans-serif;
  color: #fff;
  box-shadow: 0 0 20px rgba(0,255,255,0.6);
}
.login-modal h2 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #00ffff;
}
.login-modal label {
  display: block;
  font-size: 10px;
  margin-top: 10px;
}
.login-modal input {
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: #021b28;
  border: 2px solid #00bcd4;
  border-radius: 6px;
  color: #fff;
}
.login-modal button[type="submit"] {
  margin-top: 14px;
  width: 100%;
  padding: 10px 12px;
  background: #00ffff;
  color: #001018;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.login-modal #guestBtn {
  margin-top: 10px;
  width: 100%;
  padding: 10px 12px;
  background: #ffaa00;
  color: #001018;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.login-modal button[type="submit"]:hover {
  filter: brightness(0.9);
}
.login-error {
  margin-top: 10px;
  color: #ff6b6b;
  font-size: 10px;
}
.login-modal #teacherSignInLink {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.65rem;
  color: #888;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.login-modal #teacherSignInLink:hover {
  color: #00bcd4;
  text-decoration: underline;
}
/* Test: Auto-deploy with correct git author - 2025-01-08 */
