/**
 * ATHLYTX ELITE COMPONENT STYLES
 * Reusable component library with glassmorphism aesthetic
 * Version: 1.0.0
 */

/* ============================================
   GLASS CARDS
   ============================================ */

.glass-card {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-2),
    transparent
  );
  opacity: 0.5;
}

.glass-card-hover {
  cursor: pointer;
}

.glass-card-hover:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg);
}

.glass-card-elevated {
  background: var(--glass-3);
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
}

.glass-card-elevated:hover {
  background: var(--glass-4);
  border-color: var(--border-3);
  box-shadow: var(--shadow-xl);
}

/* Card variants */
.glass-card-flat {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.glass-card-compact {
  padding: var(--space-4);
}

.glass-card-spacious {
  padding: var(--space-8);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary Button - Brand Gradient */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-md), var(--glow-primary);
  border: 1px solid var(--border-1);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg), var(--glow-brand);
  border-color: var(--border-2);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button - Glass Style */
.btn-secondary {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  color: var(--text-primary);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--glass-3);
  border-color: var(--border-3);
  box-shadow: var(--shadow-md);
}

/* Ghost Button - Transparent */
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--glass-1);
  border-color: var(--border-1);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-2);
}

.btn-outline:hover {
  background: var(--glass-2);
  border-color: var(--color-primary);
}

/* Danger Button */
.btn-danger {
  background: var(--color-error);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: #ff5c52;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--glow-status-danger);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-2xl);
}

/* Icon Button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
}

.btn-icon-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
}

/* Disabled State */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin var(--duration-slow) linear infinite;
}

/* ============================================
   INPUT FIELDS
   ============================================ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.input-field {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.input-field:hover {
  border-color: var(--border-2);
}

.input-field:focus {
  background: var(--glass-3);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Textarea */
.input-field.textarea {
  min-height: 120px;
  resize: vertical;
  padding: var(--space-4);
}

/* Input Sizes */
.input-field-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.input-field-lg {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* Input States */
.input-field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--glass-1);
}

.input-field-error {
  border-color: var(--color-error);
}

.input-field-error:focus {
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.15);
}

.input-field-success {
  border-color: var(--color-success);
}

/* Input Hint Text */
.input-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.input-error-message {
  font-size: var(--text-xs);
  color: var(--color-error);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .input-field {
  padding-left: var(--space-10);
}

.input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.5;
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Status Color Variants */
.status-fresh {
  background: var(--status-fresh-dim);
  color: var(--status-fresh);
}

.status-fresh .status-dot {
  background: var(--status-fresh);
}

.status-optimal {
  background: var(--status-optimal-dim);
  color: var(--status-optimal);
}

.status-optimal .status-dot {
  background: var(--status-optimal);
}

.status-fatigued {
  background: var(--status-fatigued-dim);
  color: var(--status-fatigued);
}

.status-fatigued .status-dot {
  background: var(--status-fatigued);
}

.status-danger {
  background: var(--status-danger-dim);
  color: var(--status-danger);
}

.status-danger .status-dot {
  background: var(--status-danger);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Elite Badge - Premium Gradient */
.badge-elite {
  background: var(--gradient-brand);
  color: var(--text-primary);
  box-shadow: var(--glow-primary);
  border: 1px solid var(--border-2);
}

/* Free Tier Badge */
.badge-free {
  background: var(--glass-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-1);
}

/* Status Badges */
.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info);
}

/* Badge Sizes */
.badge-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-2xs);
}

.badge-lg {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* ============================================
   METRIC CARDS
   ============================================ */

.metric-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  transition: all var(--duration-normal) var(--ease-out);
}

.metric-card:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.metric-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass-2);
  color: var(--color-primary);
}

.metric-value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.metric-change-positive {
  color: var(--color-success);
}

.metric-change-negative {
  color: var(--color-error);
}

.metric-change-neutral {
  color: var(--text-tertiary);
}

.metric-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-1);
}

/* ============================================
   MODALS & DIALOGS
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: var(--z-modal-backdrop);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  z-index: var(--z-modal);
  animation: slideUp var(--duration-moderate) var(--ease-spring);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-1);
  background: var(--glass-1);
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: var(--glass-3);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  max-height: calc(90vh - 200px);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-6);
  border-top: 1px solid var(--border-1);
  background: var(--glass-1);
}

/* Modal Sizes */
.modal-content-sm {
  max-width: 400px;
}

.modal-content-lg {
  max-width: 800px;
}

.modal-content-xl {
  max-width: 1200px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--glass-1) 0%,
    var(--glass-2) 50%,
    var(--glass-1) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 200px;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin var(--duration-slow) linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* Loading Container */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12);
  color: var(--text-secondary);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Alert Variants */
