/* --- Base Styles & Variables --- */
:root {
  --bg-color-light: #f8f9fa;
  --text-color-light: #212529;
  --primary-color-light: #6d28d9;
  --accent-color-light: #10b981;
  --card-bg-light: #ffffff;
  --border-color-light: #dee2e6;
  --primary-color-shadow-light: rgba(109, 40, 217, 0.2);
  --card-shadow-light: rgba(45, 51, 63, 0.08);

  --bg-color-dark: #0b0f19;
  --bg-color-dark-end: #080c14;
  --text-color-dark: #e0e7ff;
  --primary-color-dark: #818cf8;
  --accent-color-dark: #34d399;
  --card-bg-dark: #161b29;
  --border-color-dark: #303749;
  --primary-color-shadow-dark: rgba(129, 140, 248, 0.15);
  --card-shadow-dark: rgba(0, 0, 0, 0.2);

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-speed: 0.4s ease-in-out;
}

[data-theme='light'] {
  --bg-image: linear-gradient(180deg, var(--bg-color-light) 0%, #eff2f7 100%);
  --text-color: var(--text-color-light);
  --text-color-muted: #6c757d;
  --primary-color: var(--primary-color-light);
  --accent-color: var(--accent-color-light);
  --card-bg: var(--card-bg-light);
  --border-color: var(--border-color-light);
  --primary-color-shadow: var(--primary-color-shadow-light);
  --card-shadow: var(--card-shadow-light);
}

[data-theme='dark'] {
  --bg-image: linear-gradient(
    180deg,
    var(--bg-color-dark) 0%,
    var(--bg-color-dark-end) 100%
  );
  --text-color: var(--text-color-dark);
  --text-color-muted: #8d9ab1;
  --primary-color: var(--primary-color-dark);
  --accent-color: var(--accent-color-dark);
  --card-bg: var(--card-bg-dark);
  --border-color: var(--border-color-dark);
  --primary-color-shadow: var(--primary-color-shadow-dark);
  --card-shadow: var(--card-shadow-dark);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-image);
  color: var(--text-color);
  line-height: 1.7;
  transition: background var(--transition-speed), color var(--transition-speed);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- CORE LAYOUT STRUCTURE --- */
.portfolio-container {
  display: grid;
  grid-template-columns: 40% 60%;
  height: 100vh;
}
.left-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem;
}
.right-pane {
  overflow-y: scroll;
  height: 100vh;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.right-pane::-webkit-scrollbar {
  display: none; /* Chrome, Safari, and Opera */
}

/* --- Left Pane Content --- */
.left-pane-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}
.left-pane h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}
.left-pane h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  min-height: 2.2rem;
}
.left-pane p {
  font-size: 1.1rem;
  max-width: 450px;
  margin-bottom: 3rem;
}
.typing-effect::after {
  content: '|';
  animation: blink 0.7s infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Sticky Navigation */
.sticky-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.nav-indicator {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color-muted);
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-indicator .line {
  width: 30px;
  height: 2px;
  background-color: var(--border-color);
  transition: all var(--transition-speed);
}
.nav-indicator:hover .line,
.nav-indicator.active .line {
  width: 60px;
  background-color: var(--primary-color);
}
.nav-indicator:hover .text,
.nav-indicator.active .text {
  color: var(--primary-color);
}

/* Left Pane Footer */
.left-pane-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.social-links {
  display: flex;
  gap: 1rem;
}
.social-links a {
  color: var(--text-color-muted);
  font-size: 1.5rem;
  transition: all var(--transition-speed);
}
.social-links a:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}
.theme-switcher {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-color-muted);
  transition: color var(--transition-speed);
}
.theme-switcher:hover {
  color: var(--primary-color);
}
.theme-switcher .fa-sun {
  display: none;
}
[data-theme='light'] .theme-switcher .fa-sun {
  display: inline-block;
}
[data-theme='dark'] .theme-switcher .fa-moon {
  display: inline-block;
}
[data-theme='dark'] .theme-switcher .fa-sun {
  display: none;
}

