/* MoaHub Ecosystem Widget v1.0 */
/* All styles scoped under .moahub-eco-* to avoid host page conflicts */

/* ===== TOP BAR ===== */
.moahub-eco-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  height: 36px;
  background: #0a0b1e;
  border-bottom: 1px solid rgba(122, 176, 248, 0.15);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 12px;
  color: #b0bfd2;
  box-sizing: border-box;
  transition: transform 0.3s ease;
}

.moahub-eco-bar.moahub-eco-hidden {
  transform: translateY(-100%);
}

.moahub-eco-bar-trigger {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 99998;
  cursor: pointer;
}

.moahub-eco-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #e7edf6;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  margin-right: 16px;
}

.moahub-eco-brand:hover { color: #7ab0f8; }

.moahub-eco-brand svg {
  width: 16px;
  height: 16px;
}

/* Desktop nav links */
.moahub-eco-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.moahub-eco-links a {
  padding: 4px 10px;
  border-radius: 6px;
  color: #7f8da1;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s;
}

.moahub-eco-links a:hover {
  color: #e7edf6;
  background: rgba(122, 176, 248, 0.1);
}

.moahub-eco-links a[data-current="true"] {
  color: #7ab0f8;
  background: rgba(122, 176, 248, 0.12);
}

/* More button */
.moahub-eco-more-btn {
  padding: 4px 10px;
  border-radius: 6px;
  color: #7f8da1;
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
}

.moahub-eco-more-btn:hover {
  color: #e7edf6;
  background: rgba(122, 176, 248, 0.1);
}

/* Close button */
.moahub-eco-close {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 6px;
  color: #7f8da1;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
}

.moahub-eco-close:hover {
  color: #e7edf6;
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile hamburger */
.moahub-eco-hamburger {
  display: none;
  padding: 4px 8px;
  border-radius: 6px;
  color: #7f8da1;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  margin-left: auto;
}

.moahub-eco-hamburger:hover {
  color: #e7edf6;
  background: rgba(122, 176, 248, 0.1);
}

/* Dropdown panel */
.moahub-eco-dropdown {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #0d0f24;
  border-bottom: 1px solid rgba(122, 176, 248, 0.15);
  padding: 16px 20px;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  max-height: 70vh;
  overflow-y: auto;
}

.moahub-eco-dropdown.moahub-eco-open {
  display: block;
}

.moahub-eco-dropdown-cat {
  margin-bottom: 14px;
}

.moahub-eco-dropdown-cat:last-child {
  margin-bottom: 0;
}

.moahub-eco-dropdown-cat h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7f8da1;
  margin: 0 0 8px 0;
  padding: 0;
  font-weight: 600;
}

.moahub-eco-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}

.moahub-eco-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #b0bfd2;
  transition: all 0.2s;
  font-size: 13px;
}

.moahub-eco-dropdown-item:hover {
  background: rgba(122, 176, 248, 0.1);
  color: #e7edf6;
}

.moahub-eco-dropdown-item[data-current="true"] {
  background: rgba(122, 176, 248, 0.12);
  color: #7ab0f8;
}

/* 출시 준비중 항목: 클릭 비활성 + 흐림 처리 */
.moahub-eco-dropdown-item[data-pending="true"] {
  cursor: default;
  opacity: 0.55;
}
.moahub-eco-dropdown-item[data-pending="true"]:hover {
  background: transparent;
  color: inherit;
}

.moahub-eco-dropdown-item span.moahub-eco-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.moahub-eco-dropdown-item span.moahub-eco-name {
  font-weight: 500;
}

.moahub-eco-dropdown-item span.moahub-eco-desc {
  font-size: 11px;
  color: #7f8da1;
  margin-left: auto;
  white-space: nowrap;
}

.moahub-eco-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 4px;
}

.moahub-eco-badge-new {
  background: rgba(122, 176, 248, 0.2);
  color: #7ab0f8;
}

.moahub-eco-badge-hot {
  background: rgba(216, 131, 131, 0.2);
  color: #d88383;
}

/* ===== FOOTER (compact) ===== */
.moahub-eco-footer {
  background: #070c14;
  border-top: 1px solid rgba(122, 176, 248, 0.1);
  padding: 10px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  color: #5a6a80;
  font-size: 11px;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.moahub-eco-footer a.moahub-eco-footer-brand {
  color: #b0bfd2;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  transition: color 0.2s;
}

.moahub-eco-footer a.moahub-eco-footer-brand:hover {
  color: #7ab0f8;
}

.moahub-eco-footer a {
  color: #5a6a80;
  text-decoration: none;
  transition: color 0.2s;
}

.moahub-eco-footer a:hover {
  color: #7ab0f8;
}

.moahub-eco-footer .moahub-eco-footer-sep {
  color: #2a3444;
  font-size: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .moahub-eco-links,
  .moahub-eco-more-btn,
  .moahub-eco-close {
    display: none;
  }

  .moahub-eco-hamburger {
    display: block;
  }

  .moahub-eco-dropdown-grid {
    grid-template-columns: 1fr 1fr;
  }

  .moahub-eco-dropdown-item span.moahub-eco-desc {
    display: none;
  }

  .moahub-eco-footer {
    padding: 8px 12px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .moahub-eco-dropdown-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .moahub-eco-bar,
  .moahub-eco-links a,
  .moahub-eco-dropdown-item,
  .moahub-eco-footer-cat a {
    transition: none;
  }
}
