body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f9f6f1 0%, #e8ddd4 100%);
    min-height: 100vh;
    color: #4a3e36;
    line-height: 1.6;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(139, 117, 102, 0.2);
    overflow: hidden;
    height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(139, 117, 102, 0.1);
}

.chat-header {
    background: linear-gradient(135deg, #8b7566 0%, #a68875 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.chat-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    position: relative;
    z-index: 2;
    font-weight: 400;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fefefe 0%, #f9f6f1 100%);
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

.message.user {
    text-align: right;
}

.message.assistant {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    padding: 14px 20px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Mobile-responsive button styling */
.message-bubble button {
    background: linear-gradient(135deg, #8b7566 0%, #a68875 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 8px 4px;
    box-shadow: 0 4px 15px rgba(139, 117, 102, 0.3);
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 200px;
    text-align: center;
}

.message-bubble button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 117, 102, 0.4);
}

.message-bubble button:active {
    transform: translateY(0);
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }

    .chat-container {
        height: 75vh;
        margin: 10px;
        border-radius: 12px;
        max-width: calc(100vw - 20px);
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-header h1 {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .chat-header p {
        font-size: 13px;
        margin: 0;
    }

    .message-bubble {
        max-width: 80%;
        font-size: 14px;
        padding: 10px 14px;
        line-height: 1.4;
    }

    .message-bubble button {
        width: 100%;
        max-width: 100%;
        margin: 6px 0;
        padding: 10px 14px;
        font-size: 13px;
        display: block;
        border-radius: 20px;
        min-width: auto;
    }

    .chat-messages {
        padding: 10px;
        flex: 1;
        min-height: 0;
    }

    .chat-input {
        padding: 10px;
        gap: 8px;
        flex-shrink: 0;
    }

    .chat-input input {
        padding: 10px 14px;
        font-size: 16px;
        border-radius: 20px;
    }

    .chat-input button {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 20px;
        min-width: 50px;
    }

    .status {
        padding: 6px;
        font-size: 11px;
        flex-shrink: 0;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .chat-container {
        height: 70vh;
        margin: 5px;
        max-width: calc(100vw - 10px);
    }

    .chat-header {
        padding: 8px 10px;
    }

    .chat-header h1 {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .chat-header p {
        font-size: 12px;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 13px;
        padding: 8px 12px;
        line-height: 1.3;
    }

    .message-bubble button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 4px 0;
        border-radius: 16px;
    }

    .chat-messages {
        padding: 8px;
    }

    .chat-input {
        padding: 8px;
        gap: 6px;
    }

    .chat-input input {
        padding: 8px 12px;
        font-size: 15px;
        border-radius: 18px;
    }

    .chat-input button {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 18px;
        min-width: 45px;
    }

    .status {
        padding: 4px;
        font-size: 10px;
    }
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #8b7566 0%, #a68875 100%);
    color: white;
    border-bottom-right-radius: 8px;
}

.message.assistant .message-bubble {
    background: white;
    color: #4a3e36;
    border: 2px solid #e8ddd4;
    border-bottom-left-radius: 8px;
}

.chat-input {
    display: flex;
    padding: 16px 20px 20px 20px;
    background: white;
    border-top: 1px solid #e8ddd4;
    gap: 12px;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e8ddd4;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fafafa;
}

.chat-input input:focus {
    border-color: #8b7566;
    box-shadow: 0 0 0 3px rgba(139, 117, 102, 0.1);
    background: white;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b7566 0%, #a68875 100%);
    color: white;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(139, 117, 102, 0.25);
    font-family: inherit;
    white-space: nowrap;
}

.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 117, 102, 0.4);
}

.chat-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    display: none;
    text-align: center;
    padding: 15px;
    color: #8b7566;
    font-weight: 500;
    background: rgba(139, 117, 102, 0.1);
    margin: 10px 20px;
    border-radius: 12px;
}

.loading.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: #8b7566;
    background: rgba(139, 117, 102, 0.1);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.connected {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.status.connecting {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.status.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #8b7566;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #6b5d52;
}