/**
 * PatriotCompass Admin Console - Tabbed Interface
 * 
 * Professional tab navigation using the design system.
 * This file handles tab navigation for the Extension section.
 * 
 * Components:
 * 1. Tab Navigation
 * 2. Tab Content
 * 3. Tab Animations
 */

/* ============================================
   1. TAB NAVIGATION
   ============================================ */

.tab-navigation {
  background: var(--patriot-white);
  border-bottom: 2px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-8);
}

.tab-nav-list {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
}

/* Custom scrollbar for horizontal scroll */
.tab-nav-list::-webkit-scrollbar {
  height: 3px;
}

.tab-nav-list::-webkit-scrollbar-track {
  background: transparent;
}

.tab-nav-list::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: var(--radius-full);
}

.tab-nav-list::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* Tab Button */
.tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--slate-600);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-colors);
  position: relative;
}

.tab-button:hover {
  color: var(--patriot-blue);
  background: var(--slate-50);
}

.tab-button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--patriot-blue);
}

.tab-button.active {
  color: var(--patriot-blue);
  border-bottom-color: var(--patriot-blue);
  font-weight: var(--font-semibold);
}

/* Tab Icon */
.tab-icon {
  font-size: var(--text-xl);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tab Badge (for counts) */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  background: var(--slate-200);
  color: var(--slate-700);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  transition: var(--transition-colors);
}

.tab-button.active .tab-badge {
  background: var(--patriot-blue);
  color: var(--patriot-white);
}

.tab-button:hover .tab-badge {
  background: var(--patriot-blue-light);
  color: var(--patriot-white);
}


/* ============================================
   2. TAB CONTENT
   ============================================ */

.tab-content {
  display: none;
  animation: fadeInTab var(--duration-base) var(--ease-in-out);
}

.tab-content.active {
  display: block;
}

/* Tab Content Wrapper */
.tab-content-wrapper {
  padding: var(--space-6) 0;
}

/* Tab Section */
.tab-section {
  margin-bottom: var(--space-8);
}

.tab-section:last-child {
  margin-bottom: 0;
}

.tab-section-header {
  margin-bottom: var(--space-6);
}

.tab-section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--slate-700);
  margin-bottom: var(--space-2);
}

.tab-section-description {
  font-size: var(--text-sm);
  color: var(--slate-500);
  line-height: var(--leading-relaxed);
}


/* ============================================
   3. TAB ANIMATIONS
   ============================================ */

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading State */
.tab-content-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  color: var(--slate-400);
}

.tab-content-loading .spinner {
  margin-right: var(--space-3);
}

/* Empty State */
.tab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  text-align: center;
}

.tab-empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.tab-empty-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--slate-700);
  margin-bottom: var(--space-2);
}

.tab-empty-description {
  font-size: var(--text-base);
  color: var(--slate-500);
  margin-bottom: var(--space-6);
  max-width: 400px;
}


/* ============================================
   4. RESPONSIVE BEHAVIOR
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .tab-button {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }
  
  .tab-icon {
    font-size: var(--text-lg);
    width: 20px;
    height: 20px;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .tab-navigation {
    margin-bottom: var(--space-6);
  }
  
  .tab-button {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }
  
  /* Hide text on mobile, show only icons */
  .tab-button-text {
    display: none;
  }
  
  .tab-icon {
    margin: 0;
  }
  
  /* Show text on active tab */
  .tab-button.active .tab-button-text {
    display: inline;
  }
  
  .tab-content-wrapper {
    padding: var(--space-4) 0;
  }
  
  .tab-section {
    margin-bottom: var(--space-6);
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
  .tab-button {
    padding: var(--space-2) var(--space-3);
  }
  
  .tab-icon {
    font-size: var(--text-base);
    width: 18px;
    height: 18px;
  }
}


/* ============================================
   5. ACCESSIBILITY
   ============================================ */

/* Keyboard navigation */
.tab-button:focus-visible {
  outline: 2px solid var(--patriot-blue);
  outline-offset: -2px;
  z-index: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tab-content {
    animation: none;
  }
  
  .tab-button {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .tab-button {
    border: 1px solid currentColor;
  }
  
  .tab-button.active {
    background: var(--patriot-blue);
    color: var(--patriot-white);
  }
}
