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

:root {
    /* Design system — shared with homepage */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0f1a;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-glow: rgba(59, 130, 246, 0.15);
    --accent: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-gold: #f59e0b;
    --text-primary: #ffffff;
    --text-muted: #a1a1aa;
    --text-secondary: #71717a;
    --gradient-text: linear-gradient(175deg, #ffffff 32%, #a78bfa 57%, #f59e0b 90%);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 16px 48px rgba(59, 130, 246, 0.15);
    --radius-card: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy aliases for tool pages */
    --bg-base: var(--bg-primary);
    --bg-elevated: var(--bg-secondary);
    --border: var(--card-border);
    --border-hover: rgba(59, 130, 246, 0.3);
    --nav-bg: rgba(10, 10, 15, 0.8);
    --input-bg: rgba(255, 255, 255, 0.04);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --accent-solid: var(--accent-purple);
    --accent-glow: rgba(139, 92, 246, 0.4);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ── NAVIGATION ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--text-primary); }

/* ── TOOL PAGE LAYOUT ── */
.tool-page-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.back-link {
    align-self: flex-start;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2.5rem;
    transition: var(--transition);
}

.back-link:hover { color: var(--text-primary); }

.tool-header {
    margin-bottom: 3rem;
    width: 100%;
}

.tool-header h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 1rem 0;
    line-height: 1.1;
    color: var(--text-primary);
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto;
}

.category-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(139, 92, 246, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ── TOOL CARD ── */
.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(24px) saturate(140%);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-card);
}

/* ── INPUTS ── */
.input-group {
    margin-bottom: 2rem;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.text-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

/* === SELECT / DROPDOWN FIX === */
select.text-input,
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a1a1aa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    padding-right: 3rem;
    cursor: pointer;
}

select.text-input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background-color: rgba(255, 255, 255, 0.06);
}

select option {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

select option:hover,
select option:checked {
    background-color: #3b82f6;
    color: #ffffff;
}

/* Mobile fix — force dark background on native select */
@media (max-width: 768px) {
    select, select.text-input {
        background-color: #1a1a2e !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff;
        font-size: 16px; /* prevents iOS auto-zoom on focus */
    }
    select option {
        background-color: #1a1a2e !important;
        color: #ffffff !important;
    }
}

/* ── GENERATE BUTTON ── */
.btn-generate {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    padding: 1.1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    box-shadow: 0 8px 16px -4px rgba(139, 92, 246, 0.4);
    font-family: 'Inter', sans-serif;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(139, 92, 246, 0.5);
}

.btn-generate:active { transform: translateY(0); }

/* ── RESULTS ── */
.results-area {
    width: 100%;
    margin-top: 2rem;
    text-align: left;
    display: none;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.result-item:hover { border-color: var(--border-hover); }

.result-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
}

.copy-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
}

/* ── HERO BLOBS (shared) ── */
.hero {
    position: relative;
    overflow: hidden;
}

.hero { position: relative !important; overflow: hidden !important; }
.hero-blob { position: absolute; border-radius: 50%; filter: blur(100px); z-index: 0; pointer-events: none; }
.blob-1 {
    width: 650px; height: 650px;
    background: radial-gradient(circle, #3b82f6, transparent 70%);
    top: -200px; left: -100px;
    opacity: 0.10;
    animation: blobDriftY 14s ease-in-out infinite alternate;
}
.blob-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    top: -50px; right: -80px;
    opacity: 0.08;
    animation: blobDriftX 11s ease-in-out infinite alternate-reverse;
}
.blob-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #1e3a8a, transparent 70%);
    bottom: -80px; left: 40%;
    opacity: 0.07;
    animation: blobPulse 9s ease-in-out infinite alternate;
}
@keyframes blobDriftY {
    from { transform: translateY(0px); }
    to   { transform: translateY(50px); }
}
@keyframes blobDriftX {
    from { transform: translateX(0px); }
    to   { transform: translateX(-45px); }
}
@keyframes blobPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.2); }
}
.hero > *:not(.hero-blob) { position: relative; z-index: 1; }

/* ── FOOTER ── */
footer {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
    background: var(--bg-primary);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 0.75rem;
    transition: var(--transition);
}

footer a:hover { color: var(--text-primary); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .tool-card { padding: 1.5rem; }
    .tool-header h1 { font-size: 2rem; }
    .nav-links a:not(.theme-toggle) { display: none; }
}
