/* Import futuristic fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Exo+2:wght@300;400;600&family=Rajdhani:wght@300;400;500;600&display=swap');

body {
  font-family: 'Exo 2', sans-serif;
  margin: 0;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
}

/* Global styles with futuristic accents */
h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Neon accent colors */
:root {
  --neon-green: rgba(69, 204, 45, 0.9);
  --neon-blue: rgba(45, 127, 249, 0.9);
  --neon-purple: rgba(139, 70, 255, 0.9);
  --neon-orange: rgba(255, 120, 70, 0.9);
  --dark-bg: #121212;
  --darker-bg: #090909;
  --card-bg: #1a1a1a;
  --border-glow: 0 0 10px rgba(45, 127, 249, 0.5);
}

/* Add some text effects for headings */
h1 {
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  margin-bottom: 0.5em;
}

h2, h3 {
  position: relative;
  display: inline-block;
}

h2:after, h3:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 2px;
  width: 40%;
  background: linear-gradient(90deg, var(--neon-blue), transparent);
}

/* Share modal with futuristic styling */
#share {
  display: none;
  position: absolute;
  width: 100%;
  z-index: 1001;
  margin-top: 10px;
}

#share > div {
  width: 280px;
  margin: auto;
  background: var(--card-bg);
  box-shadow: 0 0 15px rgba(45, 127, 249, 0.2);
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid rgba(45, 127, 249, 0.3);
}

#share > div > h4 {
  padding: 4px 0;
  margin: 0;
  color: #ffffff;
}

h1, p {
  position: relative;
  z-index: 1004;
}

/* Carousel with glowing borders */
.carousel-container {
  position: relative;
  width: 100%;
  height: 60vh;
  margin: 20px 0;
  margin-bottom: 100px;
  overflow: hidden;
}

.image-container {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  display: none;
  border-radius: 8px;
  overflow: hidden;
  left: 0;
  top: 0;
  background-size: cover;
  background-position: center;
}

.image-container.active {
  opacity: 1;
  transform: translateX(0);
  display: block;
  z-index: 2;
}

/* Glowing borders with neon colors */
#image1, #image2, #image3, #image4 {
  border: solid 2px var(--neon-blue);
  box-shadow: 0 0 15px rgba(45, 127, 249, 0.3);
  position: relative;
}

/* Add numerical indicators instead of colored borders */
#image1::before, #image2::before, #image3::before, #image4::before {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(15, 15, 15, 0.8);
  color: white;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(3px);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

#image1::before { content: "1"; }
#image2::before { content: "2"; }
#image3::before { content: "3"; }
#image4::before { content: "4"; }

.image-container.prev {
  transform: translateX(-100%);
  opacity: 1;
  z-index: 1;
}

.image-container.next {
  transform: translateX(100%);
  opacity: 1;
  z-index: 1;
}

/* Futuristic carousel navigation */
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0;
}

.carousel-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.carousel-dot:hover {
  transform: scale(1.1);
  background: #444;
  box-shadow: 0 0 8px rgba(45, 127, 249, 0.4);
  color: #ccc;
}

.carousel-dot.active {
  background: var(--neon-blue);
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--neon-blue);
  color: white;
}

/* Sleek arrow controls */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 1005;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.7;
  transition: all 0.3s ease;
  pointer-events: auto !important;
  color: #fff;
  -webkit-text-fill-color: #fff;
  backdrop-filter: blur(4px);
}

.carousel-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(45, 127, 249, 0.5);
}

.carousel-arrow.prev {
  left: 15px;
}

.carousel-arrow.next {
  right: 15px;
}

/* Drop zone with futuristic highlight */
.drop-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  pointer-events: none;
  transition: background-color 0.3s ease;
}

.drop-zone.correct {
  pointer-events: none !important;
  background-color: rgba(39, 174, 96, 0.35);
  box-shadow: inset 0 0 20px rgba(39, 174, 96, 0.5);
}

body.dragging .drop-zone:not(.correct) {
  pointer-events: all;
  backdrop-filter: blur(2px);
}

/* Results container with sleek styling */
.results-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-bg);
  z-index: 2000;
  padding: 25px;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  color: #e0e0e0;
  transition: color 0.2s ease;
}

