/* General Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--gradient);
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
  color: var(--text);
  transition: background 0.5s, color 0.5s;
  opacity: 0;
  transform: scale(0.98);
}
body.loaded {
  opacity: 1;
  transform: scale(1);
  transition: opacity 1s ease, transform 1s ease;
}
:root {
  --text: #222;
  --card: rgba(255, 255, 255, 0.85);
  --accent: linear-gradient(45deg, #6a11cb, #2575fc);
  --gradient: linear-gradient(-45deg, #ffecd2, #fcb69f, #a1c4fd, #c2e9fb);
  --hero-color: #222;
}
body.dark {
  --text: #f5f5f5;
  --card: rgba(30, 30, 30, 0.85);
  --gradient: linear-gradient(-45deg, #141e30, #243b55, #2b5876, #4e4376);
  --hero-color: #f5f5f5;
}
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Scroll Progress Bar */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 5px;
  width: 0;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  z-index: 2000;
  transition: width 0.25s ease;
}

/* Navbar */
header {
  position: fixed;
  top: 0; width: 100%;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  flex-wrap: wrap;
}
nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s;
}
nav a:hover { color: #2575fc; }
#mode-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--hero-color);
}
.subtitle { font-size: 1.2rem; margin: 1rem 0; }
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(100, 149, 237, 0.6);
}

/* Sections */
section {
  padding: 6rem 2rem;
  text-align: center;
}
h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

/* About */
.about p {
  max-width: 700px;
  margin: auto;
  line-height: 1.6;
  font-size: 1.1rem;
}

/* Skills */
.skills-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: auto;
}
.skill {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 15px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.skill i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.skill p { margin-top: 0.5rem; font-weight: 600; }
.skill:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 20px rgba(37, 117, 252, 0.4);
}
.github-skill i { color: #333; }
body.dark .github-skill i { color: #fff; }

/* Contact */
.contact form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact input, .contact textarea {
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
.contact button {
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.contact button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(37, 117, 252, 0.5);
}
.social-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.social-links a {
  font-size: 1.5rem;
  color: var(--text);
  transition: transform 0.3s, color 0.3s;
}
.social-links a:hover {
  transform: scale(1.2);
  color: #2575fc;
}
body.dark .social-links a { color: #f4f4f9; }

/* Footer */
footer {
  background: var(--card);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* Scroll Animations */
.scroll-effect {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}
.scroll-effect.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .skills-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-title { font-size: 2.2rem; }
}
@media (max-width: 480px) {
  nav ul { gap: 1rem; }
  .skills-container {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  section { padding: 4rem 1rem; }
}
