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

:root {
  --bg: #030308;
  --surface: #0a0a14;
  --elevated: #111122;
  --border: #1e1e3a;
  --text: #eaeaf0;
  --text-secondary: #8888b4;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124,58,237,0.25);
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(124,58,237,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.site-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  background: rgba(10,10,20,0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}
.logo:hover { opacity: 0.9; }
.logo .icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.logo span.grad {
  background: linear-gradient(135deg, #c084fc, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-size: 0.9rem;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.premium-btn {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-block;
}
.premium-btn:hover {
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

/* ── Main ── */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #e0d5ff, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Categories ── */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* ── Tool Card ── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-card:hover::before { opacity: 1; }
.tool-card .emoji { font-size: 1.6rem; margin-bottom: 0.5rem; }
.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  position: relative;
}
.tool-card .desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  position: relative;
  line-height: 1.4;
}

/* ── Ad placements ── */
.ad-inline {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  margin: 2rem 0;
}
.ad-inline .ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.ad-inline .ad-content {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.ad-inline a { color: var(--accent-light); }

.ad-sidebar {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  grid-column: 1 / -1;
}
.ad-sidebar .ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ── Tool Page ── */
.tool-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent-light); }

.tool-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-header .big-emoji { font-size: 2.5rem; }
.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.tool-header p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.tool-panel label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.tool-panel textarea,
.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}
.tool-panel textarea:focus,
.tool-panel input:focus,
.tool-panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.tool-panel select option { background: var(--surface); color: var(--text); }

.btn-row { display: flex; gap: 0.75rem; margin-top: 1rem; align-items: center; flex-wrap: wrap; }

.btn {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.btn:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  box-shadow: none;
}

.result-box {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
.result-box.show { display: block; }
.result-box.error { border-color: var(--red); color: var(--red); }
.result-box.loading { color: var(--text-secondary); animation: pulse 1.5s ease-in-out infinite; }

/* Ad in tool panel */
.tool-ad {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--accent-light); text-decoration: none; }

/* ── Animations ── */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Crypto / Stock display ── */
.price-display {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.5rem 0;
}
.change-pos { color: var(--green); }
.change-neg { color: var(--red); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .header { padding: 0.75rem 1rem; }
  .nav-links { display: none; }
  .main { padding: 1rem; }
  .hero h1 { font-size: 2rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-page { padding: 1rem 0; }
}

/* ── Utility ── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
  margin-left: 0.5rem;
}
.tag-free { background: rgba(16,185,129,0.15); color: var(--green); }
.tag-premium { background: rgba(245,158,11,0.15); color: var(--amber); }

.audio-player {
  margin-top: 1rem;
}
.audio-player audio { width: 100%; margin-top: 0.5rem; }

.qr-display {
  text-align: center;
  padding: 1rem;
}
.qr-display img { max-width: 200px; border-radius: var(--radius-sm); }

.screenshot-display {
  text-align: center;
}
.screenshot-display img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
