@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* =================================================
   Simple Tools - "Soft Space" Edition
   Aesthetics: Deep Cosmos, Floating Elements, Soft Glass
================================================= */

:root {
  /* Core Space Colors */
  --bg-space: #050510;
  /* Deep Void */
  --bg-card: rgba(20, 25, 45, 0.4);

  --primary: #a78bfa;
  --primary-soft: #c4b5fd;
  --secondary: #60a5fa;
  --accent: #f472b6;

  /* Text */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Glassmorphism Tokens - Softer */
  --glass-bg: rgba(30, 35, 60, 0.3);
  --glass-bg-hover: rgba(40, 45, 80, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  /* Very subtle border */
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.4);
  /* Deeper shadow for depth */
  --glass-glow: 0 0 20px rgba(167, 139, 250, 0.15);
  /* Soft purple glow */
  --glass-backdrop: blur(12px);

  /* Animation */
  --float-duration: 6s;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Reset & Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-space);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
  line-height: 1.6;

  /* Stars Background */
  background-image:
    radial-gradient(1px 1px at 10% 10%, white, transparent),
    radial-gradient(1px 1px at 20% 20%, white, transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 40% 40%, white, transparent),
    radial-gradient(2px 2px at 50% 50%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 60% 10%, white, transparent),
    radial-gradient(1px 1px at 70% 80%, white, transparent),
    radial-gradient(2px 2px at 80% 30%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90% 90%, white, transparent);
  background-size: 50% 50%;
  /* Repeat star pattern */
}

/* Nebula / Aurora Effects */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 80vw;
  height: 80vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  /* Extremely soft blur for "nebula" feel */
  opacity: 0.35;
  animation: nebula-drift 20s infinite alternate ease-in-out;
}

body::before {
  background: radial-gradient(circle, #4c1d95, transparent 70%);
  /* Deep Purple */
  top: -20vw;
  left: -20vw;
}

body::after {
  background: radial-gradient(circle, #1e3a8a, transparent 70%);
  /* Deep Blue */
  bottom: -20vw;
  right: -20vw;
  animation-delay: -10s;
}

@keyframes nebula-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }

  100% {
    transform: translate(5%, 5%) scale(1.1);
    opacity: 0.5;
  }
}

/* Floating Animation Keyframes */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }

  /* Gentle float up */
}

/* --- Layout Components --- */
header {
  text-align: center;
  margin: 5rem 0 6rem;
  /* More space for ethereal feel */
  width: 100%;
  position: relative;
  z-index: 10;
  animation: float 8s ease-in-out infinite;
  /* Whole header floats gently */
}

h1 {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  /* Soft Gradient Text */
  background: linear-gradient(180deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  text-shadow: 0 10px 30px rgba(167, 139, 250, 0.3);
}

p.subtitle {
  color: var(--primary-soft);
  font-size: 1.3rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
}

main {
  width: 100%;
  max-width: 1200px;
  z-index: 5;
}

/* --- Navigation --- */
.back-nav {
  text-align: left;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.back-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.back-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-soft);
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

/* --- Filter Chips --- */
.filter-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 5rem;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.7rem 1.8rem;
  /* Larger, softer pills */
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-chip:hover {
  border-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(96, 165, 250, 0.8));
  color: white;
  border-color: transparent;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
  /* Glowing active state */
}

/* --- Cards (The Floating Elements) --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  padding: 1rem;
}

.tool-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  /* Very round corners */
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);

  /* The Float Animation */
  animation: float 6s ease-in-out infinite;
  transition: all 0.4s;
}

/* Stagger Floating Animations randomly */
.tool-card:nth-child(2n) {
  animation-delay: 1s;
}

.tool-card:nth-child(3n) {
  animation-delay: 2s;
}

.tool-card:nth-child(5n) {
  animation-delay: 0.5s;
}

.tool-card:nth-child(7n) {
  animation-delay: 1.5s;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 60%);
  pointer-events: none;
}

.tool-card:hover {
  /* On hover, pause or enhance float? Let's lift it further */
  transform: translateY(-15px) scale(1.03) !important;
  /* Override animation transform temporarily */
  background: var(--glass-bg-hover);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.5), var(--glass-glow);
  animation-play-state: paused;
  /* Pause floating when interacting */
}

.tool-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover .tool-icon {
  transform: scale(1.2) rotate(10deg);
}

.tool-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tool-card p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1rem;
  font-weight: 300;
}

.tool-card.hidden {
  display: none;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Tinted badges for Space theme */
.badge.text {
  background: rgba(167, 139, 250, 0.1);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge.image {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge.utility {
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.badge.security {
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.badge.generator {
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* --- Tool Container (Inner Pages) --- */
.tool-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: 2.5rem;
  /* Rounder */
  padding: 3rem;
  box-shadow: var(--glass-shadow);
  width: 100%;
  position: relative;
  overflow: hidden;

  /* Gentle entrance */
  animation: fadeInUp 0.8s ease backwards;
}

.tool-container h2 {
  font-size: 2rem;
  margin: 2rem 0 1.5rem;
  color: var(--primary-soft);
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

.tool-container h2:first-child {
  margin-top: 0;
}

.tool-container p,
.tool-container ul {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.1rem;
}

/* --- Form Elements --- */
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  /* Softer corners */
  padding: 1.25rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
  /* Glowing focus */
}

.action-btn {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: white;
  border: none;
  padding: 1.25rem;
  border-radius: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
  margin-top: 1rem;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.6);
  filter: brightness(1.1);
}

/* --- Common Components (Toast, etc) --- */
.toast {
  background: rgba(5, 150, 105, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
  transform: translateY(0);
}

/* --- Info Section --- */
.info-section {
  width: 100vw;
  margin-left: max(-50vw, calc(-50vw + 50%));
  margin-top: 8rem;
  padding: 8rem 2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
  position: relative;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-bottom: 6rem;
}

.content-block h3 {
  color: var(--primary-soft);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

/* --- Article Section (SEO Content) --- */
.article-section {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--glass-border);
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.article-section h2 {
  font-size: 1.8rem;
  color: var(--primary-soft);
  margin-bottom: 1.5rem;
  margin-top: 3rem;
}

.article-section h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.article-section p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.article-section ul, 
.article-section ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.article-section li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.article-section strong {
  color: var(--secondary);
}

/* --- Footer --- */
footer {
  margin-top: auto;
  padding: 4rem 0 2rem;
  text-align: center;
  color: var(--text-dim);
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Specific Tools (Minimal updates for consistency) --- */
/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(167, 139, 250, 0.05);
}

/* Palette */
.palette-item {
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* QR */
.qr-preview-container {
  background: white;
  border-radius: 2rem;
  padding: 2rem;
}

#qr-canvas {
  border-radius: 1rem;
}

/* Helpers */
.hidden {
  display: none !important;
}

/* Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile */
@media (max-width: 640px) {
  h1 {
    font-size: 3rem;
  }

  .tool-container,
  .tool-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
  }

  .filter-chip {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
}