.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.alert-error {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-info);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  max-width: 400px;
  background: var(--bg-layer-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: slideInRight var(--duration-moderate) var(--ease-spring);
  z-index: var(--z-tooltip);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--glass-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-moderate) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s ease-in-out infinite;
}

/* Progress Bar Sizes */
.progress-bar-sm {
  height: 4px;
}

.progress-bar-lg {
  height: 12px;
}

/* ============================================
   DIVIDERS
   ============================================ */

.divider {
  height: 1px;
  background: var(--border-1);
  margin: var(--space-6) 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--border-1);
  margin: 0 var(--space-4);
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-1);
}

/* ============================================
   AVATARS
   ============================================ */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--glass-2);
  border: 2px solid var(--border-2);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar Sizes */
.avatar-xs {
  width: 24px;
  height: 24px;
  font-size: var(--text-2xs);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-base);
}

.avatar-xl {
  width: 80px;
  height: 80px;
  font-size: var(--text-xl);
}

/* Avatar Status Indicator */
.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}

.avatar-status-online {
  background: var(--color-success);
}

.avatar-status-offline {
  background: var(--text-disabled);
}

.avatar-status-busy {
  background: var(--color-error);
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
  position: absolute;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-layer-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  pointer-events: none;
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.tooltip::before {
  content: '';
  position: absolute;
  border: 4px solid transparent;
}

.tooltip-top::before {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--bg-layer-3);
}

.tooltip-bottom::before {
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--bg-layer-3);
}

.tooltip-left::before {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--bg-layer-3);
}

.tooltip-right::before {
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--bg-layer-3);
}

/* ============================================
   TAB NAVIGATION SYSTEM
   ============================================ */

/**
 * Tab Navigation Container
 * Horizontal scrolling layout with glassmorphism aesthetic
 * Mobile-first with centered desktop alignment
 */
.tab-nav {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  position: relative;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.tab-nav::-webkit-scrollbar {
  display: none;
}

/* Tab Navigation Wrapper for Scroll Indicators */
.tab-nav-wrapper {
  position: relative;
  width: 100%;
}

/* Scroll Indicators - Only visible on mobile when scrollable */
.tab-scroll-indicator {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 100%;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-scroll-indicator.left {
  left: 0;
  background: linear-gradient(to right, var(--bg-base) 0%, transparent 100%);
}

.tab-scroll-indicator.right {
  right: 0;
  background: linear-gradient(to left, var(--bg-base) 0%, transparent 100%);
}

.tab-scroll-indicator.visible {
  display: flex;
  opacity: 0.8;
  animation: pulseArrow 2s ease-in-out infinite;
}

.tab-scroll-indicator svg {
  color: rgba(255, 255, 255, 0.7);
  filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.5));
}

@keyframes pulseArrow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Hide scroll indicators on desktop */
@media (min-width: 768px) {
  .tab-scroll-indicator {
    display: none !important;
  }
}

/* Centered layout on desktop */
@media (min-width: 768px) {
  .tab-nav {
    justify-content: center;
    overflow-x: visible;
  }
}

/* Tablet layout */
@media (min-width: 640px) and (max-width: 767px) {
  .tab-nav {
    justify-content: flex-start;
    padding-right: var(--space-6);
  }
}

/**
 * Tab Button Component
 * Pill-shaped buttons with glassmorphism states
 * Smooth transitions and hover effects
 */
.tab-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--text-secondary);
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 300ms var(--ease-default);
  flex-shrink: 0;
}

/* Tab button hover state */
.tab-button:hover {
  color: var(--text-primary);
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Tab button active/selected state */
.tab-button.active,
.tab-button[aria-selected="true"] {
  color: var(--color-primary);
  background: var(--glass-5);
  border-color: var(--border-3);
  box-shadow: var(--shadow-md),
              0 0 20px rgba(102, 126, 234, 0.15),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Subtle glow effect for active tab */
.tab-button.active::before,
.tab-button[aria-selected="true"]::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-full);
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.3),
    rgba(118, 75, 162, 0.2)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms var(--ease-default);
}

.tab-button.active::before,
.tab-button[aria-selected="true"]::before {
  opacity: 1;
}

/* Focus state for accessibility */
.tab-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-full);
}

/* Disabled state */
.tab-button:disabled,
.tab-button[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tab button with icon */
.tab-button-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Tab button sizes */
.tab-button-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  gap: var(--space-1);
}

.tab-button-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  gap: var(--space-3);
}

/**
 * Tab Content Wrapper
 * Container for all tab panels with proper spacing
 */
.tab-content-wrapper {
  position: relative;
  width: 100%;
  min-height: 200px;
  margin-top: var(--space-4);
}

/**
 * Tab Panel Component
 * Individual content panels with fade-in animation
 */
.tab-panel {
  display: none !important;
  width: 100%;
}

