body {
    background: url('https://images.pexels.com/photos/144240/goat-lamb-little-grass-144240.jpeg') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Default height */
    max-height: 85svh; /* The key fix: use svh for a height that respects the browser UI */
    max-width: 420px;
    width: 90vw;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    overflow: hidden;
    position: fixed;
    top: 50%; /* Vertical centering */
    right: 0;
    transform: translateY(-50%); /* Moves the container up by 50% of its own height */
    margin-right: 1rem;
}

.chat-header, .chat-footer {
    flex-shrink: 0;
    background: #fff;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.chat-footer {
    border-top: 1px solid #eee;
    border-bottom: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.bubble-goat {
    background-color: #fff;
    border-radius: 20px 20px 20px 0;
    padding: 10px 16px;
    max-width: 70%;
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
    position: relative;
}

.bubble-user {
    background-color: #fef3c7;
    border-radius: 20px 20px 0 20px;
    padding: 10px 16px;
    max-width: 70%;
    margin-left: auto;
    margin-bottom: 0.5rem;
}

.mood-indicator {
    font-size: 0.7em;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

.mood-selector {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: #374151;
}

.mood-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mood-notification.show {
    opacity: 1;
}

@media (max-width: 640px) {
    .chat-container {
        width: 95vw;
        max-width: 95vw;
        margin-right: 0.5rem;
        top: 0; /* Align to top on small screens */
        transform: translateY(0); /* Remove vertical centering on small screens */
        height: 100dvh; /* Use dynamic viewport height for full screen on mobile */
        max-height: 100dvh; /* Ensure it doesn't exceed dynamic viewport height */
        border-radius: 0;
    }

    .chat-header {
        padding: 0.75rem 0.5rem;
    }

    .mood-selector {
        font-size: 10px;
        padding: 2px 4px;
    }

    .seo-sidebar {
        display: none;
    }
}

.bubble-goat, .bubble-user {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.seo-sidebar {
    position: fixed;
    left: 1rem;
    top: 10vh;
    width: 300px;
    height: 70vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
