.custom-tabs {
  width: 100%;
  margin: 20px 0;
  position: relative;
}

/* Navigation arrows container */
.tabs-nav-arrows {
  display: none;
}

/* Navigation arrows */
.tab-arrow {
  display: none; /* Hidden by default */
  width: 40px;
  height: 40px;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  color: #666;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
}

.tab-arrow svg {
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.tab-arrow:hover {
  border-color: #007bff;
  color: #007bff;
  background-color: #f8f9fa;
  transform: scale(1.05);
}

.tab-arrow:active {
  transform: scale(0.95);
}

.tab-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.tab-arrow.disabled:hover {
  border-color: #e0e0e0;
  color: #666;
  background-color: #fff;
  transform: none;
}

/* Show arrows on mobile when scrollable */
@media (max-width: 768px) {
  .tabs-nav-arrows.show-arrows .tab-arrow {
    display: flex;
  }

  .tabs-nav-arrows {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    justify-content: flex-start;
  }
}

.tabs-nav {
  display: flex;
  flex-flow: nowrap !important;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
  position: relative;
}

.tabs-nav::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.95), transparent);
}

.tabs-nav::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
}

/* Show indicators when scrollable */
.tabs-nav.scroll-left::before,
.tabs-nav.scroll-right::after {
  opacity: 1;
}

/* Add arrow indicators */
.tabs-nav.scroll-left::before {
  background: linear-gradient(to right, rgba(255,255,255,0.95), transparent),
              url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%23666" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>') no-repeat center left 8px;
}

.tabs-nav.scroll-right::after {
  background: linear-gradient(to left, rgba(255,255,255,0.95), transparent),
              url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%23666" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>') no-repeat center right 8px;
}

.tab-button {
  background: transparent;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  margin-right: 10px;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0; /* Prevent buttons from shrinking */
  white-space: nowrap; /* Prevent text wrapping */
}

.tab-button:hover {
  background-color: #f5f5f5;
  color: #333;
}

.tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #f8f9fa;
}

.tab-content {
  display: none;
  padding: 20px;
  background-color: #fff;
  border-radius: 0 8px 8px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-height: 100px;
}

.tab-content.active {
  display: flex;
  animation: fadeIn 0.3s ease-in;
}

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

/* Responsive */
@media (max-width: 768px) {
  .tabs-nav {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 10px;
    margin-bottom: 10px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Ensure single row layout */
    flex-wrap: nowrap;
    align-items: center;
  }
  
  .tabs-nav.dragging {
    cursor: grabbing;
    scroll-behavior: auto; /* Disable smooth scrolling during drag */
  }
  
  .tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
  
  .tab-button {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: auto;
    padding: 10px 16px;
    margin-right: 8px;
    margin-bottom: 0;
    border-radius: 20px;
    border-bottom: 2px solid transparent;
    border-left: none;
    font-size: 14px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none; /* Prevent default touch behaviors */
  }
  
  .tabs-nav.dragging .tab-button {
    pointer-events: none; /* Prevent clicks during drag */
  }
  
  .tab-button:first-child {
    margin-left: 16px; /* Extra margin for first button to ensure proper scroll */
  }
  
  .tab-button:last-child {
    margin-right: 16px; /* Extra margin for last button to ensure proper scroll */
  }
  
  .tab-button.active {
    background-color: #007bff;
    color: #fff;
    border-bottom-color: #007bff;
    border-left-color: transparent;
  }
  
  .tab-button:hover {
    background-color: #e3f2fd;
    color: #007bff;
  }
  
  .tab-button.active:hover {
    background-color: #0056b3;
    color: #fff;
  }
}

/* Desktop styles remain the same */
@media (min-width: 769px) {
  .tabs-nav {
    cursor: default;
    /* Enable horizontal scroll on desktop if needed */
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  
  .tabs-nav::-webkit-scrollbar {
    height: 6px;
  }
  
  .tabs-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .tabs-nav::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }
  
  .tabs-nav::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
}