.close-button:hover {
  color: #ffffff;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  flex-grow: 1;
}

.image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image:hover {
  transform: scale(1.02);
  box-shadow: var(--border-glow);
}

.image-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(20, 20, 20, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 500;
  z-index: 1;
  backdrop-filter: blur(4px);
  border-left: 3px solid var(--neon-blue);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
  font-size: 0.9em;
  text-transform: uppercase;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
  .solution-grid {
    grid-template-columns: 1fr !important;
  }

  .results-modal,
  .solution-grid {
    z-index: 2000;
  }
}

/* Categories container with futuristic design */
.categories-container {
  text-transform: capitalize;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 15, 0.9);
  padding: 18px 15px;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 1003;
  backdrop-filter: blur(10px);
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(45, 127, 249, 0.2);
}

/* Futuristic draggable items */
.draggable {
  padding: 10px 16px;
  background-color: var(--card-bg);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.25s ease;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.draggable:hover {
  background-color: #252525;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 5px rgba(45, 127, 249, 0.5);
  border-color: rgba(45, 127, 249, 0.4);
}

.draggable:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.draggable.selected {
  background-color: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 15px rgba(45, 127, 249, 0.5);
}

.draggable.disabled {
  display: none;
}

/* Sleek counter */
.counter {
  position: fixed;
  top: 30px;
  right: 20px;
  background: var(--card-bg);
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 1003;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
}

.highlight {
  box-shadow: 0 0 0 3px var(--neon-blue), 0 0 15px rgba(45, 127, 249, 0.5);
}

.correct {
  background-color: rgba(39, 174, 96, 0.35);
  border: 1px solid rgba(39, 174, 96, 0.6);
}

.incorrect {
  animation: shake 0.5s ease-in-out;
  background-color: rgba(231, 76, 60, 0.35);
  border: 1px solid rgba(231, 76, 60, 0.6);
}

.match-indicator {
  animation: fadeIn 0.3s ease-in-out;
  text-transform: capitalize;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

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

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .carousel-container {
    height: calc(100vh - 280px);
    margin: 10px 0 120px 0;
  }

  .categories-container {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 10px;
    max-height: 120px;
    overflow-y: auto;
    background: rgba(15, 15, 15, 0.95);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .draggable {
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.2;
    max-width: calc(50% - 20px);
    white-space: normal;
    text-align: center;
  }

  body {
    padding: 10px;
  }

  h1 {
    margin: 10px 0;
    font-size: 22px;
  }

  h3 {
    margin: 8px 0;
    font-size: 16px;
  }

  p {
    margin: 8px 0;
    font-size: 13px;
  }

  body .counter {
    top: 10px;
    right: 10px;
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* Game over screen with futuristic design */
#gameOver {
  display: none;
  position: absolute;
  width: 100%;
  z-index: 1001;
  margin-top: 10px;
}

#gameOver > div {
  width: 280px;
  margin: auto;
  background: var(--card-bg);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid rgba(45, 127, 249, 0.3);
}

#gameOver > div > h4 {
  padding: 4px 0;
  margin: 0;
  color: #ffffff;
}

/* Futuristic help button */
.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--card-bg);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s ease;
  margin-left: 8px;
  vertical-align: middle;
  color: #e0e0e0;
}

.help-button:hover {
  transform: scale(1.1);
  background: #252525;
  box-shadow: 0 0 10px rgba(45, 127, 249, 0.4);
  border-color: rgba(45, 127, 249, 0.4);
  color: #ffffff;
}

.close-help {
  font-size: 18px;
  color: #e0e0e0;
}

.close-help:hover {
  color: #ffffff;
}

/* Sleek help modal */
.help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1010;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.help-content {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  color: #e0e0e0;
  border: 1px solid rgba(45, 127, 249, 0.3);
}

.help-content h3 {
  margin-top: 0;
  margin-bottom: 18px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.help-content ul {
  margin: 0;
  padding-left: 20px;
}

.help-content li {
  margin-bottom: 12px;
}

/* Results modal with futuristic aesthetic */
.results-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1010;
  backdrop-filter: blur(5px);
}

.results-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
  color: #e0e0e0;
  border: 1px solid rgba(45, 127, 249, 0.3);
}

