/* Tools & Gadgets hub */

:root {
  --hub-primary: #6366f1;
  --hub-primary-light: #818cf8;
  --hub-secondary: #8b5cf6;
  --hub-dark: #0a0f1a;
  --hub-surface: rgba(30, 41, 59, 0.65);
  --hub-border: rgba(148, 163, 184, 0.12);
  --hub-text: #e2e8f0;
  --hub-muted: #94a3b8;
  --hub-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --hub-radius: 20px;
  --hub-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body.tools-hub {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--hub-dark);
  color: var(--hub-text);
  overflow-x: hidden;
}

/* Ambient background */
.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hub-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(99, 102, 241, 0.12), transparent);
}

.hub-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: hub-float 18s ease-in-out infinite;
}

.hub-orb-1 {
  width: 420px;
  height: 420px;
  background: #6366f1;
  top: -120px;
  right: -80px;
}

.hub-orb-2 {
  width: 320px;
  height: 320px;
  background: #8b5cf6;
  bottom: 10%;
  left: -100px;
  animation-delay: -6s;
}

.hub-orb-3 {
  width: 240px;
  height: 240px;
  background: #4f46e5;
  top: 45%;
  right: 15%;
  animation-delay: -12s;
  opacity: 0.35;
}

@keyframes hub-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

.hub-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

/* Layout */
.hub-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.25rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Header */
.hub-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: hub-fade-up 0.8s ease-out both;
}

.hub-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.hub-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--hub-gradient);
  opacity: 0.2;
  filter: blur(20px);
  z-index: -1;
}

.hub-logo {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.hub-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  background: var(--hub-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hub-subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: var(--hub-muted);
  font-weight: 400;
  max-width: 420px;
  margin-inline: auto;
  line-height: 1.6;
}

/* Tool cards grid */
.hub-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
  margin-bottom: 3rem;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.35s ease,
              box-shadow 0.35s ease;
  overflow: hidden;
  animation: hub-fade-up 0.8s ease-out both;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.18s; }
.tool-card:nth-child(3) { animation-delay: 0.26s; }
.tool-card:nth-child(4) { animation-delay: 0.34s; }

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hub-gradient);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: var(--hub-shadow), 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.tool-card:hover::before {
  opacity: 0.06;
}

.tool-card > * {
  position: relative;
  z-index: 1;
}

.tool-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--hub-text);
  letter-spacing: -0.02em;
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--hub-muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
  flex: 1;
}

.tool-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hub-primary-light);
  transition: gap 0.25s ease, color 0.25s ease;
}

.tool-card:hover .tool-arrow {
  gap: 0.65rem;
  color: #c4b5fd;
}

.tool-arrow i {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

.tool-card:hover .tool-arrow i {
  transform: translateX(3px);
}

/* Footer */
.hub-footer {
  margin-top: auto;
  text-align: center;
  animation: hub-fade-up 0.8s ease-out 0.45s both;
}

.hub-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--hub-muted);
  text-decoration: none;
  border: 1px solid var(--hub-border);
  background: rgba(15, 23, 42, 0.5);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hub-back:hover {
  color: var(--hub-text);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.hub-visitors {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hub-muted);
  border: 1px solid var(--hub-border);
  background: rgba(15, 23, 42, 0.45);
}

.hub-visitors i {
  color: var(--hub-primary-light);
  font-size: 0.75rem;
}

@keyframes hub-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 576px) {
  .hub-main {
    padding: 2rem 1rem 2.5rem;
  }

  .hub-header {
    margin-bottom: 2rem;
  }

  .hub-tools {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tool-card {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-orb,
  .hub-header,
  .tool-card,
  .hub-footer {
    animation: none;
  }

  .tool-card:hover {
    transform: none;
  }
}
