@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* 🌙 Dark Theme Variables (Default) */
:root {
  --bg-color: #0e0a1f;
  --text-color: #ffffff;
  --nav-bg: #1f1833;
  --header-bg: #1f1833;
  --section-bg: #1a1330;
  --highlight: #4f8ef7;
  --card-bg: #241c3a;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease-in-out;
}

header {
  background-color: var(--header-bg);
  padding: 2rem;
  text-align: center;
}

nav ul {
  display: flex;
  justify-content: center;
  background-color: var(--nav-bg);
  padding: 0;
  margin: 0;
  list-style: none;
}

nav ul li a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #302555;
  color: var(--highlight);
  box-shadow: 0 0 8px var(--highlight);
}

section {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
  background-color: var(--section-bg);
  border-radius: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

img {
  width: 160px;
  height: 160px;
  display: block;
  margin: 1rem auto;
  border-radius: 50%;
  border: 3px solid var(--highlight);
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

img:hover {
  transform: scale(1.05);
}

.project {
  background-color: var(--card-bg);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: 10px;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  transform: scale(0.95);
}

.project.visible {
  opacity: 1;
  transform: scale(1);
}

footer {
  background-color: var(--header-bg);
  text-align: center;
  padding: 1rem;
}

.toggle-theme {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--highlight);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.toggle-theme:hover {
  background: #3065d2;
  box-shadow: 0 0 10px var(--highlight);
}

/* 🔄 Preloader */
#preloader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #0e0a1f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader {
  border: 6px solid #1f1833;
  border-top: 6px solid #4f8ef7;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 🌞 Light Theme when dark-mode is ON */
body.dark-mode {
  --bg-color: #f0f0f0;
  --text-color: #111111;
  --nav-bg: #e0e0e0;
  --header-bg: #dddddd;
  --section-bg: #ffffff;
  --highlight: #4f8ef7;
  --card-bg: #f4f4f4;
}

body.dark-mode nav ul li a:hover {
  background-color: #cfcfcf;
  color: var(--highlight);
}

body.dark-mode .toggle-theme {
  background: #333;
  color: white;
}

/* 📩 Contact Form */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

form label {
  font-weight: 600;
}

form input,
form textarea {
  padding: 0.7rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  background: #fff;
  color: #111;
}

body.dark-mode form input,
body.dark-mode form textarea {
  background: #f4f4f4;
  color: #000;
}

form button {
  background: var(--highlight);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

form button:hover {
  background: #366eea;
}

/* 🔗 Social Icon Links */
.social-links {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-links a {
  color: var(--text-color);
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--highlight);
}

/* 📄 Resume Button */
.resume-btn {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.8rem 1.5rem;
  background: var(--highlight);
  color: white;
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.resume-btn:hover {
  background: #366eea;
}