/* EchoUI Components - Fixed Navigation & Enhanced Components */

/* Navigation Base - Fixed positioning */
.echo-nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height, 64px);
  background: var(--nav-bg, rgba(255, 255, 255, 0.98));
  border-bottom: 1px solid var(--nav-border, #e5e7eb);
  box-shadow: var(--nav-shadow, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.echo-nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max-width, 1060px);
  margin: 0 auto;
  padding: 0 16px;
}

.echo-nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  text-decoration: none;
  transition: color 200ms ease;
}

.echo-nav-brand:hover {
  color: var(--color-primary, #3b82f6);
}

/* Desktop Navigation Menu */
.echo-nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.echo-nav-item {
  position: relative;
}

.echo-nav-link {
  display: flex;
  align-items: center;
  height: var(--header-height, 64px);
  padding: 0 16px;
  color: var(--nav-link-color, #6b7280);
  text-decoration: none;
  font-weight: 500;
  transition: all 200ms ease;
  border-radius: 6px;
  cursor: pointer;
}


.echo-nav-link:hover {
  color: var(--nav-link-hover, #111827);
  background: var(--bg-secondary, #f9fafb);
}

/* Mega Menu - Based on Stinger Navigation */
.echo-mega-menu { display: none !important; }

.echo-mega-menu::before { content: none !important; }

.echo-nav-item:hover .echo-mega-menu { display: none !important; }

.echo-mega-inner { display: none !important; }

.echo-mega-tabs { display: none !important; }

/* Hide radio buttons */
.mega-tab-radio { display: none !important; }

.mega-tab-button { display: none !important; }

.mega-tab-button:hover {
  color: var(--color-primary, #3b82f6);
  background: var(--bg-primary, white);
}

/* Style active tab based on checked radio button */
.mega-tab-radio:checked + .mega-tab-button {
  color: var(--color-primary, #3b82f6);
  background: var(--bg-primary, white);
}

.mega-tab-radio:checked + .mega-tab-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary, #3b82f6);
}

.echo-mega-content { display: none !important; }

/* Show content based on which radio button is checked */
#mega-tab-ui:checked ~ .echo-mega-inner #mega-ui,
#mega-tab-layout:checked ~ .echo-mega-inner #mega-layout,
#mega-tab-animations:checked ~ .echo-mega-inner #mega-animations { display: none !important; }

.echo-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
}

.echo-mega-section h4 {
  color: var(--text-primary, #333);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 12px;
  padding: 0;
}

.echo-mega-section a {
  display: block;
  color: var(--text-primary, #333);
  text-decoration: none;
  padding: 8px 0;
  transition: all 200ms ease;
}

.echo-mega-section a strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 0;
  transition: color 200ms ease;
  line-height: 1.6;
}

.echo-mega-section a span {
  display: block;
  color: var(--text-muted, #888);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  margin-top: 1px;
}

.echo-mega-section a:hover strong {
  color: var(--color-primary, #3b82f6);
}

/* Standard Dropdown Menu */
.echo-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg, white);
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 200ms ease;
  z-index: var(--z-dropdown, 1000);
  margin-top: 8px;
  padding: 8px;
}

.echo-nav-item:hover .echo-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.echo-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  border-radius: 4px;
  transition: all 200ms ease;
}

.echo-dropdown-menu a:hover {
  color: var(--text-primary, #111827);
  background: var(--bg-secondary, #f9fafb);
}

/* Mobile Navigation - Fixed White Bar Issue */
.mobile-nav-toggle {
  display: none;
}

/* Enhanced hamburger button */
.mobile-nav-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
    border-radius: 6px;
    transition: background-color 200ms ease;
}

.mobile-nav-button:hover {
    background-color: var(--bg-secondary, #f9fafb);
}

.mobile-nav-button span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary, #111827);
    margin: 3px 0;
    transition: all 300ms ease;
    transform-origin: center;
    border-radius: 1px;
}

/* Smooth hamburger animation */
.mobile-nav-toggle:checked + .mobile-nav-button span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-nav-toggle:checked + .mobile-nav-button span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-nav-toggle:checked + .mobile-nav-button span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile navigation fix - Modern Touch-Friendly Design */
.mobile-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 64px);
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid var(--border-primary, #e5e7eb);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: none;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Show mobile menu when toggle is checked */
.mobile-nav-toggle:checked ~ .mobile-nav-menu,
.mobile-nav-toggle:checked + * + * + .mobile-nav-menu {
    display: block;
    animation: slideDown 300ms ease-out;
}

/* Modern mobile menu content styling */
.mobile-nav-menu .echo-nav-menu {
    display: flex !important;
    flex-direction: column !important;
    margin: 0;
    padding: 12px 0; /* Clean top/bottom spacing */
    list-style: none;
    height: auto !important;
    gap: 2px; /* Subtle separation */
}

.mobile-nav-menu .echo-nav-item {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu .echo-nav-link {
    display: flex !important;
    align-items: center;
    padding: 16px 20px; /* Touch-friendly 44px+ target */
    color: var(--text-primary, #111827);
    text-decoration: none;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Optimal mobile reading size */
    font-weight: 500;
    transition: all 250ms ease;
    line-height: 1.3;
    min-height: 48px; /* Apple/Google recommended touch target */
    position: relative;
    border-bottom: 1px solid var(--border-primary, rgba(229, 231, 235, 0.3));
}

.mobile-nav-menu .echo-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-menu .echo-nav-link:hover,
.mobile-nav-menu .echo-nav-link:active {
    background: linear-gradient(90deg, var(--bg-secondary, #f9fafb) 0%, transparent 100%);
    color: var(--color-primary, #3b82f6);
    transform: translateX(4px);
}

.mobile-nav-menu .echo-nav-link::after {
    content: '→';
    position: absolute;
    right: 20px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 250ms ease;
    color: var(--color-primary, #3b82f6);
    font-weight: 300;
}

.mobile-nav-menu .echo-nav-link:hover::after,
.mobile-nav-menu .echo-nav-link:active::after {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile dropdown menu styling */
.mobile-nav-menu .echo-dropdown-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg-secondary, #f9fafb) !important;
    width: 100% !important;
    min-width: auto !important;
}

.mobile-nav-menu .echo-dropdown-menu a {
    display: flex !important;
    align-items: center;
    padding: 12px 32px !important; /* Indented for sub-menu feel */
    color: var(--text-secondary, #6b7280) !important;
    text-decoration: none;
    border-radius: 0 !important;
    width: 100%;
    box-sizing: border-box;
    font-size: 15px !important; /* Slightly smaller than main items */
    font-weight: 400 !important; /* Less bold than main items */
    transition: all 250ms ease;
    line-height: 1.3;
    min-height: 40px !important; /* Slightly smaller than main items */
    position: relative;
    border-bottom: 1px solid var(--border-primary, rgba(229, 231, 235, 0.2));
    background: var(--bg-secondary, #f9fafb);
}

.mobile-nav-menu .echo-dropdown-menu a:last-child {
    border-bottom: none;
}

.mobile-nav-menu .echo-dropdown-menu a:hover,
.mobile-nav-menu .echo-dropdown-menu a:active {
    background: var(--bg-tertiary, #f3f4f6) !important;
    color: var(--color-primary, #3b82f6) !important;
    transform: translateX(4px);
}

.mobile-nav-menu .echo-dropdown-menu a::before {
    content: '↳';
    margin-right: 8px;
    opacity: 0.6;
    font-size: 12px;
}

/* Cards with SQC-Style Animations */
.echo-card {
  background: var(--card-bg, white);
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: var(--card-radius, 8px);
  box-shadow: var(--card-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1));
  overflow: hidden;
  transition: all 200ms ease;
  position: relative;
}

.hover-effect:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* SQC-Style Top Line Animations */
.top-line-static::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary, #3b82f6), var(--color-secondary, #8b5cf6));
}

.top-line-fade::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary, #3b82f6), var(--color-secondary, #8b5cf6));
  opacity: 0;
  transition: opacity 300ms ease;
}

.top-line-fade:hover::before {
  opacity: 1;
}

.top-line-swipe::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary, #3b82f6), var(--color-secondary, #8b5cf6));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}

.top-line-swipe:hover::before {
  transform: scaleX(1);
}

.top-line-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary, #3b82f6), var(--color-secondary, #8b5cf6));
  transition: left 300ms ease;
}

.top-line-slide:hover::before {
  left: 0;
}

/* Card Color Variants */
.top-line-success::before { background: linear-gradient(to right, #10b981, #059669); }
.top-line-warning::before { background: linear-gradient(to right, #f59e0b, #d97706); }
.top-line-danger::before { background: linear-gradient(to right, #ef4444, #dc2626); }
.top-line-info::before { background: linear-gradient(to right, #06b6d4, #0891b2); }

.echo-card-body {
  padding: 24px;
}

.echo-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-primary, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.echo-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-primary, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

/* Buttons */
.echo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--button-radius, 6px);
  cursor: pointer;
  transition: all 200ms ease;
  background: var(--color-primary, #3b82f6);
  color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.echo-button:hover {
  background: var(--color-primary-hover, #2563eb);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.echo-button:active {
  transform: translateY(0);
}

.echo-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.outline {
  background: transparent;
  color: var(--color-primary, #3b82f6);
  border: 1px solid var(--color-primary, #3b82f6);
}

.outline:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.ghost {
  background: transparent;
  color: var(--color-primary, #3b82f6);
  box-shadow: none;
}

.ghost:hover {
  background: var(--bg-secondary, #f9fafb);
}

.small-size {
  padding: 8px 16px;
  font-size: 12px;
}

.large-size {
  padding: 16px 24px;
  font-size: 16px;
}

/* Button Color Variants */
.success { background: #10b981; }
.success:hover { background: #059669; }
.success.outline { color: #10b981; border-color: #10b981; }
.success.outline:hover { background: #10b981; color: white; }

.warning { background: #f59e0b; }
.warning:hover { background: #d97706; }
.warning.outline { color: #f59e0b; border-color: #f59e0b; }
.warning.outline:hover { background: #f59e0b; color: white; }

.danger { background: #ef4444; }
.danger:hover { background: #dc2626; }
.danger.outline { color: #ef4444; border-color: #ef4444; }
.danger.outline:hover { background: #ef4444; color: white; }

/* Compact Tabs */
.echo-tabs {
  position: relative;
  width: 100%;
}

.echo-tab-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  border-bottom: 5px solid var(--color-primary, #3b82f6);
  width: 100%;
  justify-content: flex-start;
}

.tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.echo-tab-list > li {
  display: block;
  margin: 0;
  padding: 0;
}

.tab-label {
  display: inline-block;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
  transition: all 200ms ease;
  position: relative;
  white-space: nowrap;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  width: auto;
}

.tab-label:hover {
  color: var(--text-primary, #111827);
}

/* Tab label activation */
.echo-tabs .tab-radio:nth-of-type(1):checked ~ .echo-tab-list li:nth-of-type(1) .tab-label,
.echo-tabs .tab-radio:nth-of-type(2):checked ~ .echo-tab-list li:nth-of-type(2) .tab-label,
.echo-tabs .tab-radio:nth-of-type(3):checked ~ .echo-tab-list li:nth-of-type(3) .tab-label,
.echo-tabs .tab-radio:nth-of-type(4):checked ~ .echo-tab-list li:nth-of-type(4) .tab-label,
.echo-tabs .tab-radio:nth-of-type(5):checked ~ .echo-tab-list li:nth-of-type(5) .tab-label,
.echo-tabs .tab-radio:nth-of-type(6):checked ~ .echo-tab-list li:nth-of-type(6) .tab-label,
.echo-tabs .tab-radio:nth-of-type(7):checked ~ .echo-tab-list li:nth-of-type(7) .tab-label,
.echo-tabs .tab-radio:nth-of-type(8):checked ~ .echo-tab-list li:nth-of-type(8) .tab-label,
.echo-tabs .tab-radio:nth-of-type(9):checked ~ .echo-tab-list li:nth-of-type(9) .tab-label,
.echo-tabs .tab-radio:nth-of-type(10):checked ~ .echo-tab-list li:nth-of-type(10) .tab-label,
.echo-tabs .tab-radio:nth-of-type(11):checked ~ .echo-tab-list li:nth-of-type(11) .tab-label,
.echo-tabs .tab-radio:nth-of-type(12):checked ~ .echo-tab-list li:nth-of-type(12) .tab-label,
.echo-tabs .tab-radio:nth-of-type(13):checked ~ .echo-tab-list li:nth-of-type(13) .tab-label,
.echo-tabs .tab-radio:nth-of-type(14):checked ~ .echo-tab-list li:nth-of-type(14) .tab-label,
.echo-tabs .tab-radio:nth-of-type(15):checked ~ .echo-tab-list li:nth-of-type(15) .tab-label,
.echo-tabs .tab-radio:nth-of-type(16):checked ~ .echo-tab-list li:nth-of-type(16) .tab-label,
.echo-tabs .tab-radio:nth-of-type(17):checked ~ .echo-tab-list li:nth-of-type(17) .tab-label,
.echo-tabs .tab-radio:nth-of-type(18):checked ~ .echo-tab-list li:nth-of-type(18) .tab-label,
.echo-tabs .tab-radio:nth-of-type(19):checked ~ .echo-tab-list li:nth-of-type(19) .tab-label,
.echo-tabs .tab-radio:nth-of-type(20):checked ~ .echo-tab-list li:nth-of-type(20) .tab-label {
  color: white;
  background: var(--color-primary, #3b82f6);
  border-bottom: none;
}



/* Tab Content */
.echo-tab-content {
  display: none;
  padding: var(--space-4) var(--space-2);
  width: 100%;
}

/* Tab content switching */
.echo-tabs .tab-radio:nth-of-type(1):checked ~ .echo-tab-content:nth-of-type(1),
.echo-tabs .tab-radio:nth-of-type(2):checked ~ .echo-tab-content:nth-of-type(2),
.echo-tabs .tab-radio:nth-of-type(3):checked ~ .echo-tab-content:nth-of-type(3),
.echo-tabs .tab-radio:nth-of-type(4):checked ~ .echo-tab-content:nth-of-type(4),
.echo-tabs .tab-radio:nth-of-type(5):checked ~ .echo-tab-content:nth-of-type(5),
.echo-tabs .tab-radio:nth-of-type(6):checked ~ .echo-tab-content:nth-of-type(6),
.echo-tabs .tab-radio:nth-of-type(7):checked ~ .echo-tab-content:nth-of-type(7),
.echo-tabs .tab-radio:nth-of-type(8):checked ~ .echo-tab-content:nth-of-type(8),
.echo-tabs .tab-radio:nth-of-type(9):checked ~ .echo-tab-content:nth-of-type(9),
.echo-tabs .tab-radio:nth-of-type(10):checked ~ .echo-tab-content:nth-of-type(10),
.echo-tabs .tab-radio:nth-of-type(11):checked ~ .echo-tab-content:nth-of-type(11),
.echo-tabs .tab-radio:nth-of-type(12):checked ~ .echo-tab-content:nth-of-type(12),
.echo-tabs .tab-radio:nth-of-type(13):checked ~ .echo-tab-content:nth-of-type(13),
.echo-tabs .tab-radio:nth-of-type(14):checked ~ .echo-tab-content:nth-of-type(14),
.echo-tabs .tab-radio:nth-of-type(15):checked ~ .echo-tab-content:nth-of-type(15),
.echo-tabs .tab-radio:nth-of-type(16):checked ~ .echo-tab-content:nth-of-type(16),
.echo-tabs .tab-radio:nth-of-type(17):checked ~ .echo-tab-content:nth-of-type(17),
.echo-tabs .tab-radio:nth-of-type(18):checked ~ .echo-tab-content:nth-of-type(18),
.echo-tabs .tab-radio:nth-of-type(19):checked ~ .echo-tab-content:nth-of-type(19),
.echo-tabs .tab-radio:nth-of-type(20):checked ~ .echo-tab-content:nth-of-type(20) {
  display: block;
  border-top-color: var(--color-primary, #3b82f6);
}

/* Modal */
.echo-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal, 1050);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
}

.echo-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.echo-modal {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.9);
  transition: transform 200ms ease;
}

.echo-modal-backdrop.show .echo-modal {
  transform: scale(1);
}

.echo-modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-primary);
}

.echo-modal-body {
  padding: var(--space-6);
}

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

/* Alerts */
.echo-alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--space-4);
}

.echo-alert-success {
  background: var(--color-success-light, #d1fae5);
  border-color: var(--color-success);
  color: var(--color-success-dark, #065f46);
}

.echo-alert-warning {
  background: var(--color-warning-light, #fef3c7);
  border-color: var(--color-warning);
  color: var(--color-warning-dark, #92400e);
}

.echo-alert-danger {
  background: var(--color-danger-light, #fee2e2);
  border-color: var(--color-danger);
  color: var(--color-danger-dark, #991b1b);
}

.echo-alert-info {
  background: var(--color-info-light, #dbeafe);
  border-color: var(--color-info);
  color: var(--color-info-dark, #1e40af);
}

/* Badges */
.echo-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.echo-badge-primary {
  background: var(--color-primary);
  color: white;
}

.echo-badge-secondary {
  background: var(--gray-500);
  color: white;
}

.echo-badge-success {
  background: var(--color-success);
  color: white;
}

.echo-badge-warning {
  background: var(--color-warning);
  color: var(--color-warning-dark, #92400e);
}

.echo-badge-danger {
  background: var(--color-danger);
  color: white;
}

/* Tooltips */
.echo-tooltip {
  position: relative;
  display: inline-block;
}

.echo-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-inverse, var(--gray-900));
  color: var(--text-inverse, white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  z-index: var(--z-tooltip, 1070);
}

.echo-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-inverse, var(--gray-900));
}

.echo-tooltip:hover .echo-tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

/* Loading */
.echo-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-primary);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s ease-in-out infinite;
}

.echo-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

/* Progress */
.echo-progress {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.echo-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 300ms ease;
}

.echo-progress-success .echo-progress-bar {
  background: var(--color-success);
}

.echo-progress-warning .echo-progress-bar {
  background: var(--color-warning);
}

.echo-progress-danger .echo-progress-bar {
  background: var(--color-danger);
}

/* Tables */
.echo-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
}

.echo-table th,
.echo-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.echo-table th {
  background: var(--bg-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.echo-table tbody tr:hover {
  background: var(--bg-secondary);
}

.echo-table-striped tbody tr:nth-child(odd) {
  background: var(--bg-secondary);
}

.echo-table-bordered {
  border: 1px solid var(--border-primary);
}

.echo-table-bordered th,
.echo-table-bordered td {
  border-right: 1px solid var(--border-primary);
}

.echo-table-bordered th:last-child,
.echo-table-bordered td:last-child {
  border-right: none;
}

/* Pagination */
.echo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin: var(--space-6) 0;
}

.echo-pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 200ms ease;
  cursor: pointer;
}

.echo-pagination-item:hover {
  background: var(--bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.echo-pagination-item.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: var(--font-weight-semibold);
}

.echo-pagination-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Breadcrumbs */
.echo-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.echo-breadcrumb-item {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 200ms ease;
}

.echo-breadcrumb-item:hover {
  color: var(--color-primary);
}

.echo-breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.echo-breadcrumb-separator {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Accordion */
.echo-accordion-item {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.echo-accordion-header {
  background: var(--bg-secondary);
  padding: var(--space-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: var(--font-weight-medium);
  transition: background 200ms ease;
}

.echo-accordion-header:hover {
  background: var(--bg-tertiary);
}

.echo-accordion-content {
  padding: var(--space-4);
  border-top: 1px solid var(--border-primary);
  display: none;
}

.echo-accordion-item.active .echo-accordion-content {
  display: block;
}

/* Animation Utilities */
.animate-fade-in {
  animation: fadeIn 300ms ease-in-out;
}

.animate-slide-up {
  animation: slideUp 300ms ease-out;
}

.animate-bounce {
  animation: bounce 600ms ease-in-out;
}


/* Focus Management */
.echo-focus:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.echo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Forms */
.echo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.echo-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.echo-label {
  font-weight: 500;
  color: var(--text-primary, #111827);
  font-size: 14px;
}

.echo-input,
.echo-textarea,
.echo-select {
  padding: 12px;
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: 6px;
  background: var(--input-bg, white);
  color: var(--text-primary, #111827);
  font-size: 16px;
  transition: all 200ms ease;
}

.echo-input:focus,
.echo-textarea:focus,
.echo-select:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.echo-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Code Blocks */
.echo-code-block {
  background: var(--bg-tertiary, #f3f4f6);
  border: 1px solid var(--border-primary, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.echo-code-header {
  padding: 12px 16px;
  background: var(--bg-secondary, #f9fafb);
  border-bottom: 1px solid var(--border-primary, #e5e7eb);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
}

.echo-code-content {
  padding: 16px;
  overflow-x: auto;
}

.echo-code-content pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* Theme Toggle */
.echo-theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: var(--z-tooltip, 1070);
}

/* Responsive Design */
@media (max-width: 768px) {
  .echo-nav-menu {
    display: none;
  }
  
  .mobile-nav-button {
    display: flex;
  }
  
  /* Mobile nav menu responsive behavior - show mobile nav elements */
  .mobile-nav-button {
    display: flex !important; /* Show mobile nav button on mobile */
  }
  
  .mobile-nav-menu {
    display: none; /* Hidden by default, shown via CSS toggle */
  }
  
  .echo-mega-menu {
    position: static;
    display: block !important;
    box-shadow: none;
    border: none;
    margin-top: 0;
  }
  
  .echo-mega-inner {
    flex-direction: column;
  }
  
  .echo-mega-tabs {
    width: 100%;
    display: flex;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-primary, #e5e5e5);
  }
  
  .mega-tab-button {
    flex: 1;
    text-align: center;
    border-bottom: none;
    white-space: nowrap;
  }
  
  /* Ensure radio buttons work in mobile view */
  .echo-mega-menu .mega-tab-radio {
    position: absolute;
    opacity: 0;
  }
  
  .echo-mega-content {
    padding: 16px;
  }
  
  .echo-mega-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .echo-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin-top: 0;
    padding: 8px 0;
  }
  
  .echo-tab-list {
    display: flex;
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  .echo-tab-list > li {
    flex: 0 0 auto;
    margin-right: 15px;
  }
  
  .tab-label {
    padding: 12px 16px;
  }
}

/* Keyframes */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-30px);
  }
  70% {
    transform: translateY(-15px);
  }
  90% {
    transform: translateY(-4px);
  }
}

/* Mobile navigation animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide mobile nav on desktop */
@media (min-width: 769px) {
    .mobile-nav-toggle,
    .mobile-nav-button,
    .mobile-nav-menu {
        display: none !important;
    }
}