/* ===== Base Styles ===== */
body {
  margin: 0;
  font-family: "Fira Code", monospace;
  background-color: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
}

html {
  scroll-behavior: smooth;
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(88,166,255,0.9), rgba(120,115,245,0.8));
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  color: #fff;
  font-weight: bold;
  text-shadow: 0px 0px 10px rgba(88,166,255,0.7);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s, text-shadow 0.3s;
  font-weight: 500;
}

.nav-links a:hover {
  color: #7ee787;
  text-shadow: 0px 0px 10px rgba(126,231,135,0.8);
}

.nav-links a.active {
  color: #ff6ec4;
  font-weight: bold;
  border-bottom: 2px solid #ff6ec4;
}

#darkModeToggle {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #fff;
  transition: transform 0.3s;
}

#darkModeToggle:hover {
  transform: rotate(20deg) scale(1.2);
}

/* ===== Intro Section ===== */
.intro {
  padding: 3rem 2rem;
  text-align: center;
  font-size: 1.2rem;
}

.code-effect {
  color: #7ee787;
  font-weight: bold;
  transition: text-shadow 0.3s, color 0.3s;
}

.code-effect:hover {
  text-shadow: 0px 0px 8px #7ee787;
  color: #58a6ff;
}

/* ===== Projects Section ===== */
.projects {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 2rem;
}

.project-card {
  background: rgba(22,27,34,0.8);
  border: 1px solid rgba(88,166,255,0.4);
  border-radius: 15px;
  padding: 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s;
  backdrop-filter: blur(8px);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: #58a6ff;
  box-shadow: 0 8px 25px rgba(88,166,255,0.4);
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #58a6ff;
  font-weight: bold;
}

.project-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.project-links a {
  padding: 0.5rem 1rem;
  border: 1px solid #58a6ff;
  border-radius: 8px;
  text-decoration: none;
  color: #58a6ff;
  font-weight: 500;
  transition: background 0.3s, transform 0.3s;
}

.project-links a:hover {
  background: linear-gradient(135deg, #58a6ff, #7ee787);
  color: #0d1117;
  transform: scale(1.05);
}

/* ===== Contact Section ===== */
.contact {
  padding: 2rem;
  text-align: center;
}

.contact h2 {
  margin-bottom: 1rem;
  color: #ff6ec4;
  text-shadow: 0px 0px 10px rgba(255,110,196,0.6);
}

.contact a {
  color: #58a6ff;
  text-decoration: none;
  transition: color 0.3s;
}

.contact a:hover {
  color: #7ee787;
  text-decoration: underline;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 1rem;
  background: rgba(22,27,34,0.9);
  border-top: 2px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Back to Top Button - Premium Design ===== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #ff6ec4, #7873f5, #4ade80);
  background-size: 300% 300%;
  color: #fff;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  display: none; /* hidden by default */
  z-index: 200;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.4s ease, transform 0.4s ease, background-position 3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(120, 115, 245, 0.7);
  animation: gradientFlow 6s ease infinite;
}

#backToTop:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 25px rgba(255, 110, 196, 0.7), 
              0 0 25px rgba(120, 115, 245, 0.8),
              0 0 15px rgba(74, 222, 128, 0.6);
}

#backToTop.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Gradient Animation for Premium Look */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Light Mode ===== */
body.light-mode {
  background: #ffffff;
  color: #0d1117;
}

body.light-mode .navbar {
  background: linear-gradient(135deg, rgba(0,122,204,0.9), rgba(74,222,128,0.8));
  border-color: rgba(0,0,0,0.1);
}

body.light-mode .project-card,
body.light-mode footer {
  background: rgba(240,240,240,0.9);
  border-color: rgba(0,0,0,0.1);
}

body.light-mode .logo,
body.light-mode .project-title,
body.light-mode .project-links a {
  color: #007acc;
  border-color: #007acc;
}

body.light-mode .nav-links a.active {
  color: #ff6ec4;
  border-bottom-color: #ff6ec4;
}