/* --- Right Pane Content --- */
.right-pane section {
  padding: 10rem 4rem;
  border-top: 1px solid var(--border-color);
}
.right-pane section:first-child {
  border-top: none;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 3rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Image Styles */
.profile-photo {
  width: 100%;
  max-width: 250px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  background-color: var(--border-color); /* Fallback color */
}
.project-thumbnail {
  height: 250px;
  width: calc(100% + 3rem); /* Compensate for card padding */
  margin: -1.5rem 0 1.5rem -1.5rem; /* Replicate placeholder layout */
  object-fit: cover;
  transition: transform var(--transition-speed);
  background-color: var(--border-color); /* Fallback color */
}
.project-card:hover .project-thumbnail {
  transform: scale(1.05);
}

/* REDESIGNED SKILLS SECTION */
.skill-showcase {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: flex-start;
}
.skill-tabs {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.skill-tab {
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color-muted);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.skill-tab:hover {
  color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.05);
}
.skill-tab.active {
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}
.skill-content {
  min-height: 250px;
}
.skill-pane {
  display: none;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.skill-pane.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.5s ease-in-out;
}
.skill-pane span {
  background-color: var(--accent-color);
  color: var(--bg-color-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reusable Components */
.btn {
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-weight: 700;
  transition: all var(--transition-speed);
  display: inline-block;
}
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px var(--primary-color-shadow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-color-shadow);
}
.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  margin-left: 1rem;
}
.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}
.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -15px var(--card-shadow);
  transition: all var(--transition-speed);
  padding: 1.5rem;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px var(--card-shadow);
  border-color: var(--primary-color);
}
.project-card h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.8rem;
}
.tech-stack span {
  background: var(--bg-image);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  border: 1px solid var(--border-color);
}
.project-links {
  margin-top: auto;
  display: flex;
  gap: 1rem;
}
.icon-btn {
  color: var(--text-color);
  font-size: 1.5rem;
  transition: color var(--transition-speed);
}
.icon-btn:hover {
  color: var(--primary-color);
}

/* Other Sections */
.about-content {
  display: grid;
  grid-template-columns: auto 2fr;
  gap: 2.5rem;
  align-items: center;
}
.about-image {
  margin: 0 auto;
}
.about-text .cta-buttons {
  margin-top: 2rem;
}
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
.contact-section {
  text-align: center;
}
.contact-section p {
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
  font-size: 1.1rem;
}
.email-link {
  display: inline-block;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-color);
  text-decoration: none;
  margin-bottom: 2rem;
}

/* Footer & Animations */
footer {
  padding: 2rem 0;
  text-align: center;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVENESS --- */
@media (max-width: 992px) {
  /* ==== FIX STARTS HERE ==== */
  .portfolio-container {
    display: block;
    height: auto;
  }
  .left-pane {
    position: static;
    height: auto;
    min-height: 100vh;
    justify-content: center;
    text-align: center;
  }
  .right-pane {
    height: auto;
    overflow-y: visible;
    overflow: visible;
  }
  /* ==== FIX ENDS HERE ==== */

  .left-pane-content,
  .sticky-nav,
  .left-pane-footer {
    align-items: center;
  }
  .left-pane p {
    max-width: 600px;
  }
  .left-pane-footer {
    padding-top: 2rem;
    justify-content: center;
  }
  .sticky-nav {
    margin-bottom: 2rem;
  }
  .right-pane section {
    padding: 6rem 2rem;
  }
  .about-content,
  .skill-showcase {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .skill-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
  }
  .skill-tab {
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
  }
  .skill-tab.active {
    border-bottom-color: var(--primary-color);
    background-color: transparent;
  }
  .skill-pane {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .social-links {
    display: flex;
    justify-content: center;
  }
  .btn-primary {
    margin-bottom: 10px;
  }
  .left-pane {
    padding: 2rem;
  }
  .right-pane section {
    padding: 5rem 1.5rem;
  }
}