/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  color: #F0F0FF;
  overflow-x: hidden;
  background: #0A0A1A;
}

/* Starfield Background */
.starfield-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
  z-index: -2;
}

.twinkling {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent url('assets/twinkling.png') repeat top center;
  animation: twinkle 200s linear infinite;
  z-index: -1;
  opacity: 0.5;
}

@keyframes twinkle {
  from { background-position: 0 0; }
  to { background-position: -10000px 5000px; }
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  position: relative;
}

.hero-content {
  max-width: 800px;
  z-index: 1;
}

.glow-text {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700, 0 0 30px #FFD700;
  animation: pulse 2s infinite alternate;
}

.tagline {
  font-size: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0.9;
}

@keyframes pulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Upload Box */
.upload-container {
  margin-top: 2rem;
  position: relative;
}

.upload-box {
  position: relative;
  width: 500px;
  max-width: 90vw;
  height: 300px;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.drop-zone {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  border: 2px dashed rgba(255, 215, 0, 0.5);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: rgba(10, 10, 26, 0.7);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.drop-zone.active {
  border-color: #FFD700;
  background-color: rgba(10, 10, 26, 0.9);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.browse-btn {
  background: linear-gradient(135deg, #4A2E7F 0%, #1E1E3F 100%);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(74, 46, 127, 0.7);
}

#skyUpload {
  display: none;
}

.glow-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  animation: glow-pulse 3s infinite alternate;
  z-index: 1;
}

@keyframes glow-pulse {
  from { opacity: 0.3; }
  to { opacity: 0.7; }
}

/* Main Content */
main {
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
}

.results-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .results-container {
    flex-direction: row;
  }
}

.canvas-wrapper {
  flex: 2;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
}

#starCanvas {
  width: 100%;
  height: auto;
  background-color: #0A0A1A;
  display: block;
}

.constellation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Info Panel */
.info-panel {
  flex: 1;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
  max-height: 600px;
  overflow-y: auto;
}

.info-panel h3 {
  margin-bottom: 20px;
  color: #FFD700;
  font-size: 1.5rem;
}

.constellation-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.constellation-card {
  background: rgba(30, 30, 63, 0.6);
  border-radius: 10px;
  padding: 15px;
  border-left: 3px solid #00E5FF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.constellation-card h4 {
  font-size: 1.2rem;
  margin: 0;
}

.confidence-badge {
  background: rgba(0, 229, 255, 0.2);
  color: #00E5FF;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* Retry Button */
.retry-btn {
  display: block;
  margin: 40px auto 0;
  background: linear-gradient(135deg, #4A2E7F 0%, #1E1E3F 100%);
  border: 1px solid #00E5FF;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.retry-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(0, 229, 255, 0) 45%,
    rgba(0, 229, 255, 0.3) 50%,
    rgba(0, 229, 255, 0) 55%
  );
  transform: rotate(30deg);
  transition: all 0.5s ease;
}

.retry-btn:hover::after {
  left: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .glow-text {
    font-size: 2.5rem;
  }
  
  .tagline {
    font-size: 1.2rem;
  }
  
  .info-panel {
    max-height: 300px;
  }
}