/* ===== VARIABLES & BASE STYLES ===== */
:root {
  --primary-light: #2563eb;
  --secondary-light: #4f46e5;
  --bg-light: #f1f5f9;
  --text-light: #1e293b;
  --card-bg-light: #ffffff;
  --border-light: #e2e8f0;

  --primary-dark: #818cf8;
  --secondary-dark: #a5b4fc;
  --bg-dark: #0f172a;
  --text-dark: #e2e8f0;
  --card-bg-dark: #1e293b;
  --border-dark: #334155;

  --font-heading: "Inter", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: var(--primary-dark);
  --secondary: var(--secondary-dark);
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --card-bg: var(--card-bg-dark);
  --border: var(--border-dark);
}

[data-theme="light"] {
  --primary: var(--primary-light);
  --secondary: var(--secondary-light);
  --bg: var(--bg-light);
  --text: var(--text-light);
  --card-bg: var(--card-bg-light);
  --border: var(--border-light);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Offset for sticky navbar */
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
}

h2.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 0.5rem auto 0;
}

section {
  padding: 6rem 0;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

[data-theme="dark"] .navbar {
   background-color: rgba(15, 23, 42, 0.8);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-links ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover {
    color: var(--primary);
    transform: scale(1.1) rotate(15deg);
}

.mobile-menu-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: none; /* Hidden on desktop */
}

/* ===== HERO SECTION ===== */
#home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding-top: 70px; /* Navbar offset */
}

.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 5px solid var(--primary);
  object-fit: cover;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

#home h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

#home .description {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text);
  opacity: 0.8;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -10px var(--primary);
}
.project-card .btn, .social-link .btn {
    background-color: var(--primary);
    color: white;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}
.project-card .btn:hover, .social-link .btn:hover {
    background-color: var(--secondary);
}

/* ===== EDUCATION TIMELINE ===== */
.education-timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.education-timeline::after {
  content: '';
  position: absolute;
  width: 3px;
  background-color: var(--primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1.5px;
}

.timeline-item {
  padding: 1rem 2.5rem;
  position: relative;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--bg);
  border: 4px solid var(--primary);
  border-radius: 50%;
  top: 28px;
  z-index: 1;
}

.timeline-item:nth-child(odd)::after {
  right: -10px;
}

.timeline-item:nth-child(even)::after {
  left: -10px;
}

.timeline-content {
  padding: 1.5rem;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
}

.timeline-content h3 {
    font-size: 1.25rem;
    color: var(--primary);
}
.timeline-meta {
    font-weight: 600;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}
.timeline-details {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== PROJECTS & SKILLS GRIDS ===== */
.projects-grid, .skills-grid, .social-container {
  display: grid;
  gap: 1.5rem;
}

.projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.social-container {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.project-card, .skill-item, .social-link {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.project-card:hover, .skill-item:hover, .social-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card h3 {
  margin-bottom: 0.5rem;
}

.project-card p {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.skill-item i {
  font-size: 2.5rem;
  color: var(--primary);
}

/* ===== CONTACT & QR CODES ===== */
.social-link h3 {
    margin-bottom: 1rem;
}
.qr-container {
  width: 150px;
  height: 150px;
  margin: 0 auto 1rem;
  position: relative;
  background-color: white;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.qr-code {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  font-weight: 600;
  pointer-events: none;
}

.qr-container:hover .qr-overlay {
  opacity: 1;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}
.footer p {
    opacity: 0.7;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }
  
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }

  .nav-links.open {
    left: 0;
  }

  .nav-links ul {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }
  
  .nav-links a {
    font-size: 1.5rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  #home h1 {
    font-size: 2.5rem;
  }
  
  h2.section-title {
    font-size: 2rem;
  }

  .education-timeline::after {
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 0;
    left: 0 !important;
  }
  .timeline-item::after {
    left: 10px;
  }
}
