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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f5f5f5;
  background: #0d0d0d;
  overflow: hidden;
}

/* Background Animation */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(45deg, #000, #0d0d0d, #1a1a1a, #262626);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.animated-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.1), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.05), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkle 20s linear infinite;
  opacity: 0.4;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes sparkle {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

/* Loading Screen */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0d0d;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-text {
  font-size: 2rem;
  color: #fff;
  border-right: 3px solid #fff;
  white-space: nowrap;
  overflow: hidden;
  animation: blink 1s infinite;
}

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

/* Back Arrow */
.back-arrow {
  position: fixed;
  top: 2rem;
  left: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-arrow.visible {
  opacity: 1;
  visibility: visible;
}

.back-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px) scale(1.1);
}

/* Pages */
.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.5s ease;
  pointer-events: none;
}

.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.page-content {
  text-align: center;
  max-width: 1200px;
  padding: 2rem;
  width: 100%;
}

.page-content h1 {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, #fff, #e0e0e0, #fff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Menu */
.menu-content {
  text-align: center;
}

.main-title {
  font-size: 4rem;
  background: linear-gradient(45deg, #fff, #e0e0e0, #fff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
  0% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
  100% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.5); }
}

.subtitle {
  font-size: 1.5rem;
  color: #d0d0d0;
  margin-bottom: 4rem;
}

.menu-buttons {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem 3rem;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 150px;
}

.menu-btn i {
  font-size: 3rem;
  transition: all 0.3s ease;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.menu-btn:hover i {
  transform: scale(1.2);
}

/* About Page */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.me {
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  border: 4px solid #fff;
  transition: all 0.3s ease;
  animation: float 6s ease-in-out infinite;
}

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

.me:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2);
}

.about-text {
  max-width: 600px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #d0d0d0;
}

.typing-effect {
  border-right: 2px solid #fff;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { border-color: #fff; }
  51%, 100% { border-color: transparent; }
}

#current-time {
  font-size: 1.2rem;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

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

.social-links a {
  color: #fff;
  font-size: 2.5rem;
  transition: all 0.3s ease;
  padding: 1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.social-links a:hover {
  color: #000;
  transform: translateY(-5px) scale(1.2);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
}

/* Projects Page */
#project_links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  list-style: none;
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
}

#project_links li {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s ease;
}

#project_links li:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

#project_links a {
  text-decoration: none;
  color: inherit;
  display: block;
  text-align: center;
}

#project_links img {
  width: 6rem;
  height: 6rem;
  border-radius: 15px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  filter: brightness(0.8);
}

#project_links li:hover img {
  filter: brightness(1.2);
  transform: scale(1.1);
}

#project_links h2 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

#project_links p {
  color: #d0d0d0;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Skills Page */
.skills-icons {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.skill-item i {
  font-size: 4rem;
  color: #fff;
  transition: all 0.3s ease;
}

.skill-item span {
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
}

.skill-item:hover {
  transform: translateY(-15px) scale(1.1);
  box-shadow: 0 15px 35px rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
}

.skill-item:hover i {
  color: #000;
  transform: scale(1.2);
}

/* Scrollbar */
#project_links::-webkit-scrollbar {
  width: 8px;
}

#project_links::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#project_links::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

#project_links::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Mobile */
@media (max-width: 768px) {
  .main-title {
    font-size: 3rem;
  }

  .page-content h1 {
    font-size: 2.5rem;
  }

  .menu-buttons {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .menu-btn {
    width: 80%;
    max-width: 300px;
  }

  .skills-icons {
    gap: 2rem;
  }

  .skill-item i {
    font-size: 3rem;
  }

  #project_links {
    grid-template-columns: 1fr;
    max-height: 60vh;
  }

  .about-content {
    padding: 1rem;
  }

  .me {
    width: 12rem;
    height: 12rem;
  }
}