/* Style for active menu item */
.item.active-item {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: bold;
  border-left: 3px solid #3eb0ef; /* Add a left border for better visual indication */
  padding-left: 7px; /* Adjust padding to account for the border */
}

.item {
  cursor: pointer;
  transition: all 0.3s ease; /* Change from background-color to all for smoother transitions */
  padding-left: 10px; /* Add padding for all items to prevent layout shift when active */
  border-left: 3px solid transparent; /* Transparent border for inactive items */
  margin-bottom: 8px; /* Add spacing between items */
}

.item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Active state for the arrow icon */
.item.active-item .arrow-right,
.item.active-item .arrow-right2 {
  transform: rotate(90deg); /* Rotate arrow when active */
  transition: transform 0.3s ease;
}

.arrow-right,
.arrow-right2 {
  transition: transform 0.3s ease;
}

/* Simplified fixed menu layout */
.wrapper {
  display: flex;
  position: relative;
  margin: 0 auto;
  padding: 20px;
}

/* Fixed column styles */
.column {
  width: 240px;
  flex-shrink: 0; /* Prevent column from shrinking */
  transition: transform 0.2s ease-out;
}

.column-fixed {
  transform: translateY(0);
  will-change: transform;
}

.menu {
  position: relative;
  top: 0;
  padding: 0 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  height: fit-content;
  width: 100%;
  overflow: hidden;
  z-index: 100;
  /* Improved transition properties */
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  transform: translateY(0);
  will-change: transform, box-shadow;
}

.menu-transition {
  /* Better easing function for smoother motion */
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              background-color 0.3s ease;
}

.menu-fixed {
  position: fixed;
  top: 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  background-color: rgba(255, 255, 255, 0.98);
  /* Add subtle animation when becoming fixed */
  animation: menuFixedAppear 0.3s forwards;
  /* Ensure smooth borders with anti-aliasing */
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Animation for menu appearance when fixed */
@keyframes menuFixedAppear {
  from {
    transform: translateY(-10px);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Improved scrolling animation performance */
@media (prefers-reduced-motion: no-preference) {
  .menu-fixed {
    transform: translateZ(0);
  }
}

.content-container {
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing */
  overflow-y: auto; /* Allow vertical scrolling */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  width: 100%; /* Ensure content container takes available width */
}

/* Keyframe animation for active item click effect */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Menu styling */
.menu-title {
  font-size: 16px;
  font-weight: 600;
  color: #15171a;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eaeaea;
}

.menu-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  color: #48515d;
  text-decoration: none;
  transition: color 0.2s ease;
  border-left: 2px solid transparent;
  padding-left: 8px;
}

.menu-item:hover {
  color: #3eb0ef;
}

.menu-icon {
  margin-right: 8px;
}

.menu-icon img {
  width: 8px;
  height: 8px;
  transition: transform 0.2s ease;
}

.menu-text {
  font-size: 14px;
  font-weight: 500;
}

.menu-item.active-item {
  color: #3eb0ef;
  border-left: 2px solid #3eb0ef;
}

.menu-item.active-item .menu-icon img {
  transform: rotate(90deg);
}

/* Simplified styling for content blocks */
.content-row {
  margin-bottom: 40px;
}

.block {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 16px;
  gap: 4px;
}

.title3 {
  font-size: 18px;
  font-weight: 600;
  color: #15171a;
  position: relative;
}

/* Expert profile containers */
.expert-profile {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Expert avatar section */
.expert-avatar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.avatar-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
}

.expert-info {
  flex: 1;
}

.expert-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: #333;
}

.expert-title {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Audio container styles - basic layout that gets enhanced by audio-player.css */
.audio-container {
  width: 100%;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 12px 0;
  position: relative;
}
.audio-container audio {
  max-width: 400px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .wrapper {
    flex-direction: column;
    padding: 10px;
  }
  
  .column {
    width: 100%;
    margin-right: 0;
    padding: 0 10px;
  }
  
  .menu {
    position: relative;
    top: 0;
    gap: 32px;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .menu-container {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .menu-item {
    margin: 5px 0;
  }
  
  .menu-icon img {
    width: 20px;
    height: 20px;
  }
  
  .menu-text {
    font-size: 14px;
  }
}

/* Tablet-specific styles */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .wrapper {
    flex-direction: column;
    padding: 10px;
  }
  
  .column {
    width: 100%;
    margin-bottom: 15px;
    padding: 0px 16px;
  }
  
  /* Content container and columns layout */
  .content-container {
    display: flex;
    flex-direction: column;
  }
  
  .content-row {
    flex-direction: column;
    display: flex;
  }
  
  /* Move summary sidebar before content */
  .content-row:first-of-type .column3.summary-sidebar {
    order: -1;
    margin-bottom: 20px;
  }
  
  /* General column styling */
  .column2, .column3 {
    width: 100%;
    margin-right: 0;
  }
  
  .column3 {
    padding-left: 0;
    margin-top: 20px;
  }
  
  /* Expert profile adjustments for tablet */
  .expert-profile {
    flex-direction: row;
    align-items: center;
    padding: 12px;
  }
  
  /* Adjust expert avatar to take up 50% of space */
  .expert-profile .expert-avatar {
    width: 50%;
    margin-right: 16px;
    margin-bottom: 0;
  }
}

/* Responsive styles for audio sidebars inside content */
@media (max-width: 992px) {
  .summary-sidebar,
  .explanation-sidebar {
    width: 100%;
    padding-left: 0;
    margin-bottom: 20px;
  }
  
  .summary-content .summary-sidebar,
  .explanation-content .explanation-sidebar {
    margin-top: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 20px;
  }
  
  .expert-profile {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding: 8px;
  }
  
  .expert-avatar {
    width: 100%;
    margin-bottom: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .expert-avatar .avatar-image {
    width: 60px;
    height: 60px;
    margin-right: 12px;
  }
  
  .expert-info {
    flex: 1;
  }
  
  .expert-name {
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .expert-title {
    font-size: 12px;
    line-height: 1.4;
  }
}

@media (max-width: 576px) {
  .expert-name {
    font-size: 14px;
    margin-bottom: 2px;
  }
  
  .expert-title {
    font-size: 11px;
    line-height: 1.3;
  }
}

/* Keep desktop layout for larger screens */
@media (min-width: 993px) {
  .summary-content .summary-sidebar,
  .explanation-content .explanation-sidebar {
    display: none;
  }
}
