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

:root {
    --bg-primary: #343541;
    --bg-secondary: #444654;
    --bg-input: #40414f;
    --text-primary: #ececf1;
    --text-secondary: #c5c5d2;
    --accent: #10a37f;
    --accent-hover: #1a7f64;
    --border: #565869;
}

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

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header .logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    align-items: center;
}

.header-nav .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.header-nav .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Chat area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 150px;
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Messages */
.message {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.message.user {
    background: var(--bg-primary);
}

.message.assistant {
    background: var(--bg-secondary);
}

.message-inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 24px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .avatar {
    background: #5436da;
    color: white;
}

.message.assistant .avatar {
    background: var(--accent);
    color: white;
}

.message-content {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
    padding-top: 4px;
}

.message-content p {
    margin-bottom: 16px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: #00d4ff;
    font-weight: 600;
}

.message-content a {
    color: #00d4ff;
    text-decoration: underline;
}

.message-content a:hover {
    color: #5ce1ff;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Welcome screen */
.welcome {
    max-width: 768px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.welcome h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome p {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.examples {
    display: grid;
    gap: 12px;
    text-align: left;
}

.example {
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: pre-line;
}

.example:hover {
    background: var(--bg-input);
}

/* Input area */
.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, var(--bg-primary) 50%);
    padding: 24px;
    padding-top: 48px;
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
    position: relative;
}

.input-wrapper {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    padding: 16px 16px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    transition: border-color 0.2s;
    min-height: 56px;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
}

.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 200px;
    min-height: 24px;
    line-height: 1.5;
    padding: 0;
    cursor: text;
}

.input-wrapper textarea::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    margin-left: 12px;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--accent-hover);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.input-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.input-footer a {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Result panel */
.result-panel {
    background: rgba(16, 163, 127, 0.1);
    border: 1px solid var(--accent);
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(16, 163, 127, 0.1);
    border-bottom: 1px solid var(--accent);
}

.result-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.result-summary {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.result-summary p {
    margin: 8px 0;
}

.iframe-container {
    height: 450px;
    background: #1a1a1a;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.view-full-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.view-full-link:hover {
    text-decoration: underline;
}

/* SEO Content Section */
.seo-content {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 60px 24px;
    color: var(--text-secondary);
}

.seo-inner {
    max-width: 900px;
    margin: 0 auto;
}

.seo-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.seo-content > p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 40px;
}

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

.seo-block h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.seo-block ul {
    list-style: none;
    padding: 0;
}

.seo-block li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.95rem;
}

.seo-block li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.seo-faq h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.seo-faq details {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.seo-faq details:last-child {
    border-bottom: none;
}

.seo-faq summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seo-faq summary::-webkit-details-marker {
    display: none;
}

.seo-faq summary::after {
    content: "+";
    font-size: 1.2rem;
    color: var(--accent);
}

.seo-faq details[open] summary::after {
    content: "-";
}

.seo-faq details p {
    margin-top: 12px;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Mobile */
@media (max-width: 768px) {
    .message-inner {
        padding: 0 16px;
        gap: 16px;
    }

    .avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .message-content {
        font-size: 15px;
    }

    .welcome h2 {
        font-size: 1.5rem;
    }

    .input-area {
        padding: 16px;
        padding-top: 32px;
    }

    .iframe-container {
        height: 300px;
    }

    .seo-content {
        padding: 40px 16px;
    }

    .seo-content h2 {
        font-size: 1.3rem;
    }

    .seo-grid {
        gap: 24px;
    }
}
