.tabs-horizontal {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.tab-nav-item {
  flex: 0 0 auto;
  border-right: 1px solid #dee2e6;
}

.tab-nav-item:last-child {
  border-right: none;
}

.tab-button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
  position: relative;
}

.tab-button:hover {
  background-color: #e9ecef;
  color: #212529;
}

.tab-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: -2px;
  z-index: 1;
}

.tab-nav-item.active .tab-button {
  background-color: #fff;
  color: #0066cc;
  border-bottom: 3px solid #0066cc;
  margin-bottom: -2px;
}

.tabs-content {
  position: relative;
}

.tab-panel {
  padding: 1.5rem;
  display: none;
}

.tab-panel.active {
  display: block;
}

.tabs-horizontal[data-tabs-position="bottom"] .tabs-nav {
  order: 2;
  border-bottom: none;
  border-top: 2px solid #dee2e6;
}

.tabs-horizontal[data-tabs-position="bottom"] .tab-nav-item.active .tab-button {
  border-bottom: none;
  border-top: 3px solid #0066cc;
  margin-bottom: 0;
  margin-top: -2px;
}

@media (max-width: 768px) {
  .tabs-nav {
    flex-wrap: wrap;
  }
  
  .tab-nav-item {
    flex: 1 1 auto;
    min-width: 100px;
  }
  
  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .tab-panel {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .tab-nav-item {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }
  
  .tab-nav-item:last-child {
    border-bottom: none;
  }
}

@media print {
  .tabs-nav {
    display: none;
  }
  
  .tab-panel {
    display: block !important;
    page-break-inside: avoid;
    border-top: 1px solid #ddd;
    margin-top: 1rem;
  }
  
  .tab-panel::before {
    content: attr(data-tab-title);
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
}

.tab-panel.active {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel[aria-hidden="true"] {
  display: none;
}