:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #4f46e5;
  --light: #f3f4f6;
  --dark: #1f2937;
  --gray: #6b7280;
  --gradient-start: #2563eb;
  --gradient-end: #8b5cf6;
}

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

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: #fff;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
}

section {
  padding: 5rem 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.8), rgba(224, 231, 255, 0.8));
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

#three-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232563eb' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: -2;
}

.hero-content {
  max-width: 600px;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.tagline {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  min-height: 2.4rem;
  position: relative;
}

.tagline::after {
  content: '|';
  position: absolute;
  right: -5px;
  top: 0;
  animation: blink 1s infinite;
}

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

.hero-text {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--gray);
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn:hover::before {
  left: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 4px;
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

.about {
  background-color: var(--light);
  transition: background-color 0.3s ease;
}

.about-container {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.about-img {
  flex: 1;
  min-width: 300px;
  position: relative;
}

.about-img::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  width: 100px;
  height: 100px;
  border-top: 4px solid var(--primary);
  border-left: 4px solid var(--primary);
  z-index: -1;
}

.about-img::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 100px;
  height: 100px;
  border-bottom: 4px solid var(--primary);
  border-right: 4px solid var(--primary);
  z-index: -1;
}

.about-img img {
  width: 100%;
  max-width: 350px;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  display: block;
  transition: transform 0.5s ease;
}

.about-img:hover img {
  transform: scale(1.03);
}

.about-text {
  flex: 2;
  min-width: 300px;
}

.about-text h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--gray);
  transition: color 0.3s ease;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skill-tag {
  background-color: white;
  color: var(--dark);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.projects {
  background-color: white;
  transition: background-color 0.3s ease;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-img {
  height: 200px;
  background-color: #e5e7eb;
  background-size: cover;
  background-position: center;
  transition: height 0.3s ease;
}

.project-content {
  padding: 1.5rem;
  transition: transform 0.3s ease;
}

.project-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.project-desc {
  color: var(--gray);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background-color: var(--light);
  color: var(--gray);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background-color: var(--primary);
  color: white;
}

.project-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
}

.project-link:hover {
  text-decoration: underline;
}

.skills {
  background-color: var(--light);
  transition: background-color 0.3s ease;
}

.skills-container {
  max-width: 800px;
  margin: 0 auto;
}

.skills-category {
  margin-bottom: 3rem;
}

.skills-category h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.skill-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  color: var(--primary);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.skill-item:hover .skill-icon {
  transform: translateY(-5px) rotateY(180deg);
  color: white;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

/* New skill level bar styles */
.skill-level-bar {
  width: 100%;
  height: 5px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.skill-level-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  width: 0;
  transition: width 1s ease-out;
}

.education {
  background-color: white;
  transition: background-color 0.3s ease;
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  width: 2px;
  background-color: #e5e7eb;
  top: 0;
  bottom: 0;
  left: 0;
  margin-left: 10px;
  transition: background-color 0.3s ease;
}

.timeline-item {
  margin-bottom: 2.5rem;
  padding-left: 40px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  left: 1px;
  top: 5px;
  z-index: 1;
  transition: transform 0.3s ease;
}

.timeline-item:hover::before {
  transform: scale(1.2);
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 0.25rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.timeline-title {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.timeline-subtitle {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--dark);
  transition: color 0.3s ease;
}

.timeline-text {
  color: var(--gray);
  transition: color 0.3s ease;
}

.contact {
  background-color: var(--light);
  transition: background-color 0.3s ease;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-form {
  flex: 1;
  min-width: 300px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
  transition: color 0.3s ease;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-family: 'Inter', sans-serif;
  background-color: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.success-message {
  color: #10b981;
  font-size: 0.875rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: rgba(16, 185, 129, 0.1);
  border-radius: 0.5rem;
}

.contact-info {
  flex: 1;
  min-width: 300px;
  padding: 2rem;
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.contact-list {
  list-style: none;
  margin-bottom: 2rem;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.contact-icon {
  font-size: 1.2rem;
  color: var(--primary);
  margin-right: 1rem;
  transition: color 0.3s ease;
}

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

.contact-text a:hover {
  color: var(--primary);
}

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

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--light);
  color: var(--primary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  transform: translateY(-3px);
}

footer {
  background-color: var(--dark);
  padding: 2rem 0;
  color: white;
  text-align: center;
  transition: background-color 0.3s ease;
}

.footer-text {
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: white;
  z-index: 2000;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  padding: 2rem;
}

.mobile-menu.active {
  right: 0;
}

.close-menu {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark);
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.mobile-menu ul {
  list-style: none;
  margin-top: 3rem;
}

.mobile-menu li {
  margin-bottom: 1.5rem;
}

.mobile-menu a {
  color: var(--dark);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.mobile-menu a:hover {
  color: var(--primary);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--dark);
  cursor: pointer;
  margin-left: 1rem;
  transition: color 0.3s ease;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #f3f4f6;
}

body.dark-mode header {
  background-color: rgba(31, 41, 55, 0.9);
}

body.dark-mode .logo {
  color: #60a5fa;
}

body.dark-mode .nav-links a {
  color: #f3f4f6;
}

body.dark-mode .mobile-menu-btn {
  color: #f3f4f6;
}

body.dark-mode .dark-mode-toggle {
  color: #f3f4f6;
}

body.dark-mode .about {
  background-color: #1f2937;
}

body.dark-mode .skills {
  background-color: #1f2937;
}

body.dark-mode .contact {
  background-color: #1f2937;
}

body.dark-mode .timeline::before {
  background-color: #374151;
}

body.dark-mode .project-card {
  background-color: #1f2937;
}

body.dark-mode .project-title {
  color: #f3f4f6;
}

body.dark-mode .project-desc {
  color: #9ca3af;
}

body.dark-mode .contact-info {
  background-color: #1f2937;
}

body.dark-mode .form-control {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

body.dark-mode .form-label {
  color: #f3f4f6;
}

body.dark-mode .contact-text a {
  color: #f3f4f6;
}

body.dark-mode .social-link {
  background-color: #374151;
}

body.dark-mode .about-text h3,
body.dark-mode .skills-category h3,
body.dark-mode .timeline-title,
body.dark-mode .contact-title {
  color: #60a5fa;
}

body.dark-mode .about-text p,
body.dark-mode .timeline-text,
body.dark-mode .timeline-date {
  color: #9ca3af;
}

body.dark-mode .skill-icon {
  background-color: #374151;
}

body.dark-mode .skill-tag {
  background-color: #374151;
  color: #f3f4f6;
}

body.dark-mode .tech-tag {
  background-color: #374151;
  color: #9ca3af;
}

body.dark-mode .mobile-menu {
  background-color: #1f2937;
}

body.dark-mode .close-menu,
body.dark-mode .mobile-menu a {
  color: #f3f4f6;
}

body.dark-mode footer {
  background-color: #111827;
}

/* Scroll to top button */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

.scroll-top-btn.show {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  transform: translateY(-5px);
}

/* Responsive styles */
@media (max-width: 768px) {
  .nav-links {
      display: none;
  }

  .mobile-menu-btn {
      display: block;
  }

  .about-container {
      flex-direction: column;
      gap: 2rem;
  }

  .about-img {
      order: -1;
  }

  .contact-container {
      flex-direction: column;
  }

  .timeline-item {
      padding-left: 30px;
  }

  .hero-content {
      text-align: center;
      margin: 0 auto;
  }

  .btn-group {
      justify-content: center;
  }

  h1 {
      font-size: 2.5rem;
  }

  .section-title {
      font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  h1 {
      font-size: 2rem;
  }

  .tagline {
      font-size: 1.2rem;
  }

  .timeline-item::before {
      width: 15px;
      height: 15px;
      left: 3.5px;
  }

  .social-links {
      justify-content: center;
  }
}