/* ==========================================================================
   QuickDevBox Tools - Premium UI/UX Design System
   Target Domain: quickdevbox.com
   Style Concept: Modern Dark / High-Tech Glassmorphism / Vibrant Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-glow: rgba(56, 189, 248, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.25);
  
  --accent: #818cf8;
  --accent-purple: #c084fc;
  --success: #34d399;
  --danger: #f87171;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(129, 140, 248, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation Bar (Compact Padding) */
header {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.logo img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Main Content Area */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

/* Hero Section (Ultra-Compact Above-the-Fold Optimization) */
.hero {
  text-align: center;
  padding: 0.5rem 1rem 0.6rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Native Western Trust Signals Bar (Compact) */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Instant Search & Filter Bar */
.search-wrapper {
  max-width: 580px;
  margin: 0.8rem auto 0.8rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 6px 20px rgba(0, 0, 0, 0.35);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Category Filter Pills Component (UX Supercharger) */
.category-pills {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.pill-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.35);
  font-weight: 600;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Card Grid (Homepage) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--bg-card-border-glow);
  box-shadow: 0 12px 25px -8px rgba(0, 0, 0, 0.5), 0 0 16px -4px var(--primary-glow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
  display: inline-block;
}

.tool-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.tool-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  flex: 1;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  margin-top: 0.9rem;
  font-weight: 600;
}

/* Tool Interface Box */
.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}

.privacy-banner {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-controls {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn {
  background: var(--primary);
  color: #090d16;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sample {
  background: rgba(129, 140, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.btn-sample:hover {
  background: rgba(129, 140, 248, 0.25);
  color: #fff;
}

/* Layout System 1: Side-by-Side Split (For Converters & Formatter) */
.editor-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

/* Layout System 2: Stacked Top-Control / Bottom-Full (For Generators) */
.editor-stacked {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Layout System 3: Metrics Dashboard (For Counters) */
.metrics-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 868px) {
  .editor-wrapper {
    grid-template-columns: 1fr;
  }
  
  header {
    padding: 0.65rem 1rem;
  }

  .nav-links {
    display: none;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .tool-box {
    padding: 1.1rem;
  }

  .tool-controls {
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.editor-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

textarea, input[type="text"] {
  width: 100%;
  background: #040711;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.75rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Author Trust & EEAT Verification Box */
.author-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--bg-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Related Tools Widget Section */
.related-tools {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
}

.related-tools h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.related-links a {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid var(--bg-card-border);
  transition: all 0.2s;
}

.related-links a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

/* Floating Toast Notifications */
.status-msg {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-top: 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Footer */
footer {
  border-top: 1px solid var(--bg-card-border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
  background: rgba(9, 13, 22, 0.95);
}

footer a {
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--primary);
}
