.definitionai-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.definitionai-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.definitionai-header h2 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
}

.definitionai-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.definitionai-chat-window {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
    scroll-behavior: smooth;
}

.definitionai-chat-window::-webkit-scrollbar {
    width: 8px;
}

.definitionai-chat-window::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.definitionai-chat-window::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.definitionai-chat-window::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.definitionai-welcome {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.definitionai-welcome h3 {
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
}

.definitionai-welcome p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

.definitionai-message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-user .message-bubble {
    background: #007bff;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-ai .message-bubble {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    text-align: left;
}

.message-content {
    line-height: 1.6;
    font-size: 15px;
}

.message-section {
    margin-bottom: 15px;
}

.message-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-weight: 700;
    color: #007bff;
    margin-bottom: 8px;
    font-size: 15px;
}

.message-ai .section-title {
    color: #007bff;
}

.section-content {
    color: #333;
    line-height: 1.7;
}

.example-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.example-item:last-child {
    border-bottom: none;
}

.suggestion-item {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: #f0f7ff;
    color: #007bff;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #007bff;
    color: #ffffff;
    transform: translateY(-2px);
}

.definitionai-input-area {
    background: #ffffff;
}

.definitionai-input-area textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.definitionai-input-area textarea:focus {
    outline: none;
    border-color: #007bff;
}

.definitionai-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.definitionai-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: #007bff;
    color: #ffffff;
    flex: 1;
    position: relative;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: block;
}

.definitionai-error {
    margin-top: 15px;
    padding: 15px;
    background: #fee;
    color: #c33;
    border-radius: 8px;
    border-left: 4px solid #c33;
    font-size: 14px;
}

.message-timestamp {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .definitionai-container {
        padding: 15px;
        border-radius: 0;
    }
    
    .definitionai-header h2 {
        font-size: 24px;
    }
    
    .definitionai-chat-window {
        min-height: 300px;
        max-height: 400px;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .definitionai-controls {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}