/* Tab Frame Manager Styles */

.tab-item {
  transition: all 0.2s ease-in-out;
  max-width: 200px;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-item:hover {
  transform: translateY(-1px);
}

.tab-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tab-item button {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.tab-item:hover button {
  opacity: 1;
}

.tab-item button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

/* 活动标签页样式 */
.tab-item.active {
  background-color: rgb(219 234 254) !important;
  color: rgb(29 78 216) !important;
  border-bottom-color: rgb(59 130 246) !important;
}

.tab-item.active button {
  opacity: 1;
}

/* 标签页栏滚动条样式 */
.tab-bar::-webkit-scrollbar {
  height: 4px;
}

.tab-bar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.tab-bar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.tab-bar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* iframe容器样式 */
.frame-container {
  position: relative;
  height: 100%;
}

.frame-container iframe {
  transition: opacity 0.2s ease-in-out;
}

.frame-container iframe.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tab-item {
    min-width: 100px;
    max-width: 150px;
  }
  
  .tab-item span {
    font-size: 0.75rem;
  }
  
  .tab-item button svg {
    width: 0.625rem;
    height: 0.625rem;
  }
}

/* 标签页加载状态 */
.tab-item.loading {
  position: relative;
}

.tab-item.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 标签页关闭按钮动画 */
.tab-item button {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-item button:active {
  transform: scale(0.9);
}

/* 首页标签页特殊样式 */
.tab-item[data-tab-id="home"] button {
  display: none !important;
}

/* 标签页拖拽效果（预留） */
.tab-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.tab-item.drag-over {
  border-left: 2px solid #3b82f6;
}
