:root {
  /* Primary Colors */
  --primary-blue: #1e66f5;
  --primary-light-blue: #04a5e5;
  --primary-white: #eff1f5;
  --primary-black: #4c4f69;

  /* Background Colors */
  --bg-light-gray: #e6e9ef;
  --bg-white: #eff1f5;

  /* Text Colors */
  --text-dark: #4c4f69;
  --text-medium: #5c5f77;

  /* Accent Colors */
  --accent-blue: #209fb5;
  --accent-teal: #179299;
  /* A more subtle teal */

  /* Button Colors */
  --button-blue: #1e66f5;
  --button-text: #eff1f5;

  /* Border Colors */
  --border-light: #ccd0da;

  /* Hover/Focus Colors */
  --hover-blue: #7287fd;

  /* Gradient Colors */
  --gradient-start: #1e66f5;
  --gradient-end: #04a5e5;

  /* UI Colors */
  --ui-focus: #209fb5;
}


@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu72xKOzY.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-light-gray);
  color: var(--text-dark);
}




.container-narrow {
  width: 100%;
  max-width: 120rem;
  /* 1440px at 16px root font size, adjust as needed */
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(2rem, 10vw, 15rem);
  padding-right: clamp(2rem, 10vw, 15rem);
  scroll-margin-top: 2rem;
  /* box-sizing: border-box; */
}


