@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ===========================
   COSMIC SPACE THEME
   =========================== */

:root {
  /* Cosmic Color Palette */
  --space-black: #0a0e27;
  --deep-space: #121629;
  --nebula-purple: #6366f1;
  --cosmic-blue: #3b82f6;
  --stellar-pink: #ec4899;
  --nova-cyan: #06b6d4;
  --star-white: #f8fafc;
  --meteor-gray: #64748b;
  --galaxy-purple: #8b5cf6;

  /* Gradient backgrounds */
  --cosmic-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  --nebula-gradient: linear-gradient(135deg, #4c1d95 0%, #5b21b6 50%, #7c3aed 100%);
  --aurora-gradient: linear-gradient(90deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);

  /* Shadows and glows */
  --glow-purple: 0 0 20px rgba(99, 102, 241, 0.3), 0 0 40px rgba(99, 102, 241, 0.1);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3), 0 0 40px rgba(6, 182, 212, 0.1);
  --glow-pink: 0 0 20px rgba(236, 72, 153, 0.3), 0 0 40px rgba(236, 72, 153, 0.1);

  /* Fonts */
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

/* ===========================
   BASE STYLES
   =========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--space-black);
  color: var(--star-white);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===========================
   STARFIELD BACKGROUND
   =========================== */

.starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at top, #1e293b 0%, #0a0e27 50%, #000000 100%);
}

/* ===========================
   CONTENT WRAPPER
   =========================== */

.content-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* ===========================
   HERO HEADER
   =========================== */

.hero-header {
  text-align: center;
  padding: 1.5rem 2rem 1rem;
  position: relative;
  margin-bottom: 1.5rem;
}

.cosmic-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.cosmic-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--aurora-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  animation: title-shimmer 3s ease-in-out infinite;
}

@keyframes title-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.cosmic-icon {
  display: inline-block;
  font-size: 2rem;
  margin-right: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.cosmic-subtitle {
  font-size: 1rem;
  color: var(--meteor-gray);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* ===========================
   SPACE CARDS
   =========================== */

.space-card {
  position: relative;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.4s ease;
}

.space-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--glow-purple);
}

.card-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.space-card:hover .card-glow {
  opacity: 1;
}

/* ===========================
   CARD HEADER
   =========================== */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  gap: 1rem;
  flex-wrap: wrap;
}

.header-content {
  flex: 1;
  min-width: 250px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--star-white);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-icon {
  font-size: 1.25rem;
  display: inline-block;
}

.card-description {
  font-size: 0.9rem;
  color: var(--meteor-gray);
  font-weight: 400;
}

/* ===========================
   COSMIC BUTTON
   =========================== */

.cosmic-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--nebula-gradient);
  color: var(--star-white);
  border: none;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.cosmic-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.cosmic-button:hover::before {
  left: 100%;
}

.cosmic-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.cosmic-button:active {
  transform: translateY(0);
}

.cosmic-button.success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.button-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* ===========================
   CODE CONTAINER
   =========================== */

.code-container {
  padding: 1.5rem;
}

.code-block {
  background: rgba(10, 14, 39, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1rem;
  padding: 1.25rem;
  overflow-x: auto;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.code-content {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e2e8f0;
  display: block;
  white-space: pre;
  font-weight: 400;
}

/* Code syntax highlighting simulation */
.code-content {
  background: transparent;
}

/* ===========================
   VIDEO CONTAINER
   =========================== */

.video-container {
  padding: 1.5rem;
}

.video-wrapper {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.video-player {
  width: 100%;
  display: block;
  border-radius: 1rem;
}

/* ===========================
   FOOTER
   =========================== */

.cosmic-footer {
  text-align: center;
  padding: 1.5rem 2rem 1rem;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-stars {
  font-size: 1.5rem;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.footer-text {
  font-size: 0.95rem;
  color: var(--meteor-gray);
  font-weight: 500;
}

/* ===========================
   SCROLLBAR STYLING
   =========================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 14, 39, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--nebula-gradient);
  border-radius: 10px;
  border: 2px solid rgba(10, 14, 39, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cosmic-gradient);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 1023px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cosmic-title {
    font-size: 2rem;
  }

  .cosmic-icon {
    font-size: 1.5rem;
  }

  .cosmic-subtitle {
    font-size: 0.9rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }

  .cosmic-button {
    width: 100%;
    justify-content: center;
  }

  .content-wrapper {
    padding: 0.75rem;
  }

  .hero-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .code-content {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .cosmic-title {
    font-size: 1.75rem;
  }

  .code-block {
    padding: 0.75rem;
  }

  .code-container,
  .video-container {
    padding: 0.75rem;
  }

  .code-content {
    font-size: 0.75rem;
    line-height: 1.5;
  }
}

/* ===========================
   ANIMATIONS & EFFECTS
   =========================== */

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--star-white);
}
