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

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

:root {
    --bg: #0f0f13;
    --card: #1a1a2e;
    --border: rgba(255,255,255,0.08);
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent-1: #818cf8;
    --accent-2: #6366f1;
    --accent-3: #4f46e5;
    --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    --radius: 0.75rem;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    background: rgba(15,15,19,0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 1.2rem;
}
.logo-icon {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-family: var(--mono);
    font-weight: 700;
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.site-header nav a:hover { color: var(--text); }

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Ad Slots */
.ad-slot {
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 1.5rem 0;
}

/* Card */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-group.full {
    grid-column: 1 / -1;
}
.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.form-group .char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}
.form-group .char-count.warn {
    color: #fbbf24;
}
.form-group .char-count.over {
    color: #f87171;
}
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-2);
}
.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* Section titles */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    color: var(--accent-1);
}
.section-title:first-of-type {
    margin-top: 0.5rem;
}

/* Buttons */
.btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.btn-generate {
    background: var(--gradient);
    color: #fff;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--font);
    transition: opacity 0.2s;
}
.btn-generate:hover { opacity: 0.9; }
.btn-copy {
    background: transparent;
    color: var(--accent-1);
    border: 1px solid var(--accent-2);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.btn-copy:hover {
    background: rgba(99,102,241,0.1);
}
.btn-copy.copied {
    background: rgba(34,197,94,0.15);
    border-color: #22c55e;
    color: #4ade80;
}

/* Code output */
.code-output {
    background: #0c0c10;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    overflow-x: auto;
    display: none;
}
.code-output pre {
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-all;
}
.code-output .tag { color: #f87171; }
.code-output .attr { color: #fbbf24; }
.code-output .val { color: #4ade80; }

/* Previews */
.previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.preview-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.preview-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: 1rem;
}

/* Google Preview */
.google-preview .gp-url {
    font-size: 0.8rem;
    color: #4ade80;
    margin-bottom: 0.2rem;
    word-break: break-all;
}
.google-preview .gp-title {
    font-size: 1.1rem;
    color: #8ab4f8;
    font-weight: 500;
    margin-bottom: 0.25rem;
    cursor: pointer;
    line-height: 1.3;
}
.google-preview .gp-title:hover { text-decoration: underline; }
.google-preview .gp-desc {
    font-size: 0.85rem;
    color: #bdc1c6;
    line-height: 1.45;
}

/* OG Preview */
.og-preview {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}
.og-preview .og-image {
    width: 100%;
    height: 140px;
    background: #1e1e2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    overflow: hidden;
}
.og-preview .og-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.og-preview .og-body {
    padding: 0.75rem;
    background: #1e1e2e;
}
.og-preview .og-site {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.og-preview .og-title-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.2rem 0;
    line-height: 1.3;
}
.og-preview .og-desc-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Content Section */
.content-section {
    margin-top: 2rem;
}
.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.content-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
    color: var(--text);
}
.content-section p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 3rem;
}
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.site-footer nav a:hover { color: var(--text); }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .form-grid { grid-template-columns: 1fr; }
    .previews { grid-template-columns: 1fr; }
    .site-footer .container { flex-direction: column; gap: 1rem; text-align: center; }
    .btn-row { flex-direction: column; }
    .btn-generate, .btn-copy { width: 100%; text-align: center; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.4rem; }
    .site-header nav { gap: 0.75rem; }
    .site-header nav a { font-size: 0.8rem; }
}
