/* ═══════════════════════════════════════
   CryptoTools - Design System
   Dark theme, clean, conversion-optimized
   ═══════════════════════════════════════ */

/* ── Reset & Base ────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0f;
    --bg-card: #131320;
    --bg-card-hover: #1a1a2e;
    --border: #1f1f35;
    --text: #e4e4ec;
    --text-dim: #8888a0;
    --text-muted: #5c5c78;
    --primary: #7C3AED;
    --primary-hover: #6D28D9;
    --primary-glow: rgba(124, 58, 237, 0.3);
    --green: #10B981;
    --red: #EF4444;
    --orange: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── Navbar ──────────────────────────── */
.navbar {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    padding: 12px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--text-dim); font-size: 14px; font-weight: 500; transition: color .15s; }
.nav-link:hover { color: var(--text); }

/* ── Buttons ─────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600;
    font-size: 14px; cursor: pointer; border: none; transition: all .2s;
    font-family: inherit; text-decoration: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 24px var(--primary-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: #333; }

/* ── Badges ──────────────────────────── */
.badge-premium, .badge-free {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.badge-premium { background: rgba(124,58,237,0.15); color: #a78bfa; }
.badge-free { background: rgba(107,114,128,0.15); color: #9ca3af; }
.tool-badge {
    position: absolute; top: 12px; right: 12px;
    padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.5px; z-index: 2;
}
.tool-badge.premium { background: rgba(124,58,237,0.2); color: #a78bfa; }
.tool-badge.free { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* ── Hero ────────────────────────────── */
.hero { padding: 80px 0 60px; text-align: center; }
.hero-badge {
    display: inline-block; padding: 6px 16px; border-radius: 20px;
    background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.2);
    color: #a78bfa; font-size: 13px; font-weight: 500; margin-bottom: 24px;
}
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.gradient-text { background: linear-gradient(135deg, #7C3AED, #06B6D4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 18px; color: var(--text-dim); max-width: 640px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 48px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 24px; font-weight: 700; color: var(--primary); }
.stat { color: var(--text-dim); font-size: 13px; }

/* ── Sections ────────────────────────── */
.section-title { font-size: 32px; font-weight: 700; margin-bottom: 32px; text-align: center; }
.tools-section { padding: 60px 0; }
.cta-section { padding: 80px 0; border-top: 1px solid var(--border); }

/* ── Tools Grid ──────────────────────── */
.tools-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.tool-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all .25s;
}
.tool-card:hover { background: var(--bg-card-hover); border-color: #333; transform: translateY(-2px); }
.tool-card.premium { border-color: rgba(124,58,237,0.3); }
.tool-card.premium:hover { border-color: rgba(124,58,237,0.5); box-shadow: 0 8px 32px rgba(124,58,237,0.1); }
.tool-icon { margin-bottom: 16px; }
.tool-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tool-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

/* ── Features ────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.feature { padding: 24px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.feature h4 { font-size: 16px; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 14px; }

/* ── Modal ───────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px); z-index: 200;
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 32px; max-width: 500px; width: 90%;
    position: relative; max-height: 90vh; overflow-y: auto;
}
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 24px; cursor: pointer; }
.modal h2 { font-size: 24px; margin-bottom: 4px; }
.modal-sub { color: var(--text-dim); margin-bottom: 20px; }
.payment-card {
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(6,182,212,0.1));
    border: 1px solid rgba(124,58,237,0.2); border-radius: var(--radius);
    padding: 20px; text-align: center; margin-bottom: 24px;
}
.payment-network { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }
.payment-network img { width: 20px; height: 20px; }
.payment-amount { font-size: 36px; font-weight: 800; }
.payment-amount .amount { color: var(--primary); }
.payment-amount .amount-original { color: var(--text-dim); font-size: 20px; text-decoration: line-through; margin-right: 8px; }
.payment-amount .currency { color: var(--text); font-size: 20px; margin-left: 4px; }
.payment-equiv { color: var(--text-dim); font-size: 13px; }

.discount-banner {
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(16,185,129,0.1));
    border: 1px solid rgba(34,197,94,0.3); border-radius: 8px;
    padding: 12px 16px; text-align: center; margin-bottom: 16px;
    color: #22c55e; font-weight: 700; font-size: 15px;
}
.discount-highlight { color: #22c55e; font-weight: 600; font-size: 14px; }
.discount-highlight s { color: var(--text-dim); margin: 0 4px; }

.payment-steps { margin-bottom: 16px; }
.step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.step-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.step-text { font-size: 14px; padding-top: 2px; }
.step-text strong { display: block; }

.wallet-address {
    display: flex; gap: 8px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px;
    align-items: center;
}
.wallet-address code { font-size: 12px; word-break: break-all; flex: 1; color: var(--text-dim); }

.input, .textarea {
    width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
    font-size: 14px; transition: border-color .2s;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--primary); }
.textarea { resize: vertical; }
.textarea.mono, .mono { font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 13px; }

.verify-status { margin-top: 12px; font-size: 13px; text-align: center; min-height: 20px; }
.verify-status.success { color: var(--green); }
.verify-status.error { color: var(--red); }
.payment-info { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.payment-info p { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }

/* ── Tool Pages ──────────────────────── */
.tool-page, .tools-page { padding: 40px 0; }
.back-link { color: var(--text-dim); font-size: 14px; display: inline-block; margin-bottom: 16px; }
.tool-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tool-header h1 { font-size: 28px; }
.tool-desc { color: var(--text-dim); margin-bottom: 32px; max-width: 600px; }

.tool-workspace { max-width: 900px; }

.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 60px 20px;
    text-align: center; cursor: pointer; transition: all .2s; margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(124,58,237,0.05); }
.upload-content h3 { margin: 12px 0 4px; font-size: 16px; }
.upload-content p { color: var(--text-dim); font-size: 13px; }
.upload-content .free-badge {
    display: inline-block; margin-top: 8px; padding: 4px 12px;
    background: rgba(34,197,94,0.15); color: #22c55e;
    border-radius: 20px; font-size: 12px; font-weight: 600;
}

.format-select, .input-group, .json-actions {
    display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.format-select label { font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.format-select select { width: auto; min-width: 120px; }
.json-actions .btn.active { background: var(--primary); color: white; }

.loading-area {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px; gap: 16px;
}
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-area { margin-top: 24px; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.compare-panel h4 { margin-bottom: 8px; font-size: 14px; color: var(--text-dim); }
.compare-panel img { width: 100%; border-radius: var(--radius-sm); background: repeating-conic-gradient(#1a1a2e 0% 25%, #131320 0% 50%) 50% / 20px 20px; }
.result-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.diff-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.diff-panel h4 { margin-bottom: 8px; font-size: 14px; }
.diff-output {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px; font-size: 13px; overflow-x: auto; white-space: pre-wrap;
    font-family: 'JetBrains Mono', 'Fira Code', monospace; margin-top: 8px;
}
.diff-stats { display: flex; gap: 16px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }
.stat-add { color: var(--green); }
.stat-remove { color: var(--red); }
.stat-info { color: var(--text-dim); }

/* ── Palette ─────────────────────────── */
.palette-display { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.palette-color { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 12px 16px; border: 1px solid var(--border); min-width: 200px; flex: 1; }
.color-swatch { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
.color-info strong { display: block; font-size: 14px; }
.color-info span { color: var(--text-dim); font-size: 12px; }
.color-pct { font-weight: 700; color: var(--text-dim); margin-left: auto; }

/* ── SEO Analysis ────────────────────── */
.seo-score { text-align: center; margin-bottom: 24px; }
.score-circle {
    width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: conic-gradient(
        var(--primary) calc(var(--score, 80) * 1%),
        var(--border) calc(var(--score, 80) * 1%)
    );
    position: relative;
}
.score-circle::before {
    content: ''; width: 80px; height: 80px; border-radius: 50%;
    background: var(--bg-card); position: absolute;
}
.score-num { font-size: 28px; font-weight: 800; color: var(--text); position: relative; z-index: 1; }
.score-label { font-size: 14px; color: var(--text-dim); position: relative; z-index: 1; margin-top: -4px; }

.analysis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.analysis-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px;
}
.analysis-card h4 { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.analysis-card p { font-size: 14px; margin-bottom: 2px; word-break: break-all; }
.analysis-card .meta { font-size: 12px; color: var(--text-muted); }
.analysis-card em { color: var(--red); font-style: normal; }

.issues-list { background: rgba(239,68,68,0.05); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm); padding: 16px; }
.issues-list h4 { color: var(--red); margin-bottom: 8px; }
.issues-list ul { padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.issues-list li { margin-bottom: 4px; }

/* ── Paywall ─────────────────────────── */
.paywall { text-align: center; padding: 60px 20px; background: var(--bg-card); border: 2px dashed rgba(124,58,237,0.3); border-radius: var(--radius); }
.paywall-icon { margin-bottom: 20px; }
.paywall h2 { font-size: 24px; margin-bottom: 8px; }
.paywall p { color: var(--text-dim); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ── Success Modal ───────────────────── */
.modal-success { text-align: center; }
.success-icon { margin-bottom: 16px; display: flex; justify-content: center; }

/* ── Category Title ──────────────────── */
.category-title { font-size: 18px; font-weight: 600; margin: 40px 0 20px; display: flex; align-items: center; gap: 10px; }

/* ── Responsive ──────────────────────── */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero-desc { font-size: 16px; }
    .tools-grid { grid-template-columns: 1fr; }
    .comparison, .diff-inputs { grid-template-columns: 1fr; }
    .hero-stats { gap: 24px; }
    .features-grid { grid-template-columns: 1fr; }
}