.results-grid {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
  background: var(--darker-bg);
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.results-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.image-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 15, 0.8);
  color: white;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 14px;
}

.result-square {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-square.incorrect {
  color: #777;
  opacity: 0.7;
  font-size: 18px;
}

.result-globe {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.3s;
}

.result-globe:hover {
  transform: scale(1.2);
}

/* Futuristic share button */
.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--neon-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}

.share-button:hover {
  background: rgba(65, 147, 255, 1);
  box-shadow: 0 0 15px rgba(45, 127, 249, 0.5);
  transform: translateY(-2px);
}

.share-button:active {
  transform: translateY(1px);
}

.share-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: rotate(45deg);
  transition: transform 0.6s;
  z-index: 1;
}

.share-button:hover::before {
  transform: rotate(45deg) translate(50%, 50%);
}

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

/* Image zoom effect - completely revised approach */
.image-container {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  display: none;
  border-radius: 8px;
  overflow: hidden;
  left: 0;
  top: 0;
  background-size: cover !important;
  background-position: center !important;
}

.image-container.active {
  opacity: 1;
  transform: translateX(0);
  display: block;
  z-index: 2;
  transition: transform 0.4s ease, opacity 0.4s ease, scale 0.3s ease;
}

.image-container.active:hover {
  scale: 1.05;
  cursor: zoom-in;
}

/* Remove the previous zoom class since we're applying directly to containers */
.image-zoom {
  cursor: zoom-in;
}

/* Location hint with futuristic look */
.location-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(10, 10, 10, 0.8);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(5px);
  backdrop-filter: blur(4px);
  border-left: 3px solid var(--neon-blue);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.image-container:hover .location-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Add futuristic scanner effect */
@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

.image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(to right, 
    transparent 0%,
    rgba(45, 127, 249, 0.2) 10%,
    rgba(45, 127, 249, 0.5) 50%,
    rgba(45, 127, 249, 0.2) 90%,
    transparent 100%
  );
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.image-container.active::after {
  opacity: 1;
  animation: scanline 2s linear infinite;
}

/* Add this CSS to fix the button sizing on web */
.share-button {
    /* Base styling that remains the same across all devices */
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s;
}

/* Mobile-first approach - default sizing for small screens */
.share-button {
    padding: 12px 16px;
    font-size: 16px;
    margin: 8px auto;
    width: 100%;
    display: block;
}

/* Adjust button sizing for tablets */
@media (min-width: 768px) {
    .share-button {
        padding: 10px 14px;
        font-size: 15px;
        width: 250px; /* Fixed width on larger screens */
    }
}

/* Adjust button sizing for desktop */
@media (min-width: 1024px) {
    .share-button {
        padding: 8px 12px;
        font-size: 14px;
        width: 200px; /* Even narrower on desktop */
    }
}

/* For the results modal card - make it more size-appropriate on larger screens */
@media (min-width: 768px) {
    .results-card {
        max-width: 450px !important;
        padding: 24px !important;
    }
}

/* Ensure the modal itself remains centered */
.results-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1000 !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

/* Add subtle pulse effect to active elements */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 127, 249, 0.3);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(45, 127, 249, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 127, 249, 0);
  }
}

.draggable.selected {
  animation: pulse 1.5s infinite;
}

/* Compact Results Modal CSS */
.results-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1000 !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

/* Mobile-first approach for the results card */
.results-card {
    position: relative;
    z-index: 1001;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%; /* Mobile width */
    max-width: 350px; /* Cap the width even on small screens */
    margin: 0 auto;
}

/* Typography for results */
.results-title {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
}

/* Button styling */
.share-button {
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    margin: 6px auto;
    width: 200px;
    max-width: 100%;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s;
}

/* Ensure buttons don't get too narrow on very small screens */
@media (max-width: 320px) {
    .share-button {
        width: 100%;
    }
    
    .results-card {
        padding: 15px;
    }
}

/* Results grid styling */
.results-grid {
    display: grid;
    grid-template-columns: auto repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}

/* Compact all elements on the results page */
.image-marker, .result-globe, .result-square {
    font-size: 14px;
}

/* Ensure solution view is also compact */
#solution-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#solution-container > div {
    max-width: 350px;
    width: 90%;
}
