/* ====== GLOBAL STYLES ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #0f172a; /* dark slate */
  color: #f8fafc;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ====== LOADER ====== */
#loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 6px solid #1e293b;
  border-top: 6px solid #38bdf8;
  border-radius: 50%;
  width: 50px; height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== NAVBAR ====== */
nav {
  background: rgba(15, 23, 42, 0.95);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: #f8fafc;
  font-weight: 500;
  transition: color 0.3s, border-bottom 0.3s;
  padding-bottom: 4px;
}

nav a:hover,
nav a.active {
  color: #38bdf8;
  border-bottom: 2px solid #38bdf8;
}

/* ====== HERO (HOME PAGE) ====== */
header {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* centers vertically */
  align-items: center;       /* centers horizontally */
  text-align: center;
  padding: 2rem;
  background: linear-gradient(to bottom, #0f172a, #1e293b);
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
}

header h1 span {
  color: #38bdf8;
}

header p {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: #cbd5e1;
}

/* ====== ABOUT PAGE ====== */
.about-container {
  display: flex;
  max-width: 1000px;
  margin: 4rem auto;
  padding: 2rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-image img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #38bdf8;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.about-content {
  flex: 2;
  background: rgba(30, 41, 59, 0.95);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.about-content h2 {
  margin-bottom: 1rem;
  color: #38bdf8;
}

.about-content p {
  margin-bottom: 1.5rem;
  color: #cbd5e1;
}

.skills-list {
  list-style: none;
  padding-left: 0;
}

.skills-list li {
  margin-bottom: 0.5rem;
  background: #0f172a;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  color: #f8fafc;
  transition: transform 0.3s;
}

.skills-list li:hover {
  transform: translateX(5px);
}

/* ====== PROJECTS PAGE ====== */
.projects-container {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

.projects-container h2 {
  margin-bottom: 2rem;
  color: #38bdf8;
  font-size: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(30, 41, 59, 0.95);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
  transition: transform 0.3s, background 0.3s;
}

.project-card:hover {
  transform: translateY(-8px);
  background: rgba(30, 41, 59, 1);
}

.project-card h3 {
  margin-bottom: 1rem;
  color: #38bdf8;
}

.project-card p {
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.project-card a {
  text-decoration: none;
  background: #38bdf8;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  color: #0f172a;
  font-weight: bold;
  transition: background 0.3s;
}

.project-card a:hover {
  background: #0ea5e9;
}

/* ====== CONTACT PAGE ====== */
.contact-container {
  max-width: 700px;
  margin: 4rem auto;
  padding: 2rem;
  background: rgba(30, 41, 59, 0.95);
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.contact-container h2 {
  margin-bottom: 1.5rem;
  color: #38bdf8;
  text-align: center;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form input,
form textarea {
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  background: #1e293b;
  color: #f8fafc;
}

form input:focus,
form textarea:focus {
  border: 2px solid #38bdf8;
}

form button {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

form button:hover {
  background: #0ea5e9;
}
/* ==== Popup Styling ==== */
.popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.popup-content {
  background: #fff;
  padding: 20px 40px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
  animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px); }
  to { transform: translateY(0); }
}

.popup.success .popup-content {
  background: #e6ffe6;
  color: #2b7a2b;
}

.popup.error .popup-content {
  background: #ffe6e6;
  color: #a30000;
}


/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  nav ul {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .about-container {
    flex-direction: column;
    text-align: center;
  }

  .about-content {
    text-align: left;
  }

  .hero h1 {
    font-size: 2rem;
  }
}
