:root {
  /* Light Theme */
  --bg-dim: #E5DFC5;
  --bg0: #F3EAD3;
  --bg1: #EAE4CA;
  --bg2: #E5DFC5;
  --bg3: #DDD8BE;
  --bg4: #DBD3BA;
  --primary-color: #3A94C5;
  --secondary-color: #F57D26;
  --text-color: #5C6A72;
  --text-muted: #829181;
}

body[data-theme="dark"] {
  /* Dark Theme */
  --bg-dim: #293136;
  --bg0: #333C43;
  --bg1: #3A464C;
  --bg2: #434F55;
  --bg3: #4D5960;
  --bg4: #555F66;
  --primary-color: #7FBBB3;
  --secondary-color: #E69875;
  --text-color: #D3C6AA;
  --text-muted: #9DA9A0;
}

body {
  background-color: var(--bg0);
  color: var(--text-color);
  transition: all 0.3s ease;
  min-height: 100vh;
}

/* Navbar Positioning */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--bg1) !important;
  border-bottom: 1px solid var(--bg3);
  padding: 0.5rem 0;
}

.navbar {
  transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Add padding to main content to account for fixed navbar */
main {
  padding-top: 80px;
  /* Adjust based on your navbar height */
  min-height: calc(100vh - 80px);
}

/* Optional: Add scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Experience Items */
.experience-item {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin: 2rem auto;
  padding: 2rem;
  background: var(--bg1);
  border-radius: 8px;
  max-width: 800px;
}

.experience-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Education Grid */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.education-card {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: var(--bg1);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.education-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tooltip */
#langToggle .tooltip {
  visibility: hidden;
  width: 160px;
  background-color: var(--bg3);
  color: var(--text-color);
  text-align: center;
  border-radius: 4px;
  padding: 5px;
  position: absolute;
  z-index: 1001;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  top: calc(100% + 12px);
}

#langToggle .tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent var(--bg3) transparent;
}

#langToggle:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Add this to fix tooltip positioning */
#langToggle {
  position: relative;
  display: inline-block;
}

#langToggle .tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Ensure cards are visible when active */
.experience-item,
.education-card,
.skill-category {
  opacity: 1;
  /* Remove initial opacity */
  transform: none;
  /* Remove initial transform */
  animation: none;
  /* Remove any animations */
}

.experience-item:not(.visible),
.education-card:not(.visible) {
  opacity: 0;
  transform: translateY(40px);
}

/* Add basic card styling */
.experience-item,
.education-card,
.skill-category {
  background: var(--bg1);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Experience Items */
.experience-item {
  margin: 2rem auto;
  max-width: 800px;
}

/* Education Grid */
.education-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Skills Grid */
.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.skill-category h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.skill-items {
  gap: 0.75rem;
}

.skill-items span {
  background: var(--bg2);
  padding: 0.5rem 1rem;
}

/* Experience Cards */
.experience-item {
  background: var(--bg1);
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  transition: transform 0.3s ease;
}

.experience-item:hover {
  transform: translateX(10px);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg3);
}

.experience-title {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.4rem;
}

.experience-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.experience-company {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 1.1rem;
}

.experience-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  margin-top: 1rem;
}

.achievements-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.achievements-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.achievements-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 200px;
}

.tool-pill {
  background: var(--bg2);
  color: var(--text-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* Education Cards */
.education-card {
  background: var(--bg1);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.education-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--secondary-color);
}

.education-header {
  margin-bottom: 1rem;
}

.education-institution {
  color: var(--primary-color);
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

.education-degree {
  color: var(--text-color);
  font-weight: 600;
  margin: 0;
}

.education-duration {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.education-highlights {
  padding-left: 1rem;
  margin: 1rem 0;
}

.education-highlights li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.education-highlights li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--secondary-color);
}

/* Center experience cards */
.experience-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Adjust tool pills */
.tool-pill {
  background: var(--bg2);
  color: var(--text-color);
  padding: 0.25rem 0.75rem;
  /* Reduced padding */
  border-radius: 20px;
  font-size: 0.8rem;
  /* Smaller font size */
  margin: 0.25rem;
  white-space: nowrap;
  /* Prevent line breaks */
}

/* Fix experience details grid */
.experience-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 220px;
  /* Limit tools column width */
  padding-left: 1rem;
  border-left: 2px solid var(--bg3);
}

