/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.logo-icon { font-size: 1.6rem; }
.accent { color: var(--primary-light); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15), transparent 70%);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.search-bar {
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus { border-color: var(--primary); }

/* ===== Tools Grid ===== */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.tool-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.tool-card:hover::before { opacity: 1; }

.tool-icon { font-size: 2.2rem; margin-bottom: 12px; }

.tool-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.tool-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

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

/* ===== Ad Container ===== */
.ad-container {
    min-height: 90px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Features ===== */
.why-section { padding: 60px 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.feature {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== FAQ ===== */
.faq-section { padding: 60px 0; }

.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--primary-light); }
.faq-item[open] summary::after { content: '−'; }

.faq-item summary:hover { background: var(--bg-hover); }

.faq-item p {
    padding: 0 24px 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Tool Page Layout ===== */
.tool-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px;
}

.tool-page h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.tool-page .tool-description {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.05rem;
}

.tool-workspace {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.tool-workspace textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

.tool-workspace textarea:focus { border-color: var(--primary); }

.btn-row {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--primary-light); }

.output-area {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    line-height: 1.6;
}

/* ===== Content Section (for tool pages) ===== */
.content-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.content-section h3 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

.content-section ul {
    color: var(--text-secondary);
    padding-left: 24px;
    margin-bottom: 12px;
}

.content-section li { margin-bottom: 6px; }

/* ===== Footer ===== */
footer {
    margin-top: 60px;
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-col p { color: var(--text-secondary); font-size: 0.9rem; }

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-secondary); font-size: 0.9rem; }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== Legal Pages ===== */
.legal-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 24px;
}

.legal-page h2 {
    font-size: 1.3rem;
    margin: 32px 0 12px;
}

.legal-page p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }
    .hero { padding: 50px 16px 40px; }
    .tools-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
}
