:root{
  /* Theme-aware color tokens (default / light theme) */
  --bg: #fdfdfd;
  --panel-bg: #fff;
  --text: #333;
  --muted: #666;
  --primary: #0d6efd;
  --primary-50: rgba(13,110,253,0.06);
  --glass: rgba(255,255,255,0.08);
  /* translucent overlays used for small UI chrome (social icons, resume button, etc.) */
  --overlay: rgba(255,255,255,0.10);
  --overlay-strong: rgba(255,255,255,0.2);
  --overlay-border: rgba(255,255,255,0.18);
  --surface: #f8f9fa;
  --muted-border: #dee2e6;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  /* Use instant scrolling to avoid partial-section visible during programmatic navigation */
  scroll-behavior: auto;
  background: var(--bg);
  transition: background-color 240ms ease, color 240ms ease;
}

/* Dark theme overrides when `html[data-theme="dark"]` is set */
html[data-theme="dark"] {
  --bg: #0b0f14;
  --panel-bg: #0f1720;
  --text: #e6eef8;
  --muted: #b9c6d8;
  --primary: #5aa8ff;
  --primary-50: rgba(90,168,255,0.08);
  --glass: rgba(255,255,255,0.06);
  --overlay: rgba(255,255,255,0.06);
  --overlay-strong: rgba(255,255,255,0.12);
  --overlay-border: rgba(255,255,255,0.12);
  --surface: #0b1220;
  --muted-border: rgba(255,255,255,0.06);
}

/* Scroll snapping so each section snaps to viewport start */
html, body {
  height: 100%;
}
/* Use border-box to avoid padding/margin increasing element boxes unexpectedly */
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.hero, .section {
  scroll-snap-align: start;
}

/* Sidebar */
.sidebar {
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  background: var(--panel-bg);
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
  padding: 30px 20px;
  border-right: 1px solid rgba(0,0,0,0.06);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  overflow-y: auto;
  z-index: 1000;
}

.theme-toggle-wrapper {
  padding-top: 20px;
  margin-top: 10px;
  border-top: 1px solid var(--muted-border);
  margin-left: 15px;
  margin-right: 15px;
}

#theme-toggle {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--muted-border);
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  font-size: 14px;
}

#theme-toggle:hover {
  background: var(--primary-50);
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(15deg);
}

.sidebar img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 4px solid var(--primary-50);
  transition: 0.3s;
}

img {
  max-width: 100%;
  height: auto;
}

.sidebar img:hover {
  transform: scale(1.05);
}

.sidebar h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
}

.sidebar p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.sidebar nav a {
  display: block;
  padding: 10px 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: 0.3s;
}

.sidebar nav a:hover, 
.sidebar nav a.active {
  color: var(--primary);
}

.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  background: var(--primary);
  border-radius: 10px;
}

/* Main content */
.content {
  margin-left: 260px;
  padding: 0;
  background: transparent;
  color: var(--text);
}

/* Footer styling: align with content and respect sidebar on wide screens */
footer {
  margin-left: 260px;
  padding: 20px 36px;
  color: var(--muted);
  background: transparent;
  border-top: 1px solid var(--muted-border);
  text-align: left;
  z-index: 5;
}

@media (max-width: 991.98px) {
  footer {
    margin-left: 0;
    padding: 16px 20px;
    text-align: center;
  }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  /* Collapse sidebar into a top bar */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-right: none;
  border-bottom: 1px solid var(--muted-border);
    box-shadow: none;
  }

  .sidebar img {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
  }

  .sidebar h2, .sidebar p, .sidebar nav {
    display: none; /* keep header compact on small screens */
  }

  .content {
    margin-left: 0;
    padding-top: 12px;
  }

  footer {
    margin-left: 0;
  }
}



@media (min-width: 992px) and (max-width: 1199.98px) {
  .sidebar {
    width: 200px;
  }

  .content {
    margin-left: 200px;
  }

  .hero-text h1 {
    font-size: 48px;
  }
}
/* Hero and sections are defined below consistently */
.hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  background: url('assets/images/hero-bg.jpg?v=1') no-repeat center center/cover;
  color: #fff; /* hero keeps white text to contrast hero image */
  text-align: left;
  position: relative;
  padding-left: 40px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 820px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-text h1 {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-text p {
  font-size: 18px;
  font-weight: 300;
}

.hero-text .btn {
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 30px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Resume row: place resume button and theme toggle side by side */
.resume-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 991.98px) {
  .resume-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }
}