/* Better mobile handling */
@media (max-width: 768px) {
  .experience-details {
    grid-template-columns: 1fr;
  }

  .tools-list {
    border-left: none;
    padding-left: 0;
    max-width: 100%;
    margin-top: 1rem;
  }
}

/* Education cards alignment */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.education-card {
  background: var(--bg1);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.education-card:hover {
  transform: translateY(-3px);
}

/* Adjust tool pills */
.skill-pill {
  background: var(--bg2);
  color: var(--text-color);
  padding: 0.25rem 0.75rem;
  /* Reduced padding */
  border-radius: 20px;
  font-size: 0.8rem;
  /* Smaller font size */
  margin: 0.25rem;
  white-space: nowrap;
  /* Prevent line breaks */
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.skill-category {
  background: var(--bg1);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.project-card {
  background: var(--bg1);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-header {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.project-tech span {
  background: var(--bg2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.project-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; /* Uniform gap in all directions */
  align-items: center;
  margin: -0.25rem; /* Counteract child margins */
}

.skill-pill {
  background: var(--bg2);
  color: var(--text-color);
  padding: 0.35rem 0.9rem; /* Slightly larger padding */
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 0.25rem; /* Maintain individual margins */
  line-height: 1.4; /* Better vertical alignment */
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.skill-pill:hover {
  transform: translateY(-2px);
}

/* Navbar Theme Adjustments */
.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--text-color) !important;
}

.nav-link {
    color: var(--text-color) !important;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Hamburger menu color */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28var%28--text-color%29, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler {
    border-color: var(--text-color);
}

/* Contact Page Specific */
.contact-container {
  background: var(--bg1);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.email-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.email-link:hover {
  opacity: 0.8;
  color: var(--primary-color);
}

.form-control {
  background-color: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text-color);
}

.form-control:focus {
  background-color: var(--bg2);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
  color: var(--text-color);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  padding: 0.75rem 2rem;
}

.btn-primary:hover {
  background-color: var(--accent-aqua);
  border-color: var(--accent-aqua);
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.social-link {
  font-size: 2rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Contact Form Adjustments */
.contact-container {
  max-width: 600px;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.social-link {
  font-size: 2rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Contact Form Adjustments */
.contact-container {
  max-width: 600px;
}

/* Add this to create space below fixed navbar */
main {
  padding-top: 6rem; /* Increased from previous value */
  min-height: calc(100vh - 80px);
}

/* Contact Page Specific Adjustment */
.contact-container {
  margin-top: 2rem; /* Additional spacing */
}

@media (max-width: 768px) {
  main {
      padding-top: 4rem; /* Less space on mobile */
  }
}

/* Contact Container Centering */
.contact-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.project-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1rem;
  display: block;
}

.project-tech span {
  background: var(--bg2);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* Shared Card Styles */
.skill-category,
.project-card {
    background: var(--bg1);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Unified Tech/Skill Pills */
.skill-pill,
.project-tech span {
    background: var(--bg2);
    color: var(--text-color);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0.25rem;
    display: inline-block;
    border: 1px solid var(--bg3);
}

/* Consistent Header Styling */
.skill-category h4,
.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.project-link {
    color: inherit;
    text-decoration: none;
}

.project-link:hover {
    color: var(--primary-color);
}

/* Status Indicators */
.project-status {
    background: var(--bg2);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Icon Adjustments */
#themeToggle i,
#langToggle i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* Smooth icon transition */
#themeToggle i {
    transition: transform 0.3s ease;
}

#themeToggle:hover i {
    transform: rotate(-15deg);
}