/* CSS Variables for theming */

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #475569;
  --gradient-1: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  --gradient-2: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--accent-color)
  );
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 35px 60px -12px rgba(0, 0, 0, 0.4);
}

[data-theme='light'] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 35px 60px -12px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 1000;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
  transition: all 0.3s ease;
}

/* Navigation */
.nav {
  position: fixed;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-dot.active {
  background: var(--primary-color);
  transform: scale(1.5);
}

.nav-dot:hover {
  background: var(--primary-color);
  transform: scale(1.3);
}

/* Particle container */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Sections */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  position: relative;
  z-index: 2;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  background: var(--gradient-1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeInUp 1s ease 0.5s forwards;
}

.hero .subtitle {
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--text-secondary);
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeInUp 1s ease 1s forwards;
}

.typewriter {
  display: inline-block;
  border-right: 3px solid var(--primary-color);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    border-color: var(--primary-color);
  }
  51%,
  100% {
    border-color: transparent;
  }
}

.hero-cta {
  display: inline-flex;
  gap: 20px;
  margin-top: 40px;
  opacity: 0;
  animation: fadeInUp 1s ease 1.5s forwards;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:hover {
  background: var(--gradient-2);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* About Section */
.about {
  background: var(--bg-secondary);
}

.section-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  background: var(--gradient-1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.section-title.animate {
  opacity: 1;
  transform: translateY(0);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.8;
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.about-text.animate {
  opacity: 1;
  transform: translateX(0);
}

.about-image {
  position: relative;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.about-image.animate {
  opacity: 1;
  transform: translateX(0);
}

.about-image::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: -20px;
  bottom: -20px;
  background: var(--gradient-1);
  border-radius: 20px;
  z-index: -1;
  opacity: 0.3;
}

.about-placeholder {
  width: 100%;
  height: 400px;
  background: var(--bg-card);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  border: 2px dashed var(--border-color);
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.skill-item {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.skill-item.animate {
  opacity: 1;
  transform: translateY(0);
}

.skill-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-bar {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 4px;
  width: 0;
  transition: width 2s ease;
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Projects Section */
.projects {
  background: var(--bg-secondary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.project-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: all 0.5s ease;
  opacity: 0;
  transform: translateY(50px) rotateX(10deg);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project-card.animate {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

.project-card:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
  box-shadow: var(--shadow-hover);
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: var(--gradient-1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-link {
  padding: 10px 20px;
  background: var(--gradient-1);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-link:hover {
  background: var(--gradient-2);
  transform: translateY(-2px);
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-info {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.contact-info.animate {
  opacity: 1;
  transform: translateX(0);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
  transition: all 0.3s ease;
}

.contact-item:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow);
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.contact-form {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.contact-form.animate {
  opacity: 1;
  transform: translateX(0);
}

.form-group {
  margin-bottom: 25px;
  position: relative;
}

.form-input {
  width: 100%;
  padding: 15px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 15px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.form-label {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -10px;
  left: 15px;
  font-size: 0.8rem;
  color: var(--primary-color);
  background: var(--bg-primary);
  padding: 0 10px;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

textarea + .form-label {
  top: 25px;
}

textarea:focus + .form-label,
textarea:not(:placeholder-shown) + .form-label {
  top: -10px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .theme-toggle {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .section {
    padding: 60px 15px;
  }

  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    order: -1;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .project-card,
  .contact-item {
    padding: 20px;
  }
}