/* Theme toggle should visually match other buttons */
#theme-toggle {
  padding: 10px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
  cursor: pointer;
  /* size similar to .btn-resume */
  min-width: 48px;
  height: 40px;
}

/* Match resume button's glassy look when in hero */
.hero .btn-outline-light#theme-toggle,
.hero #theme-toggle.btn-outline-light {
  background: var(--glass);
  border: 2px solid var(--overlay-border);
  color: #fff;
}

#theme-toggle:hover {
  transform: translateY(-3px);
  background: var(--overlay);
  border-color: var(--overlay-strong);
}

/* Compact resume button */
.btn-resume {
  /* Revert vertical size (length) to original feel, reduce horizontal breadth */
  padding: 12px 12px !important; /* 12px top/bottom, smaller left/right for narrower look */
  font-size: 14px !important;
  border-radius: 20px !important;
  white-space: nowrap;
  display: inline-block;
  max-width: 160px; /* limit breadth */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Make resume button visually match social handle style */
.btn-resume {
  background: var(--glass);
  border: 2px solid var(--overlay-border);
  color: var(--text) !important;
  backdrop-filter: blur(6px);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn-resume:hover {
  transform: translateY(-3px);
  background: var(--overlay);
  border-color: var(--overlay-strong);
}
.hero .btn-resume { /* ensure visibility on hero */
  color: #fff !important;
}

/* Small icon spacing for resume button if an icon is added in future */
.btn-resume i {
  margin-right: 8px;
}

/* Center hero content nicely on smaller screens */
@media (max-width: 991.98px) {
  .hero-text {
    align-items: center;
    text-align: center;
  }
  .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Contact form and contact info theme fixes */
.contact-form {
  background: var(--panel-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--muted-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.contact-form .form-control {
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--muted-border);
  border-radius: 8px;
}
.contact-form .form-control::placeholder { color: var(--muted); }
.contact-form textarea.form-control { min-height: 140px; }

.contact-form .form-control:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-50);
  border-color: var(--primary);
}

.contact-info {
  background: transparent;
  margin-top: 12px;
}
.contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.contact-item:last-child { border-bottom: none; }
.contact-icon {
  width: 44px;
  height: 44px;
  background: var(--panel-bg);
  border: 1px solid var(--muted-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text);
}
.contact-details h5 { margin: 0 0 6px 0; color: var(--text); }
.contact-details p { margin:0; color: var(--muted); }

/* Social Media Links */
.social-links {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--overlay);
  border: 2px solid var(--overlay-border);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.social-link:hover {
  background: var(--overlay-strong);
  border-color: var(--overlay-strong);
  color: var(--text);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Keep social links white on the hero image for contrast */
.hero .social-link {
  color: #fff;
}

.social-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.social-link i {
  display: inline;
}

/* Sections */
  .section {
    /* Sections match the page background so pages feel continuous */
    background: var(--bg);
    padding: 0;
    min-height: 100vh;
    text-align: left;
  }

.section h2 {
  /* Reduce spacing under headings to avoid extra vertical gaps */
  margin: 0 0 12px 0;
  font-weight: 700;
  font-size: 36px;
  color: var(--text);
  position: relative;
  text-align: left;
}

.section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin-top: 10px;
  border-radius: 2px;
}

.section p, .section ul {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  text-align: left;
}

/* Inner wrapper for sections: keeps outer .section full-height while providing inner padding for content */
.section .inner,
.section .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 36px; /* internal breathing room without creating gaps between sections */
  /* Do not force inner height or overflow — let the page scroll naturally */
}

/* Slightly larger lead paragraph for intro text */
.section .lead {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* Cards & utilities */
.card-custom {
  padding: 20px;
}

/* Make Bootstrap cards theme-aware so they don't stay white in dark mode */
.card, .card-custom, .card .card-body {
  background-color: var(--panel-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--muted-border) !important;
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}

/* Timeline spacing: reduce large margins and keep content readable */
.timeline-item {
  padding: 8px 20px;
  margin-bottom: 18px;
}

@media (max-width: 767.98px) {
  .hero {
    padding-left: 20px;
  height: 100vh;
  /* Keep hero full viewport on small screens so each page fills the window */
    align-items: flex-start;
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero-text h1 {
    font-size: 34px;
  }

  .hero-text p {
    font-size: 16px;
  }

  /* Remove outer padding on sections for small screens as well */
  .section {
    padding: 0;
  }

  .section h2 {
    font-size: 28px;
  }
}

/* Timeline for Experience and Education */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline-item {
  padding: 8px 24px;
  position: relative;
  margin-bottom: 18px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  width: 2px;
  background-color: var(--primary);
  top: 0;
  left: 20px;
  height: 0;
  transition: height 1.5s ease;
}

.timeline-item.animate::before {
  height: 100%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--panel-bg);
  border: 4px solid var(--primary);
  border-radius: 50%;
  left: 11px;
  top: 15px;
  z-index: 1;
}

.timeline-content {
  position: relative;
    border-radius: 6px;
    transition: all 0.3s ease, background-color 240ms ease, color 240ms ease;
    background-color: var(--panel-bg);
    color: var(--text);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.timeline-content h5 {
  color: var(--primary);
  margin-bottom: 6px;
}

.timeline-content h6 {
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 15px;
}

.timeline-content ul {
  padding-left: 20px;
  margin-top: 10px;
}
.timeline-content ul li {
  margin-bottom: 5px;
}

/* About Section */
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: var(--panel-bg);
  border-radius: 10px;
  color: var(--text);
  transition: background-color 240ms ease, color 240ms ease;
}

.about-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.stat-item h4 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-item p {
  margin: 0;
  font-weight: 500;
  color: var(--muted);
}

/* Services Section */
.service-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--primary);
}