section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (max-width: 767px) {
  section {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Publications & Recognition Section */
.publications-section {
  background: linear-gradient(135deg, var(--bg-light-gray) 0%, rgba(30, 102, 245, 0.05) 100%);
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}

.publications-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(30, 102, 245, 0.1) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

.publications-section .subtitle {
  color: var(--text-medium);
  font-size: 1.1rem;
  margin-top: -0.5rem;
  opacity: 0.9;
}

.publications-wrapper {
  position: relative;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 450px;
}

.publications-scroll-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.publications-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  transition: transform 0.6s ease;
}

.publication-item {
  position: absolute;
  width: 350px;
  height: 450px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
  cursor: pointer;
}

.publication-item.center {
  z-index: 3;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.publication-item.side {
  z-index: 1;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0.5;
  pointer-events: none;
}

.publication-item.side.left {
  transform: translate(-50%, -50%) translateX(-300px) scale(0.8);
}

.publication-item.side.right {
  transform: translate(-50%, -50%) translateX(300px) scale(0.8);
}

.publication-item.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  pointer-events: none;
  z-index: 0;
}

.publication-image-wrapper {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  background: #f0f0f0;
  aspect-ratio: 4/5;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.publication-item.center .publication-image-wrapper {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.publication-item.center:hover .publication-image-wrapper {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.publication-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.publication-item:hover .publication-image {
  transform: scale(1.05);
}

.publication-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.publication-item:hover .publication-overlay {
  transform: translateY(0);
}

.publication-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.publication-info p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.publication-year {
  font-size: 0.85rem !important;
  opacity: 0.7 !important;
  margin-bottom: 0.5rem !important;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.publication-links {
  display: flex;
  gap: 1rem;
}

.publication-links a {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.publication-links a:hover {
  background: var(--primary-blue);
  transform: scale(1.1);
}

.publication-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #ffb116 0%, #ff8c00 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

/* Scroll Buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(30, 102, 245, 0.2);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--primary-blue);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 10;
}

.scroll-btn:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 15px 40px rgba(30, 102, 245, 0.3);
}

.scroll-btn-left {
  left: 1rem;
}

.scroll-btn-right {
  right: 1rem;
}

.scroll-btn-left i {
  margin-right: 2px;
}

.scroll-btn-right i {
  margin-left: 2px;
}

.scroll-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%) scale(0.9);
}

/* Lightbox */
.publication-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.publication-lightbox.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bouncy {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  10% {
    transform: translateY(-8px);
  }
  30% {
    transform: translateY(-4px);
  }
  40% {
    transform: translateY(-6px);
  }
  60% {
    transform: translateY(-3px);
  }
  70% {
    transform: translateY(-2px);
  }
}

@keyframes bouncyHover {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-12px) rotate(-5deg);
  }
  50% {
    transform: translateY(-6px) rotate(3deg);
  }
  75% {
    transform: translateY(-8px) rotate(-2deg);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

@media (max-width: 768px) {
  .publications-wrapper {
    min-height: 380px;
  }
  
  .publications-scroll-container {
    max-width: 95%;
  }
  
  .publication-item {
    width: 280px;
    height: 360px;
  }
  
  .publication-item.center {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .publication-item.side {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0.4;
  }
  
  .publication-item.side.left {
    transform: translate(-50%, -50%) translateX(-200px) scale(0.75);
  }
  
  .publication-item.side.right {
    transform: translate(-50%, -50%) translateX(200px) scale(0.75);
  }
  
  .scroll-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
  
  .scroll-btn-left {
    left: 0.5rem;
  }
  
  .scroll-btn-right {
    right: 0.5rem;
  }
  
  .publication-overlay {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 100%);
  }
}



/* Footer section */

footer {
  background-color: #e6e9ef;
  color: #4c4f69;
}

footer a:not(.nav-link) {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.fa-heart {
  color: #d20f39;
}


/* Scroll Top */
#scrolltop {
  display: block;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.5s ease-in;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

#scrolltop .btn {
  padding: 3px 10px;
  border-radius: 50%;
}

/* Global styling */



.marker {
  position: relative;
  display: inline;
  width: auto;
}

.marker:after {
  content: "";
  width: 8rem;
  height: 1.5rem;
  position: absolute;
  bottom: -2rem;
  right: -2rem;
  background-image: url("data:image/svg+xml,%3Csvg width='125' height='20' viewBox='0 0 135 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath class='marker-path' d='M8 13.3507C23.614 12.0121 30.8232 10.3647 46.5 9.31385C73.1353 7.52845 100.096 8.08065 126.851 8.08065' stroke='%2304a5e5' stroke-width='15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

.marker-center:after {
  bottom: -30px;
  left: 50%;
  margin-left: -60px;
}

.text-center {
  padding-bottom: 1rem;
}


/* About Section */

#about {
  position: relative;
  overflow: hidden;
  padding: 100px 0;
  background: linear-gradient(135deg, #f6f0fd, #f0f8ff);
  color: #4c4f69;
}

.about-content {
  position: relative;
  z-index: 2;
  padding-left: 0;

}

.intro-title {
  padding-left: 0;
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #4c4f69;
}

.highlight-text {
  background: linear-gradient(120deg, var(--gradient-start), var(--gradient-end));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
  padding: 0 10px;
  transition: all 0.3s ease;
}


.role-container {
  height: 30px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.role {
  display: block;
  height: 100%;
  color: var(--primary-blue);
  font-weight: bold;
  animation: slide 9s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}

.intro-text {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: #5c5f77;
}

.image-column {
  padding-left: 6rem;

}

.image-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: visible;
}

.profile-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.image-deco-1,
.image-deco-2 {
  position: absolute;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.image-deco-1 {
  top: -20px;
  left: -20px;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #1e66f5, #7287fd, #ea76cb);
  z-index: -1;
}

.image-deco-2 {
  bottom: -20px;
  right: -20px;
  width: 70%;
  height: 70%;
  background: linear-gradient(45deg, #8839ef, #209fb5, #04a5e5);
  z-index: -2;
}


@keyframes slide {

  0%,
  33.33% {
    transform: translateY(0);
  }

  33.33%,
  66.66% {
    transform: translateY(-100%);
  }

  66.66%,
  100% {
    transform: translateY(-200%);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.hover-effect {
  transition: all 0.3s ease;
}

.hover-effect:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 991px) {
  .image-container {
    margin-top: 3rem;
  }
}

.social-nav {
  margin-bottom: 25px;
}

.social-nav ul {
  display: flex;
  gap: 20px;
  padding: 0;
}

.social-nav .nav-item {
  list-style: none;
}

.social-icon {
  color: #5c5f77;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  padding: 5px;
}

.social-icon:hover {
  color: #04a5e5;
  transform: translateY(-2px);
}

.cta-buttons {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: none;
  color: var(--primary-white);
}

.btn-outline-primary {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(133, 105, 255, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--primary-white);
}



/*skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  position: relative;
  background-color: #ffffff;
  color: var(--primary-blue);
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--card-color);
}

.skill-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.skill-icon-wrapper {
  background: var(--card-color);
  border-radius: 50%;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.skill-icon {
  width: 60px;
  height: 60px;
  filter: brightness(0) invert(1);
}

.skill-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #4c4f69;
  text-align: center;
}

.skill-card:hover {
  transform: translateY(-10px) rotate(2deg);
  box-shadow: 0 15px 30px rgba(76, 79, 105, 0.2);
}

.skill-card:hover .skill-icon-wrapper {
  transform: scale(1.1) rotate(-5deg);
}

/*experience */

.experience-card {
  width: 100%;
  box-shadow: 0 5px 15px rgba(76, 79, 105, 0.1);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-wrap: wrap;
}

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

.experience-card-inner {
  display: flex;
  flex-grow: 1;
}

.logo-container {
  width: 25%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #f0f0f0;
}

.company-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.experience-info {
  flex-grow: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.experience-title {
  font-size: 1.3rem;
  color: #4c4f69;
  font-weight: 600;
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.experience-company,
.experience-date {
  font-size: 0.9rem;
  display: block;
}

.arrow {
  display: flex;
  align-items: center;
  padding-right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}

.experience-details {
  padding: 15px;
  background-color: #eff1f5;

}





/* projects */

.masonry-layout {
  position: relative;
  margin: -15px;
  padding: 0;

}

.masonry-item {
  width: 100%;
  padding: 10px;
  margin: 0;
}

@media (min-width: 576px) {
  .masonry-item {
    width: 50%;
  }
}

@media (min-width: 768px) {
  .masonry-item {
    width: 33.333%;
  }
}

@media (min-width: 992px) {
  .masonry-item {
    width: 25%;
  }
}

.project.card {
  border-radius: 15px;
  transition: transform 400ms;
  background-color: #eff1f5;
  overflow: hidden;
  border: 1px solid #ccd0da;
  height: 100%;

}


.project.card:hover:not(.post) {
  transform: translateY(-8px);
  box-shadow: -2px 8px 40px -12px rgba(76, 79, 105, 0.24);
}

.project.card .card-img-top {
  border-radius: 15px 15px 0 0;
}

.card-title:hover {
  text-decoration: underline;
  cursor: pointer;
}

.project.card a {
  color: var(--primary-light-blue);
  text-decoration: none;

}

.card-tags {
  display: inline-block;
  margin-right: 0.2rem;
  background-color: rgba(204, 208, 218, 0.9);
  color: #4c4f69;
  transition: background-color 0.15s ease-in-out;
  padding-top: 0;
  margin-top: 0;
}

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


/* Animation */
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  opacity: 0;
}

/* @keyframes fade-left {
  from {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
} */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* @keyframes zoom-in {
  from {
    opacity: 0;
    transform: scale3d(0.9, 0.9, 0.9);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
} */

/* .fade-left {
  animation-name: fade-left;
} */

.fade-up {
  animation-name: fade-up;
  animation-duration: 1s;
  animation-fill-mode: both;
}

/* .zoom-in {
  animation-name: zoom-in;
} */

@keyframes fadeUpSequential {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up-sequential.animate {
  animation: fadeUpSequential 0.5s ease-out forwards;
}

/* @keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
} */

/* .animated.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
} */


/* Blog */
.blog-showcase {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background: var(--bg-light-gray);
}

.blog-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--bg-white);
  border-radius: 8px;
  padding: 0.5rem;
}

.search-bar {
  display: flex;
  flex-grow: 1;
  margin-right: 1rem;
}

.search-bar input {
  flex-grow: 1;
  border: none;
  background: transparent;
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--text-dark);
}

.search-bar button,
.tag-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-medium);
  transition: color 0.3s ease;
}

.search-bar button:hover,
.tag-button:hover {
  color: var(--primary-blue);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}



.blog-item {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.blog-item:nth-child(n) {
  animation-delay: calc(0.1s * var(--item-index));
}

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

.blog-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-light-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.blog-item:hover::before {
  transform: scaleX(1);
}

.blog-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #4c4f69;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.blog-tag {
  font-size: 0.75rem;
  color: var(--primary-white);
  background: var(--primary-blue);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}



.blog-description {
  font-size: 0.9rem;
  color: var(--text-medium);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.blog-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.blog-date {
  display: flex;
  justify-content: left;
  font-size: 0.8rem;
  color: var(--text-medium);
  position: absolute;
  bottom: 1rem;
  padding-top: 1rem;
  margin-top: 1rem;
}

.blog-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  gap: 0.5rem;
}

.pagination-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.pagination-link:hover,
.pagination-link.active {
  background-color: var(--primary-blue);
  color: var(--primary-white);
}

@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Featured Posts Carousel */
.featured-carousel-section {
  margin-bottom: 4rem;
  padding-top: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border-radius: 3px;
}

/* Carousel Container */
.carousel-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  padding: 0 60px;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.carousel-inner {
  display: flex;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Carousel Items */
.carousel-item {
  flex: 0 0 400px;
  margin: 0 15px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transform: scale(0.85);
  opacity: 0.6;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.carousel-item.active {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(76, 79, 105, 0.9) 10%, rgba(76, 79, 105, 0.3) 50%, transparent 70%);
  z-index: 0;
  transition: background 0.8s ease;
}

.carousel-item:hover::before {
  background: linear-gradient(to top, rgba(30, 102, 245, 0.9) 10%, rgba(30, 102, 245, 0.3) 50%, transparent 70%);
}

.slide-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item.active .slide-content {
  transform: translateY(0);
}

.slide-content h2 {
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-white);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slide-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e6e9ef;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.slide-content a {
  display: inline-block;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  background: var(--primary-white);
  color: var(--primary-blue);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slide-content a:hover {
  background: var(--primary-blue);
  color: var(--primary-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 102, 245, 0.3);
}

.carousel-description {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  -webkit-line-clamp: 3;
}

.carousel-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.2);
  color: var(--primary-white);
  border-radius: 20px;
  margin-bottom: 1rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.carousel-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.carousel-links a {
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
}

/* Controls */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--primary-blue);
}

.carousel-control:hover {
  background: var(--primary-blue);
  color: var(--primary-white);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(30, 102, 245, 0.3);
}

.carousel-control.prev {
  left: 10px;
}

.carousel-control.next {
  right: 10px;
}

/* Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 2rem;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(76, 79, 105, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator:hover {
  background: rgba(76, 79, 105, 0.5);
  transform: scale(1.2);
}

.indicator.active {
  background: var(--primary-blue);
  transform: scale(1.3);
}

/* Responsive */
@media (max-width: 768px) {
  .carousel-container {
    padding: 0 40px;
  }
  
  .carousel-item {
    flex: 0 0 280px;
    margin: 0 10px;
  }
  
  .carousel-control {
    width: 40px;
    height: 40px;
  }
  
  .carousel-control.prev {
    left: 5px;
  }
  
  .carousel-control.next {
    right: 5px;
  }
  
  .slide-content {
    padding: 1.5rem;
  }
  
  .slide-content h2 {
    font-size: 1.2rem;
  }
  
  .slide-content p {
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .carousel-item {
    flex: 0 0 340px;
  }
}

@media (min-width: 1024px) {
  .carousel-item {
    flex: 0 0 420px;
  }
}




/* blog post */
.blog-post {
  padding-top: 5rem;
  padding-bottom: 2rem;
}

.post-header {
  text-align: center;
  margin-bottom: 3rem;
}

.post-title {
  font-size: clamp(2.2rem, 5vw + 1rem, 3.5rem);
  color: #1e66f5;
  margin: 3rem 0 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  animation: titleFadeIn 0.6s ease-out;
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-meta {
  font-size: 0.9rem;
  color: #5c5f77;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-title+.tagline {
  color: #666;
  font-size: 1.1rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.post-featured-image {
  margin-bottom: 2rem;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-content {
  line-height: 1.8;
  color: #4c4f69;
  font-size: 1.125rem;
}

.post-content p {
  margin-bottom: 1em;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 1.6em;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.post-content img {
  display: block;
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid #ea76cb;
  font-style: italic;
  color: #5c5f77;
}

.post-footer {
  margin-top: 4rem;
  border-top: 1px solid #5c5f77;
  padding-top: 2rem;
}

.share-section {
  margin-bottom: 3rem;
}

.share-text {
  font-size: 0.9rem;
  color: #666;
  display: block;
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-button {
  background-color: #e6e9ef;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #4c4f69;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.share-button:hover {
  background-color: #ccd0da;
  transform: translateY(-2px);
}

.related-posts {
  margin-top: 3rem;
}

.related-posts h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.related-post {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  border-left: 3px solid transparent;
}

.related-post:hover {
  background-color: #f0f0f0;
  border-left-color: #3498db;
  transform: translateX(5px);
}

.related-post-content {
  flex-grow: 1;
}

.related-post h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.related-post:hover h4 {
  color: #3498db;
}

.related-post .post-date {
  font-size: 0.8rem;
  color: #666;
}

.related-post-arrow {
  font-size: 1.2rem;
  opacity: 0;
  transition: all 0.3s ease;
}

.related-post:hover .related-post-arrow {
  opacity: 1;
  transform: translateX(5px);
}

@media (max-width: 768px) {
  .blog-post {
    padding-top: 3rem;
    padding-bottom: 2rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .blog-post {
    padding-top: 5rem;
    padding-bottom: 2rem;
  }
}


[data-align="center"] {
  text-align: center;
  display: block;
  margin: 0 auto;
}

/* code Box */

.code-block {
  position: relative;
  margin: 2em 0;
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  border-radius: 10px;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px;
  padding: 5px 10px;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: small;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #8ac7ff;
}

.copy-button.copied {
  background: #4caf50;
  color: white;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

pre {
  margin: 0;
  padding: 3em 1.5em 1.5em;
  overflow-x: auto;
}


/* Navbar */
#mainNav {
  transition: background-color 0.3s ease-in-out, padding 0.3s ease-in-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1010;
}

#mainNav:not(.navbar-shrink) {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-shrink {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.8rem;
}

.brand-text {
  background: linear-gradient(45deg, #dc8a78, #ea76cb, #04a5e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  transition: all 0.3s ease;
}

.navbar-brand:hover .brand-text {
  transform: scale(1.05);
}

.navbar-nav .nav-item {
  position: relative;
}

.navbar-nav .nav-link {
  color: #333;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: linear-gradient(90deg, #dc8a78, #ea76cb, #04a5e5);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-item.active .nav-link::after {
  width: 80%;
}

.navbar-toggler {
  position: relative;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler:hover {
  transform: scale(1.05);
}

.navbar-toggler:focus {
  outline: none;
}

/* Custom hamburger menu with animation */
.navbar-toggler-icon {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
  top: -8px;
}

.navbar-toggler-icon::after {
  top: 8px;
}

/* Transform to X when active */
.navbar-toggler.active .navbar-toggler-icon {
  background: transparent;
}

.navbar-toggler.active .navbar-toggler-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.navbar-toggler.active .navbar-toggler-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Desktop collapse behavior */
@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
  }

  .navbar-toggler {
    display: none;
  }
}

/* Mobile collapse behavior */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: 60px;
    right: -300px;
    width: 280px;
    height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 2rem 1.5rem;
    overflow-y: auto;
  }

  .navbar-collapse.show {
    right: 0;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .navbar-nav .nav-item {
    width: 100%;
  }

  .navbar-nav .nav-link {
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    width: 100%;
    background: transparent;
  }

  .navbar-nav .nav-link:hover {
    background: rgba(30, 102, 245, 0.05);
    transform: translateX(4px);
  }

  .navbar-nav .nav-link::after {
    display: none;
  }

  /* Dark overlay when menu is open */
  .navbar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
  }

  .navbar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Additional mobile menu styling */
@media (max-width: 991.98px) {
  /* Add subtle entrance animation */
  .navbar-collapse .nav-item {
    opacity: 0;
    transform: translateX(20px);
    animation: slideInNav 0.3s ease forwards;
  }

  .navbar-collapse.show .nav-item:nth-child(1) { animation-delay: 0.1s; }
  .navbar-collapse.show .nav-item:nth-child(2) { animation-delay: 0.15s; }
  .navbar-collapse.show .nav-item:nth-child(3) { animation-delay: 0.2s; }
  .navbar-collapse.show .nav-item:nth-child(4) { animation-delay: 0.25s; }

  @keyframes slideInNav {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Add subtle gradient background */
  .navbar-collapse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg,
      rgba(220, 138, 120, 0.05),
      rgba(234, 118, 203, 0.05),
      rgba(4, 165, 229, 0.05)
    );
    pointer-events: none;
  }
}

/* 404 page */
.error-page-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff1f5, #e6e9ef);
}

.error-content {
  text-align: center;
  background-color: #ffffff;
  color: #4c4f69;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 80%;
}

.glitch-wrapper {
  color: #7287fd;
}

.error-content p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  color: #333;
}

.error-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #1e66f5;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.error-btn:hover {
  background-color: #7287fd;
}




/* Resume */

/* Blog Post Improvements */

/* Blog post wrapper for TOC layout */
.blog-post-wrapper {
  display: flex;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  gap: 3rem;
}

/* Center content when no sidebar */
.blog-post-wrapper:not(.has-sidebar) {
  justify-content: center;
}

.blog-post-wrapper:not(.has-sidebar) .blog-post {
  max-width: 700px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Table of Contents */
.table-of-contents {
  position: sticky;
  top: 5rem;
  flex-shrink: 0;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  margin-left: 2rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.table-of-contents::-webkit-scrollbar {
  display: none;
}

.table-of-contents.collapsed {
  width: 48px;
}

.table-of-contents-inner {
  background: linear-gradient(135deg, rgba(239, 241, 245, 0.6), rgba(230, 233, 239, 0.4));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
}

.table-of-contents h2 {
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.table-of-contents:hover h2 {
  opacity: 1;
}

/* Collapse toggle button - moved outside and always visible */
.toc-toggle-btn {
  position: fixed;
  top: 5rem;
  left: 310px; /* TOC width (280px) + margin (30px) */
  width: 44px;
  height: 44px;
  background: rgba(239, 241, 245, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-medium);
  transition: all 0.15s ease;
  z-index: 10;
  opacity: 0.8;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.toc-toggle-btn:hover {
  opacity: 1;
  background: linear-gradient(135deg, rgba(30, 102, 245, 0.08), rgba(4, 165, 229, 0.05));
  border-color: rgba(30, 102, 245, 0.2);
  color: var(--primary-blue);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(30, 102, 245, 0.1);
}

.toc-toggle-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease;
}

.blog-post-wrapper.has-sidebar.toc-collapsed .toc-toggle-btn {
  left: 80px; /* Collapsed width (48px) + margin (32px) */
}

.blog-post-wrapper.has-sidebar.toc-collapsed .toc-toggle-btn svg {
  transform: rotate(180deg);
}

/* Remove old button from header */
.toc-collapse-btn {
  display: none;
}

#toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#toc-list li {
  margin-bottom: 0;
  opacity: 0;
  animation: tocItemFade 0.4s ease forwards;
}

@keyframes tocItemFade {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#toc-list li:nth-child(1) { animation-delay: 0.05s; }
#toc-list li:nth-child(2) { animation-delay: 0.1s; }
#toc-list li:nth-child(3) { animation-delay: 0.15s; }
#toc-list li:nth-child(4) { animation-delay: 0.2s; }
#toc-list li:nth-child(5) { animation-delay: 0.25s; }
#toc-list li:nth-child(6) { animation-delay: 0.3s; }
#toc-list li:nth-child(7) { animation-delay: 0.35s; }
#toc-list li:nth-child(8) { animation-delay: 0.4s; }

#toc-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-medium);
  font-size: 0.875rem;
  line-height: 1.4;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

#toc-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-light-blue));
  border-radius: 3px;
  transition: height 0.3s ease;
}

#toc-list a.h3 {
  padding-left: 1.75rem;
  font-size: 0.8125rem;
  opacity: 0.8;
}

#toc-list a:hover {
  background: rgba(30, 102, 245, 0.05);
  color: var(--primary-blue);
  transform: translateX(2px);
}

#toc-list a.active {
  background: rgba(30, 102, 245, 0.08);
  color: var(--primary-blue);
  font-weight: 500;
}

#toc-list a.active::before {
  height: 70%;
}




/* Glass morphism effect on hover */
.table-of-contents:hover .table-of-contents-inner {
  background: linear-gradient(135deg, rgba(244, 246, 248, 0.7), rgba(237, 240, 244, 0.5));
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* Collapsed indicator button */
.toc-expand-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.table-of-contents.collapsed .toc-expand-indicator {
  opacity: 1;
  pointer-events: all;
}

.toc-expand-indicator:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toc-expand-indicator svg {
  width: 16px;
  height: 16px;
  color: var(--text-medium);
}

/* Mobile Contents button */
.toc-mobile-button {
  display: none;
  margin: 2rem auto;
  padding: 12px 24px;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 50px;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toc-mobile-button:hover {
  background: rgba(30, 102, 245, 0.05);
  border-color: rgba(30, 102, 245, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toc-mobile-button svg {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.toc-mobile-button.active svg {
  transform: rotate(180deg);
}

/* Mobile bottom sheet */
.toc-mobile-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.toc-mobile-sheet::-webkit-scrollbar {
  display: none;
}

.toc-mobile-sheet.open {
  transform: translateY(0);
}

.toc-mobile-sheet-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-mobile-sheet-close {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-medium);
  transition: all 0.2s ease;
}

.toc-mobile-sheet-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.toc-mobile-sheet-content {
  padding: 1rem;
}

.toc-mobile-sheet-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.toc-mobile-sheet-content a:hover {
  background: rgba(30, 102, 245, 0.05);
  color: var(--primary-blue);
}

.toc-mobile-sheet-content a.active {
  background: rgba(30, 102, 245, 0.1);
  color: var(--primary-blue);
  font-weight: 500;
}

/* Mobile styles */
@media (max-width: 767px) {
  .blog-post-wrapper {
    padding: 1rem;
  }

  /* Hide sidebar and toggle on mobile */
  .table-of-contents,
  .toc-toggle-btn {
    display: none !important;
  }

  /* Show mobile button */
  .toc-mobile-button {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Enable mobile sheet */
  .toc-mobile-sheet {
    display: block;
  }

  /* Center content on mobile */
  .blog-post-wrapper.has-sidebar .blog-post {
    max-width: 100%;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Hide toggle button initially on tablets */
  .toc-toggle-btn {
    opacity: 0.5;
  }

  .toc-toggle-btn:hover {
    opacity: 1;
  }
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.reading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Enhanced Typography with Vertical Rhythm */
.post-content {
  line-height: 1.6;
  color: var(--text-dark);
  font-size: 1.125rem;
}

.post-content p {
  margin-bottom: 1em;
}

.post-content h2,
.post-content h3 {
  margin-top: 2em;
  margin-bottom: 1rem;
  line-height: 1.3;
  scroll-margin-top: 80px;
  /* Account for sticky header */
}

/* Responsive Images */
.post-content img,
.post-content figure img {
  display: block;
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease;
  opacity: 1;
}

.post-content figure {
  margin: 0;
  text-align: center;
}

.post-content figcaption {
  font-size: 0.875rem;
  color: var(--text-medium);
  margin-top: 0.5rem;
  font-style: italic;
}

.post-content img.loading {
  opacity: 0;
}

/* Full-width hero image */
.post-hero-image {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: none;
  margin-top: 0;
  margin-bottom: 3rem;
}

.post-hero-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: 0;
}

/* Callout Boxes */
.callout {
  background: #eef5ff;
  border-left: 4px solid #0d47a1;
  padding: 1rem 1.25rem;
  margin: 2em 0;
  border-radius: 0 8px 8px 0;
  font-size: 1rem;
}

.callout-success {
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

.callout-warning {
  background: #fff3e0;
  border-left-color: #ef6c00;
}

.callout-error {
  background: #ffebee;
  border-left-color: #c62828;
}

.callout-info {
  background: #e3f2fd;
  border-left-color: #0277bd;
}

/* Keyboard shortcut hint */
.keyboard-hint {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.keyboard-hint.show {
  opacity: 1;
}

.keyboard-hint kbd {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.3);
}


/* Code block improvements */
.post-content pre {
  margin: 2em 0;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content code {
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--bg-light-gray);
  border-radius: 3px;
}

.post-content pre code {
  padding: 0;
  background: none;
}

/* Better blockquote styling */
.post-content blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--accent-blue);
  background: rgba(32, 159, 181, 0.05);
  font-style: italic;
  color: var(--text-medium);
  border-radius: 0 8px 8px 0;
}

/* Link styling within posts */
.post-content a {
  color: var(--primary-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.post-content a:hover {
  border-bottom-color: var(--primary-blue);
}

/* Adjust main blog content for TOC */
.blog-post {
  flex: 1;
  min-width: 0;
  /* Prevent flex item from overflowing */
}


@media (min-width: 1025px) {
  .blog-post.container-narrow {
    padding-left: 0;
    padding-right: 0;
    max-width: 800px;
  }
}

/* RTL Support for Blog Posts */
.rtl-content {
  direction: rtl;
  text-align: right;
}

.rtl-content .post-header {
  direction: rtl;
  text-align: center; /* Center title and meta for RTL */
}

.rtl-content .post-title {
  text-align: center;
  margin-bottom: 1rem;
}

.rtl-content .post-meta {
  text-align: center;
  direction: rtl;
}

.rtl-content .post-content {
  direction: rtl;
  text-align: right;
}

/* RTL adjustments for lists */
.rtl-content ul,
.rtl-content ol {
  padding-right: 2.5rem;
  padding-left: 0;
}

.rtl-content li {
  margin-right: 0;
}

/* RTL adjustments for blockquotes */
.rtl-content blockquote {
  border-left: none;
  border-right: 4px solid var(--primary-blue);
  padding-left: 0;
  padding-right: 1.5rem;
}

/* RTL adjustments for code blocks */
.rtl-content pre {
  direction: ltr; /* Code should remain LTR */
  text-align: left;
}

.rtl-content code {
  direction: ltr;
}

/* RTL adjustments for images and captions */
.rtl-content figcaption {
  text-align: center;
}

/* RTL adjustments for tables */
.rtl-content table {
  direction: rtl;
}

.rtl-content th,
.rtl-content td {
  text-align: right;
}

/* Keep header and footer LTR as requested */
.blog-post-wrapper nav.navbar,
.blog-post-wrapper > footer {
  direction: ltr !important;
  text-align: left !important;
}

/* RTL adjustments for TOC when in RTL mode */
.blog-post-wrapper.has-sidebar .rtl-content ~ #toc #toc-list a {
  padding-left: 0.75rem;
  padding-right: 1.5rem;
}

.blog-post-wrapper.has-sidebar .rtl-content ~ #toc #toc-list a::before {
  right: 0;
  left: auto;
}

.blog-post-wrapper.has-sidebar .rtl-content ~ #toc #toc-list a:hover {
  transform: translateX(-2px);
}

/* Ensure headings in RTL content align properly */
.rtl-content h1,
.rtl-content h2,
.rtl-content h3,
.rtl-content h4,
.rtl-content h5,
.rtl-content h6 {
  text-align: right;
}

/* RTL layout adjustments for sidebar */
.blog-post-wrapper.rtl-layout {
  flex-direction: row-reverse;
}

.blog-post-wrapper.rtl-layout #toc {
  left: auto;
  right: 0;
  border-left: 1px solid rgba(226, 232, 240, 0.3);
  border-right: none;
}

.blog-post-wrapper.rtl-layout .toc-toggle-btn {
  left: auto;
  right: 252px;
}

.blog-post-wrapper.rtl-layout.toc-collapsed .toc-toggle-btn {
  right: 20px;
  transform: rotate(180deg);
}

/* Adjust article position when RTL sidebar is present */
.blog-post-wrapper.rtl-layout.has-sidebar .blog-post {
  margin-right: 280px;
  margin-left: 0;
}

@media (max-width: 1024px) {
  .blog-post-wrapper.rtl-layout.has-sidebar .blog-post {
    margin-right: 0;
  }
}

/* RTL adjustments for mobile TOC button */
.rtl-content ~ .toc-mobile-button {
  direction: rtl;
}

/* Update "Copied" feedback for RTL */
.rtl-content ~ .post-footer #copyLink.copied::after {
  content: "تم النسخ!";
}

/* RTL adjustments for share section */
.rtl-content ~ .post-footer .share-section {
  direction: rtl;
  text-align: right;
}

.rtl-content ~ .post-footer .share-buttons {
  direction: rtl;
}

/* RTL adjustments for related posts */
.rtl-content ~ .post-footer .related-posts {
  direction: rtl;
  text-align: right;
}

.rtl-content ~ .post-footer .related-post {
  direction: rtl;
}

.rtl-content ~ .post-footer .related-post-arrow {
  order: -1;
  margin-left: 1rem;
  margin-right: 0;
}