/* Active tab panel */
.tab-panel.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Fade-in-up animation for tab panels */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Alternative fade-in animation (no transform) */
.tab-panel.fade-in {
  animation-name: fadeIn;
}

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

/* Tab panel with custom animation class */
.fade-in-up {
  animation: fadeInUp 300ms var(--ease-default) forwards;
}

/**
 * Tab Navigation Variants
 */

/* Compact tab navigation */
.tab-nav-compact {
  padding: var(--space-1);
  gap: var(--space-1);
}

.tab-nav-compact .tab-button {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* Full-width tab navigation on mobile */
.tab-nav-fullwidth .tab-button {
  flex: 1;
  justify-content: center;
}

@media (min-width: 768px) {
  .tab-nav-fullwidth .tab-button {
    flex: initial;
  }
}

/* Vertical tab navigation for sidebar layouts */
.tab-nav-vertical {
  flex-direction: column;
  overflow-x: visible;
  overflow-y: auto;
  max-height: none;
}

.tab-nav-vertical .tab-button {
  justify-content: flex-start;
  border-radius: var(--radius-lg);
}

/* Tab navigation with scroll indicators */
.tab-nav-scrollable {
  position: relative;
}

.tab-nav-scrollable::before,
.tab-nav-scrollable::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: var(--z-raised);
  opacity: 0;
  transition: opacity 300ms var(--ease-default);
}

.tab-nav-scrollable::before {
  left: 0;
  background: linear-gradient(
    to right,
    var(--glass-2),
    transparent
  );
}

.tab-nav-scrollable::after {
  right: 0;
  background: linear-gradient(
    to left,
    var(--glass-2),
    transparent
  );
}

.tab-nav-scrollable.scroll-left::before {
  opacity: 1;
}

.tab-nav-scrollable.scroll-right::after {
  opacity: 1;
}

/**
 * Tab Badge Indicator
 * Small count or notification badge on tab buttons
 */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  line-height: 1;
}

.tab-button .tab-badge {
  margin-left: var(--space-1);
}

/* Badge color variants */
.tab-badge-success {
  background: var(--color-success);
}

.tab-badge-warning {
  background: var(--color-warning);
}

.tab-badge-error {
  background: var(--color-error);
}

/**
 * Responsive Adjustments
 */
@media (max-width: 639px) {
  /* Stack tabs vertically on very small screens if needed */
  .tab-nav-stack-mobile {
    flex-direction: column;
    align-items: stretch;
  }

  .tab-nav-stack-mobile .tab-button {
    width: 100%;
    justify-content: flex-start;
    border-radius: var(--radius-lg);
  }

  /* Reduce padding on mobile */
  .tab-content-wrapper {
    margin-top: var(--space-4);
  }
}

/* Tablet optimizations */
@media (min-width: 640px) and (max-width: 1023px) {
  .tab-button {
    padding: var(--space-3) var(--space-5);
  }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
  .tab-button {
    padding: var(--space-3) var(--space-8);
  }

  /* Smoother hover effects on larger screens */
  .tab-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* ============================================
   ACCOUNT TAB & AUTHENTICATION STYLES
   ============================================ */

/* Account tab - distinct color to stand out */
.account-tab {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.account-tab:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(147, 51, 234, 0.25));
  border-color: rgba(59, 130, 246, 0.5);
}

.account-tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Account view container */
.account-view {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-4);
}

/* Account card */
.account-card {
  padding: var(--space-6);
}

.account-card h2 {
  margin: 0 0 var(--space-4) 0;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.account-card p {
  margin: 0 0 var(--space-6) 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Auth tabs (signup/login switcher) */
.auth-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
}

/* Auth forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.form-group small {
  font-size: 0.75rem;
  line-height: 1.4;
}

.form-helper {
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: -4px;
  transition: color 0.2s ease;
}

/* Auth submit button */
.auth-submit-btn {
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: var(--space-2);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

/* Auth error messages */
.auth-error {
  padding: var(--space-3);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Authenticated user info */
.account-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Logout button */
.logout-btn {
  padding: var(--space-3) var(--space-6);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.logout-btn:active {
  transform: translateY(0);
}

/* Responsive adjustments for auth forms */
@media (max-width: 768px) {
  .account-view {
    padding: var(--space-2);
  }

  .account-card {
    padding: var(--space-4);
  }

  .account-card h2 {
    font-size: 1.5rem;
  }
}

/* ===== Auth Modal Overlay ===== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

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

.auth-modal-container {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.95), rgba(20, 20, 30, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

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

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.auth-modal-content {
    color: #fff;
}

.auth-modal-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal-container {
        padding: 30px 20px;
        max-width: 100%;
        margin: 0 10px;
    }

    .auth-modal-content h2 {
        font-size: 24px;
    }
}
