/* ====================================
   1. VARIABLES & THEME
   ==================================== */
:root {
  --primary-color: #007bff;
  --secondary-color: #28a745;
  --bg-color: #121212;
  --bg-color2: #1e1e1e; /* Changed for better contrast */
  --accent-color: #2a2a2a;
  --text-color: #e0e0e0;
  --text-muted: rgba(224, 224, 224, 0.7);
  --border-color: #333;
  --border-color-subtle: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.25);
  --primary-rgb: 0, 123, 255;
  --secondary-rgb: 40, 167, 69;
}

[data-theme="light"] {
  --primary-color: #0056b3;
  --secondary-color: #218838;
  --bg-color: #f4f4f9;
  --bg-color2: #ffffff;
  --accent-color: #f8f9fa;
  --text-color: #121212;
  --text-muted: #6c757d;
  --border-color: #ddd;
  --border-color-subtle: rgba(0, 0, 0, 0.075);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ====================================
   2. BASE & RESET
   ==================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* Offset for fixed header */
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

img {
  max-width: 100%;
  display: block;
}

/* ====================================
   3. LAYOUT & TYPOGRAPHY
   ==================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem; /* Better padding for mobile */
}

section {
  padding: 5rem 0;
}

.section-intro {
  text-align: center;
  color: var(--secondary-color);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.section-title {
  text-align: center;
  font-size: 2.25rem;
  color: var(--primary-color);
  margin-bottom: 3rem;
  font-weight: 700;
}

/* ====================================
   4. HEADER / NAVIGATION
   ==================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-color2);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  height: 5rem;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle,
.hamburger {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-links {
  position: fixed;
  top: 5rem;
  left: 0;
  width: 100%;
  height: calc(100vh - 5rem);
  background: var(--bg-color2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 999;
}

.nav-links.active {
  transform: translateX(0);
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.2rem;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* 
   5. BUTTONS & TAGS
*/
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background: transparent;
  color: var(--primary-color);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-secondary:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-full {
  width: 100%;
  font-size: 1.1rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px; /* Pill shape */
  border: 1px solid;
}
.tag-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.tag-secondary {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

/* ====================================
   6. HERO SECTION
   ==================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 5rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
}

.hero-bio {
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.75rem;
}

.hero-socials a {
  color: var(--text-muted);
  transition: color 0.3s, transform 0.3s;
}

.hero-socials a:hover {
  color: var(--primary-color);
  transform: translateY(-5px);
}

/* ====================================
   7. ABOUT SECTION
   ==================================== */
#about {
  background: var(--bg-color2);
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
}

.about-image {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary-color);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  max-width: 600px;
  text-align: center;
}

.about-text p {
  line-height: 1.8;
  color: var(--text-muted);
}

.about-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color-subtle);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px var(--shadow-color);
}

.feature-card .card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card .card-title {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.feature-card .card-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ====================================
   8. SKILLS SECTION
   ==================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg-color2);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.skill-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.skill-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.skill-level-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 4px;
}

/* ====================================
   9. RESUME SECTION
   ==================================== */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.resume-column .column-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.column-title i {
  font-size: 1.2em;
}

.resume-card {
  background-color: var(--bg-color2);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid transparent;
}
.resume-card:last-child {
  margin-bottom: 0;
}
.resume-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px var(--shadow-color);
}

.resume-column:first-child .resume-card {
  border-left-color: var(--primary-color);
}
.resume-column:last-child .resume-card {
  border-left-color: var(--secondary-color);
}

.card-title-main {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.card-subtitle.company {
  font-size: 1rem;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  display: block;
}

.card-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ====================================
   10. PROJECTS SECTION
   ==================================== */
#projects {
  background-color: var(--bg-color2);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 30px var(--shadow-color);
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.project-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

/* ====================================
   11. CONTACT SECTION
   ==================================== */
.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.info-card {
  background: var(--bg-color2);
  border: 1px solid var(--border-color-subtle);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease;
}
.info-card:hover {
  transform: translateY(-5px);
}
.info-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.info-card h3 {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}
.info-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  word-break: break-all;
}

.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background-color: var(--bg-color2);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow-color);
}

.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--text-color);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--border-color-subtle);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* ====================================
   12. FOOTER
   ==================================== */
footer {
  background: var(--bg-color2);
  padding: 4rem 1rem 2rem;
  color: var(--text-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  text-align: center;
}

.footer-column h3 {
  color: var(--text-color);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-about p {
  line-height: 1.8;
  color: var(--text-muted);
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-links a:hover::after {
  width: 100%;
}

.footer-connect .social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.social-icons a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: var(--bg-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: background-color 0.3s, color 0.3s;
}
.social-icons a:hover {
  background-color: var(--primary-color);
  color: #fff;
}
.footer-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-bottom .fa-heart {
  color: #e25555;
}

/* ====================================
   13. UTILITIES (Animation & Scroll-top)
   ==================================== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  z-index: 1000;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(100px);
  visibility: hidden;
}

.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Entrance Animation */
.anim-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.anim-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for hero */
.hero .anim-on-scroll {
  transition-delay: calc(var(--delay) * 200ms);
}

/* ====================================
   14. RESPONSIVE MEDIA QUERIES
   ==================================== */
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
  .section-title {
    font-size: 2.75rem;
  }
  .hamburger {
    display: none;
  }
  .nav-links {
    position: static;
    flex-direction: row;
    height: auto;
    width: auto;
    background: transparent;
    transform: none;
    gap: 2rem;
  }
  .nav-links a {
    font-size: 1rem;
  }
  .hero-title {
    font-size: 3.5rem;
  }
  .hero-subtitle {
    font-size: 1.75rem;
  }
  .about-content {
    flex-direction: row;
    gap: 4rem;
    text-align: left;
  }
  .about-text {
    text-align: left;
  }
  .about-features {
    grid-template-columns: repeat(3, 1fr);
  }
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .contact-form {
    padding: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    text-align: left;
  }
  .footer-connect .social-icons {
    justify-content: flex-start;
  }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .resume-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
  }
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