/* Skills Section */
.skill-category {
  margin-bottom: 30px;
  text-align: left;
}

.skill-item {
  margin-bottom: 20px;
  text-align: left;
}

.skill-name {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.skill-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  transition: background-color 240ms ease;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary));
  border-radius: 4px;
  transition: width 1s ease-in-out;
  width: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: var(--panel-bg);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--muted-border);
  transition: background-color 240ms ease, color 240ms ease;
}

/* Work Section */
.project-image {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 20px;
  text-align: center;
}

.project-tech {
  margin: 15px 0;
}

.tech-tag {
  background: var(--panel-bg);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
  display: inline-block;
}

.project-links {
  margin-top: 20px;
}

.project-links .btn {
  margin-right: 10px;
  margin-bottom: 10px;
}

/* Contact Section */
.contact-form {
  background: var(--panel-bg);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  text-align: left;
  color: var(--text);
  transition: background-color 240ms ease, color 240ms ease;
}

.form-control {
  border: 2px solid var(--muted-border);
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem var(--primary-50);
}

.contact-info {
  padding: 20px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--panel-bg);
  border-radius: 10px;
  transition: transform 0.3s ease, background-color 240ms ease, color 240ms ease;
}

.contact-item:hover {
  transform: translateY(-2px);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 20px;
  flex-shrink: 0;
}

.contact-details h5 {
  margin-bottom: 5px;
  color: var(--text);
  font-weight: 600;
}

.contact-details p {
  margin: 0;
  color: var(--muted);
}
/* Services Section */
/* The theme-aware rule set above covers Services, Skills, Work and Contact sections. */

/* Make Bootstrap utility classes theme-aware so `bg-light` or `bg-white` don't force light panels in dark mode */
.bg-light, .bg-white {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

/* Preserve explicit white text on hero and small components that sit on top of the hero image */
.hero, .hero * {
  color: inherit; /* keep existing hero white rules untouched */
}

/* In case some elements used `.text-white` for emphasis on hero, limit the global effect by making `.hero .text-white` remain white, but otherwise map to var(--text) */
.text-white {
  color: var(--text) !important;
}
.hero .text-white {
  color: #fff !important;
}
