/* TextForge Modern Design System */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #0f172a;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

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

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

/* Tool Hero */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Interface */
.tool-container {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.input-section, .output-section {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

textarea {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.btn-clear {
    background-color: #fee2e2;
    color: #ef4444;
}

.btn-clear:hover {
    background-color: #fecaca;
}

/* Homepage Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.tool-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

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

.tool-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Ad Placeholders */
.ad-slot {
    background-color: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 2rem 0;
    min-height: 100px;
    padding: 1rem;
    text-align: center;
}

.ad-top { min-height: 90px; }
.ad-mid { min-height: 250px; }
.ad-bottom { min-height: 250px; }

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    padding-bottom: 4rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    background-color: var(--bg-card);
    margin-top: 4rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2.25rem;
    }
    .actions {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}
