/* Space Engineering Theme CSS */
/* Custom animated, cursor-reactive space theme */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --dark: #0f172a;
  --dark-lighter: #1e293b;
  --gray: #64748b;
  --gray-light: #cbd5e1;
  --light: #f1f5f9;
  --white: #ffffff;
  --success: #10b981;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  
  /* Space theme colors */
  --space-blue: #0a1929;
  --space-purple: #1a0a3e;
  --star-white: #ffffff;
  --nebula-pink: #ff006e;
  --nebula-cyan: #00f5ff;
  --mars-red: #cd5c5c;
  --orbital-glow: rgba(99, 102, 241, 0.3);
}

/* Animated starfield background */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--orbital-glow); }
  50% { box-shadow: 0 0 40px var(--orbital-glow), 0 0 60px var(--orbital-glow); }
}

@keyframes orbit {
  0% { transform: rotate(0deg) translateX(100px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Starfield canvas */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(180deg, var(--space-blue) 0%, var(--space-purple) 100%);
}

/* Cursor glow effect */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orbital-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--space-blue);
  min-height: 100vh;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: transparent;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  animation: slide-in 0.8s ease-out;
}

/* Modern Navigation with space theme */
header {
  background: rgba(10, 25, 41, 0.85);
  padding: 1.5rem 3rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(15px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

header:hover {
  background: rgba(10, 25, 41, 0.95);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.4);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  animation: pulse-glow 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-2);
  opacity: 0.1;
  transition: left 0.3s ease;
  z-index: -1;
}

nav a:hover::before {
  left: 0;
}

nav a:hover {
  color: var(--white);
  transform: translateY(-2px);
}

nav a.active {
  background: var(--primary);
  color: white;
}

/* Main Content */
main {
  padding: 0;
  background: transparent;
}

/* Hero Section with space theme */
.hero {
  background: transparent;
  color: white;
  padding: 5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}

/* Animated particles in hero */
.hero::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, white, transparent),
    radial-gradient(1px 1px at 33% 70%, white, transparent),
    radial-gradient(1px 1px at 79% 80%, white, transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  opacity: 0.3;
  animation: twinkle 4s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  animation: slide-in 1s ease-out 0.2s both;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8), 0 4px 40px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  line-height: 1.8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8), 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-3px);
}

/* Content Section */
.content-section {
  padding: 4rem 3rem;
  position: relative;
  background: rgba(10, 25, 41, 0.75);
  backdrop-filter: blur(10px);
  margin: 2rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: slide-in 0.8s ease-out;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-2);
  border-radius: 2px;
}

.section-header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Project Cards Grid with parallax effect */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  animation: slide-in 0.6s ease-out;
  animation-fill-mode: both;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(99, 102, 241, 0.5);
  border-color: var(--primary);
  background: rgba(30, 41, 59, 0.7);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover::after {
  opacity: 1;
}

.project-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  transition: all 0.4s ease;
  animation: float 3s ease-in-out infinite;
}

.project-card:hover .project-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.project-card:hover h3 {
  color: var(--primary);
}

.project-card p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.4);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tech-badge:hover {
  background: rgba(99, 102, 241, 0.5);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.project-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.project-link:hover::after {
  width: 100%;
}

.project-link:hover {
  color: var(--primary-dark);
  gap: 0.7rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.skill-category {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  animation: slide-in 0.6s ease-out;
  animation-fill-mode: both;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.skill-category:nth-child(1) { animation-delay: 0.1s; }
.skill-category:nth-child(2) { animation-delay: 0.2s; }
.skill-category:nth-child(3) { animation-delay: 0.3s; }
.skill-category:nth-child(4) { animation-delay: 0.4s; }

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  background: rgba(30, 41, 59, 0.7);
}

.skill-category:hover::before {
  opacity: 1;
}

.skill-category h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.skill-category h3 i {
  color: var(--primary);
}

.skill-list {
  list-style: none;
}

.skill-list li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.skill-list li:hover {
  color: var(--white);
  transform: translateX(5px);
}

.skill-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: bold;
}

/* Footer */
footer {
  background: var(--dark);
  color: var(--gray-light);
  padding: 3rem 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-2);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-link {
  width: 45px;
  height: 45px;
  background: var(--dark-lighter);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--gradient-2);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.social-link:hover::before {
  width: 100%;
  height: 100%;
}

.social-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.social-link i {
  position: relative;
  z-index: 1;
}

.footer-text {
  color: var(--gray);
  font-size: 0.9rem;
}

.footer-text a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-text a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Page-specific styles */
main h1 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
}

main h2 {
  color: var(--white);
  font-size: 2rem;
  margin: 2.5rem 0 1.5rem;
  font-weight: 700;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.5rem;
  display: inline-block;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
}

main h3 {
  color: var(--white);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

main p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

main ul, main ol {
  margin: 1rem 0 1rem 2rem;
}

main li {
  margin-bottom: 0.7rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

main a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

main a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

main a:hover::after {
  width: 100%;
}

main a:hover {
  color: var(--primary-dark);
}

blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.3;
}

blockquote strong {
  color: var(--white);
}

hr {
  border: none;
  border-top: 2px solid var(--gray-light);
  margin: 2rem 0;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    box-shadow: none;
  }
  
  header {
    padding: 1rem 1.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  
  .hero {
    padding: 3rem 1.5rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .content-section {
    padding: 2rem 1.5rem;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  footer {
    padding: 2rem 1.5rem;
  }
  
  .cursor-glow {
    display: none;
  }
}

/* Project-specific theme adaptations */
.project-theme-mars .project-icon {
  background: linear-gradient(135deg, #cd5c5c 0%, #8b3a3a 100%);
}

.project-theme-mars::before {
  background: linear-gradient(135deg, #cd5c5c 0%, #8b3a3a 100%) !important;
}

.project-theme-space .project-icon {
  background: linear-gradient(135deg, #4c1d95 0%, #6366f1 100%);
}

.project-theme-drone .project-icon {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

.project-theme-ai .project-icon {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  #starfield-canvas,
  .cursor-glow {
    display: none;
  }
}
