/*    HYPIXOR — Reusable Components */

/* ——— Card ——— */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--brand-primary-subtle);
  transform: translateY(-4px);
}

.card-static {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

/* ——— Spotlight Interaction Base ——— */
.card::before,
.card-static::before,
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(800px circle at var(--mouse-x, -800px) var(--mouse-y, -800px),
      rgba(0, 0, 0, 0.03),
      /* Subtle dark tone for Light Mode white backgrounds */
      transparent 40%);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) .card::before,
  :root:not([data-theme="light"]) .card-static::before,
  :root:not([data-theme="light"]) .btn::before {
    background: radial-gradient(800px circle at var(--mouse-x, -800px) var(--mouse-y, -800px), rgba(255, 255, 255, 0.08), transparent 40%);
  }
}

:root[data-theme="dark"] .card::before,
:root[data-theme="dark"] .card-static::before,
:root[data-theme="dark"] .btn::before {
  background: radial-gradient(800px circle at var(--mouse-x, -800px) var(--mouse-y, -800px), rgba(255, 255, 255, 0.08), transparent 40%);
}

.card:hover::before,
.card-static:hover::before,
.btn:hover::before {
  opacity: 1;
}

.card>*,
.card-static>*,
.btn>* {
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-icon {
  width: 20px;
  height: 20px;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  /* 8px 16px */
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-alt);
}

.btn-ghost {
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-bg-alt);
  color: var(--color-text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* ——— Form Inputs ——— */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.form-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  /* 8px 16px */
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  width: 100%;
  font-size: var(--text-sm);
}

.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-subtle);
}

.form-input::placeholder {
  color: var(--color-text-faint);
}

.form-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  /* 8px 16px */
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  font-size: var(--text-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239090A4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-subtle);
}

.form-inline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.form-inline .form-input {
  width: auto;
  min-width: 100px;
}

/* ——— Toggle Switch ——— */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle input:checked+.toggle-track {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 0 16px var(--brand-primary-glow);
}

.toggle input:checked+.toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

/* ——— Badge ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

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

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

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

.badge-info {
  background: var(--color-info-subtle);
  color: var(--color-info);
}

/* ——— Data Table ——— */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:hover {
  background: var(--color-bg-alt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ——— Event Row ——— */
.event-row {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  gap: var(--space-4);
}

.event-row:hover {
  background: var(--color-bg-alt);
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  flex: 1;
  min-width: 0;
}

.event-timer {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--brand-primary);
  font-weight: var(--weight-semi);
  white-space: nowrap;
}

.event-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

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

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  background: var(--color-surface);
  transition: background var(--transition-fast);
  border: none;
  width: 100%;
  text-align: left;
  color: var(--color-text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
}

.accordion-header:hover {
  background: var(--color-bg-alt);
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
  color: var(--color-text-muted);
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
}

.accordion-content {
  padding: 0 var(--space-5) var(--space-5);
}

/* ——— Drop Item ——— */
.drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.drop-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.drop-item:hover {
  background: var(--brand-primary-subtle);
  border-left-color: var(--brand-primary);
  padding-left: var(--space-4);
}

.drop-item:nth-child(even) {
  background: var(--color-bg-alt);
}

.drop-item:nth-child(even):hover {
  background: var(--brand-primary-subtle);
}

.drop-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.drop-chance {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ——— Tabs ——— */
.tab-bar {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--color-text-primary);
}

.tab-btn.active {
  color: var(--brand-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-primary);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.tab-panel {
  display: none;
}

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

/* ——— Resource Card ——— */
.resource-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
}

.resource-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.resource-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resource-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  margin-bottom: 4px;
  color: var(--color-text-primary);
}

.resource-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

/* ——— Toast ——— */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: toastIn var(--transition-base) forwards;
  max-width: 360px;
}

@keyframes toastIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ——— Live Pulse ——— */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  display: inline-block;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

/* ——— Rarity colors ——— */
.rarity-common {
  color: var(--rarity-common);
}

.rarity-uncommon {
  color: var(--rarity-uncommon);
}

.rarity-rare {
  color: var(--rarity-rare);
}

.rarity-epic {
  color: var(--rarity-epic);
}

.rarity-legendary {
  color: var(--rarity-legendary);
}

.rarity-mythic {
  color: var(--rarity-mythic);
}

.rarity-divine {
  color: var(--rarity-divine);
}

.rarity-special {
  color: var(--rarity-special);
}

.rarity-supreme {
  color: var(--rarity-supreme);
}

/* ——— Banners ——— */
.banner-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dev-banner {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  color: #92400e;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.3px;
  border-bottom: 1px solid #fbbf24;
}

.discord-banner {
  background: linear-gradient(90deg, #5865F2, #7289da);
  color: white;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.3px;
}

.discord-banner a {
  color: white;
  text-decoration: underline;
  font-weight: var(--weight-bold);
}

.discord-banner a:hover {
  color: #e0e7ff;
}

/* ——— Tooltips ——— */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
  z-index: 100;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* ——— Loading States & Spinners ——— */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  100% {
    transform: rotate(360deg);
  }
}

/* ——— Empty & Error States ——— */
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
}

.error-state {
  border-style: solid;
  border-color: var(--color-error-subtle);
  background: rgba(239, 68, 68, 0.03);
}

.empty-icon,
.error-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--color-text-faint);
}

.error-icon {
  color: var(--color-error);
}

.empty-title,
.error-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

/* ——— Toasts / Notifications ——— */
.toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  pointer-events: auto;
  animation: toastSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-success .toast-icon {
  color: var(--color-success);
}

.toast.toast-error .toast-icon {
  color: var(--color-error);
}

@keyframes toastSlideUp {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (pointer: coarse) {

  .btn,
  .form-input,
  .form-select,
  .nav-link,
  .dropdown-link {
    min-height: 44px;
    /* Apple tap target absolute conformity for touch inputs only */
  }
}

/* ——— Scroll Reveal Animations ——— */
.reveal-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--transition-base), transform 0.6s var(--transition-base);
  will-change: opacity, transform;
}

.reveal-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 768px) {

  .form-input,
  .form-select {
    font-size: 16px;
    width: 100%;
  }

  .card-static,
  .card {
    padding: var(--space-4);
    /* Compress margins on small screens */
  }
}

/* ——— UI Animations ——— */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-stagger>* {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in-stagger>*:nth-child(1) {
  animation-delay: 0.0s;
}

.fade-in-stagger>*:nth-child(2) {
  animation-delay: 0.08s;
}

.fade-in-stagger>*:nth-child(3) {
  animation-delay: 0.16s;
}

.fade-in-stagger>*:nth-child(4) {
  animation-delay: 0.24s;
}

.fade-in-stagger>*:nth-child(5) {
  animation-delay: 0.32s;
}

.fade-in-stagger>*:nth-child(6) {
  animation-delay: 0.40s;
}

/* ——— Global Glass Tooltip ——— */
.glass-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--z-modal);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Toast Notifications ——— */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 250px;
  max-width: 350px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon {
  color: var(--color-success, #10b981);
}

.toast-error .toast-icon {
  color: var(--color-error, #ef4444);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--color-text-primary);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

/* ——— Seamless Page Transitions ——— */
body.page-transition-enter .main-content {
  animation: pageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.page-transition-exit .main-content {
  animation: pageFadeOut 0.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}